Instrument the Codex agent loop on Cloudflare Workers
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- ai-infra-agents, javascript, typescript
研究方向
Read the related issues #16966, #18910, and #24993, then inspect the existing instrumentAgentWithSentry support and pi-durable instrumentation mentioned in the issue. Reproduce the Cloudflare example with its offline StressModel and a tool-calling turn to confirm which spans are missing. Done means agent runs, Task steps, and direct LanguageModelV4.doStream/doGenerate calls are represented in traces, including aborted and replayed turns.
由索引模型根據 Issue 內容生成。
描述
Problem Statement
Cloudflare's Codex agent loop example (changelog) runs the Codex turn loop in a plain DurableObject composed with the Agents SDK Lifecycle, Tasks, Sessions, and Streams capabilities. With @sentry/cloudflare 11.12.0 and sentryCloudflareVitePlugin, a turn runs and request, alarm, and error traces work. The agent loop itself does not show up in traces.
Observed running the example locally in workerd (agents 0.33.0, the example's offline StressModel, a turn with tool calls):
- No
gen_aispans. The harness callsmodel.doStream()on theLanguageModelV4directly, notstreamText/generateText, so the Vercel AI integration does not see model calls. Tools run inside the harness, so there are noexecute_toolspans either. With a real Workers AI binding,instrumentWorkersAiClientmay add bare chat spans (not verified). There would still be no agent or tool spans. - The turn is an anonymous alarm trace.
Tasksenqueues the turn and a Durable Object alarm runs it. The alarm trace links to the request that scheduled it (previous_trace), but nothing marks it as an agent run or shows its Task run and steps. - Lost segment when the object resets. When the Durable Object aborts mid-turn (
ctx.abort), the aborted alarm's child spans arrive without their parent alarm segment, and no error is recorded. The replayed run succeeds in a new alarm trace with nothing that ties it to the aborted attempt.
Solution Brainstorm
Starting points, not a design:
- Recognize
Lifecycle.install(this)Durable Objects and the Task runs and steps they execute, the wayinstrumentAgentWithSentrycoversAgentclasses and PiHarness is covered for pi-durable. - Capture model calls made through
LanguageModelV4.doStream/doGenerate, not only through theaihelpers.
Additional Context
Related: getsentry/sentry-javascript#16966, getsentry/sentry-javascript#18910, getsentry/sentry-javascript#24993
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
via Jan Peer Stöcklmair.
--
- 主要語言
- TypeScript
- 星號
- 8.8k
- 分支
- 1.9k
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 744
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
getsentry/sentry-javascript 的其他 Issue
-
AWS Lambda Waiting for: Product Owner
難度 1/5 1 小時以內 新手友好度 82/100
getsentry/sentry-javascript#26910 · 1 則留言 ·
維護者通常 1 天內回覆
-
Only create Nuxt database and storage spans when there is a parent span可能重新可做 關聯的 PR 已關閉且未合併。 未關閉Improvement Nuxt
難度 2/5 1-3 小時 新手友好度 83/100
getsentry/sentry-javascript#25805 · 3 則留言 ·
維護者通常 1 天內回覆
-
Only create Cloudflare storage and D1 db spans when there is a parent span可能重新可做 關聯的 PR 已關閉且未合併。 未關閉Cloudflare Workers Improvement Spans
難度 2/5 1-3 小時 新手友好度 78/100
getsentry/sentry-javascript#25804 · 1 則留言 ·
維護者通常 1 天內回覆
-
Core Feature: Typescript Meta: Breaking
難度 2/5 1-3 小時 新手友好度 65/100
getsentry/sentry-javascript#25286 · 2 則留言 ·
維護者通常 1 天內回覆
-
javascript
難度 2/5 1-3 小時 新手友好度 75/100
getsentry/sentry-javascript#24200 · 2 則留言 ·
維護者通常 1 天內回覆
查看 getsentry/sentry-javascript 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
garrytan/gbrain#10437 · 1 則留言 ·
維護者通常 1 天內回覆
-
Bedrock "Too many tokens" throttle is not auto-retried, unlike "Too many requests"可能已有人在做 @acmerfight 今天認領。 未關閉untriaged
難度 2/5 1-3 小時 新手友好度 78/100
earendil-works/pi#12573 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 70/100
agentes-chat/agentes-chat#1506 ·
維護者通常 1 天內回覆
-
comp/desktop desktop/files os/windows P2 type/perf
難度 2/5 1-3 小時 新手友好度 80/100
NousResearch/hermes-agent#160359 ·
維護者通常 1 天內回覆
-
Missing repro Platform: Android
難度 2/5 1-3 小時 新手友好度 76/100
software-mansion/react-native-reanimated#11554 · 1 則留言 ·
維護者通常 1 天內回覆