Skip to content

agent-think: use observability preview and 250 steps#1960

Open
mattzcarey wants to merge 1 commit into
mainfrom
feat/agent-think-observability-preview
Open

agent-think: use observability preview and 250 steps#1960
mattzcarey wants to merge 1 commit into
mainfrom
feat/agent-think-observability-preview

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pin agent-think to the immutable preview packages produced by observability PR feat: Cloudflare-native AI tracing (agents/observability/ai) #1860 at commit be4f7abc
  • opt agent-think into full model-message and tool argument/result spans with storeMessages and storeTools
  • raise the long-running review/demo safety cap from 100 to 250 steps

Why

The latest review/demo run for #1718 exhausted the 100-step cap after 104 successful bash calls and two recovered container errors. Production currently emits no custom invoke_agent, chat, or execute_tool spans, so the terminal status shows only that another tool was requested at step 100, not the model/tool topology that led there.

This PR gives agent-think the same tracing behavior consistently through pinned dependencies rather than deploying the #1860 source branch directly.

Dependency provenance

Top-level dependencies are pinned to PR #1860 commit be4f7abcf892a39449ec630b24e7f19e61309e92:

  • agents
  • @cloudflare/ai-chat
  • @cloudflare/think

Their transitive preview family is recorded in pnpm-lock.yaml with exact pkg.pr.new URLs and integrity hashes. A one-time local resolver override was used only to create the lock entry; normal pnpm install --frozen-lockfile succeeds with the repository's default exotic-subdependency policy.

Verification

  • agent-think: 39 tests passed
  • agent-think and E2E TypeScript projects passed
  • full monorepo build: 25 targets passed
  • pnpm run check: exports, formatting, lint, and all 117 TypeScript projects passed
  • normal frozen offline install passed with default supply-chain policy

Production plan

After review, deploy code-only with --containers-rollout none, preserving the existing container image. Then continue the existing failed cloudflare-agents-1718 session through the command center without adding another GitHub comment and inspect the resulting invoke_agent, chat, and execute_tool trace.

Depends on #1860.


Open in Devin Review

Production validation

  • Deployed this exact PR commit (4628163d) code-only as Worker version b602b2a9-b85a-4a33-8a96-dd2ec99cc189; the existing container image was preserved.

  • Continued the existing cloudflare-agents-1718 session without a new comment.

  • The continuation completed after 39 tool calls (27 before one runtime interruption, then 12 after automatic recovery); the 250-step limit was not reached.

  • The trace captured GPT-5.6 Sol chat spans plus full execute_tool arguments/results and one completed invoke_agent span after recovery.

  • The completed review found a residual stacked-near-match polynomial scan and opened fix(worker-bundler): bound stacked import scans (#1718) #1961 with commit 229b8b3f; worker-bundler tests/build and the temporary live demo passed. CI on fix(worker-bundler): bound stacked import scans (#1718) #1961 is green.

Trace diagnosis

The 100-step failure was not one repeated command. It was an unbounded review/fix/test/demo workflow amplified by environment recovery:

  • The original turn used 110 tools across 100 model steps.

  • A container failure removed the checkout mid-turn; the model recloned and reconstructed its work.

  • GitHub authentication disappeared with that container, but agent-think retained its in-memory “already authenticated” marker for the turn, so later push attempts failed and the model spent its final steps diagnosing credentials and preserving the patch.

  • The final successful tool at the cap exported the patch; the model had not transitioned to a final response.

The actionable bug is container-generation-aware auth/workspace recovery, plus an explicit completion/finalization budget. Raising the cap provided diagnostic headroom but was not itself the fix.

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4628163

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1960

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1960

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1960

create-think

npm i https://pkg.pr.new/create-think@1960

hono-agents

npm i https://pkg.pr.new/hono-agents@1960

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1960

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1960

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1960

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1960

commit: 4628163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant