MCP: expose span status and status message in inspect_span
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- api, observability
Hướng nghiên cứu
Start by reading packages/domain/src/mcp-outputs/traces.ts to compare TraceSpanOutput, which already carries status, against InspectSpanOutput, which does not. Then follow apps/ai/src/mcp/tools/inspect-span.ts for the handler and renderer, using apps/ai/src/mcp/lib/render-trace.ts as the rendering reference; check whether the span-detail query already selects statusCode/statusMessage before extending it. Done looks like structured and text output showing Unset, Ok, and Error distinctly, agreeing with inspect_trace, plus tests for error-with-message, error-without-message, Ok, Unset, and missing span.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
An agent inspecting one span cannot read its explicit OpenTelemetry status from inspect_span. The tool returns span attributes, resource attributes, and an optional AI decode, but its output schema and renderer omit statusCode and statusMessage.
A Worker can catch a failed operation, mark its custom span as an error, and still return a successful HTTP response. An agent needs that span status to understand the operation's result. Currently it must fetch inspect_trace separately, which already exposes these fields.
Why this matters for Cloudflare now
Cloudflare's October 26, 2026 Workers tracing update adds span.setStatus() to native custom spans. The explicit status and optional error message are included in exported OTLP traces, while the Workers Observability dashboard does not yet show span status.
This makes the existing MCP output gap more useful to close. The feature should work for spans from all OpenTelemetry producers.
Current code
Checked against main at 7edfccb17c3f524f9d793e0a11893fcf0535737e:
InspectSpanOutputandTraceSpanOutput: the single-span output omits status; the trace-span output includes it.inspect_spanhandler and renderer.inspect_tracerenderer already renders explicit status and error messages.
Proposed change
Expose the stored statusCode and statusMessage in both the structured and text results of inspect_span. Keep existing attributes, AI decoding, and missing-span behavior. Extend the span-detail query if needed.
Keep HTTP response status and OpenTelemetry span status separate. Do not infer an explicit Ok from a missing or unset status.
Acceptance criteria
inspect_spanreturns and renders the stored status and error message for a found span.- Unset, Ok, and Error remain distinct and agree with
inspect_tracefor the same span. - A custom span marked Error remains visible as failed even when the enclosing HTTP request succeeds.
- Tests cover an error with a message, an error without a message, Ok, Unset, and a missing span.
- Include a native Workers OTLP fixture using
setStatus({ code: "error", message: "Probe failed" }), or verify the same path with a small Worker export.
Evidence: source inspection. A live Cloudflare-to-Maple export has not been tested for this report.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.8k
- Fork
- 120
- Merge trung bình
- 8 giờ 11 phút
- Pull request đã merge (30 ngày)
- 667
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MapleTechLabs/maple
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MapleTechLabs/maple#1921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
MapleTechLabs/maple#1888 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Alerting: Linear as a destination type, opening one issue per incidentCó thể đã có người làm @Makisuo đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
MapleTechLabs/maple#1896 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@maple-dev/alchemy: typed dashboard props, a managed refresh interval, and adopting a dashboard built in the UICó thể đã có người làm @jasonkuhrt đã nhận 2 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
MapleTechLabs/maple#1891 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
MapleTechLabs/maple#1874 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MapleTechLabs/maple
Issue tương tự
-
area:plugins area:security area:skills bug has repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
anthropics/claude-code#105911 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifactsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Fission-AI/OpenSpec#2165 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐞 bug 🧐 unconfirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Tencent/tdesign-vue-next#7032 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
gnosis/gnosis_vpn#661 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content-freshness: staleOwnedContent doc comments still say 'complete receipt' (follow-up to #7912)Đang mởtriage:bug-verified
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 1 ngày