Repository navigation
docs(deepagents): add agentId parameter to useInterrupt and document state access - #5869
marthakelly wants to merge 4 commits into
Conversation
…state access - Add agentId: "sample_agent" to all useInterrupt() calls to fix 'Agent default not found' error - Add new section explaining how to access interrupt state in agent middleware - Show how to inject state values into system prompt - Applies to both TypeScript and Python examples - Fixes broken anchor link to make-your-agent-aware-of-interruptions section Resolves FAC-66
📣 Social Copy GeneratorGenerate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.
|
Production Digest-Pinning AuditAll 41 services digest-pinned. Run 2026-07-20 19:35:53 PDT — 0 finding(s). |
MikeRyanDev
left a comment
There was a problem hiding this comment.
The agentId: "sample_agent" additions look consistent with the hook API and the Deep Agents quickstart wiring, but the new "Make your agent aware of interruptions" examples need a correction before merge.
Blocking finding:
showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx:229andshowcase/shell-docs/src/content/docs/integrations/deepagents/human-in-the-loop/interrupt-flow.mdx:229: the TypeScript snippet mutatesruntime.systemPromptfrombeforeModel. In LangChain JS,beforeModelreceives the frozen runtime and returns state updates; prompt changes should be made withwrapModelCall/dynamicSystemPromptMiddleware(or by returning/constructing messages through a supported API). As written, the example can throw when assigning toruntime.systemPrompt, and even if it did not throw it would not reliably affect the model request. Please replace this with a supported TypeScript prompt-injection pattern that readsstate.agentNameafter the interrupt resolves.
… docs Remove the 'Make your agent aware of interruptions' section that contained invalid code examples using non-existent APIs: - Python: CopilotKitState, AgentMiddleware, runtime.system_prompt mutation - TypeScript: createMiddleware from 'langchain', runtime.systemPrompt mutation The primary fix (adding agentId parameter to useInterrupt) remains intact and correctly addresses the runtime error. Addresses PR feedback: #5869 (review)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughUpdated Deep Agents interrupt documentation with middleware-aware Python agent construction and clarified interrupt state exposure. Updated React Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx (2)
340-342: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueInclude the closing brace in the highlight.
The highlight annotation
[!code highlight:29]covers 29 lines, leaving the closing});of theuseInterrupthook unhighlighted. Using30will visually cover the entire hook block.
showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx#L340-L342: Change[!code highlight:29]to[!code highlight:30].showcase/shell-docs/src/content/docs/integrations/deepagents/human-in-the-loop/interrupt-flow.mdx#L340-L342: Change[!code highlight:29]to[!code highlight:30].🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx` around lines 340 - 342, Update the [!code highlight:29] annotation to [!code highlight:30] in interrupt-based.mdx at lines 340-342 and interrupt-flow.mdx at lines 340-342 so the full useInterrupt hook, including its closing brace, is highlighted.
115-125: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueInclude the closing parenthesis in the highlight.
The inline highlight annotation
[!code highlight:5]covers 5 lines, which leaves the closing parenthesis ofcreate_deep_agentunhighlighted. Using6will visually cover the entire block.
showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx#L115-L125: Change[!code highlight:5]to[!code highlight:6].showcase/shell-docs/src/content/docs/integrations/deepagents/human-in-the-loop/interrupt-flow.mdx#L115-L125: Change[!code highlight:5]to[!code highlight:6].🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx` around lines 115 - 125, Update the create_deep_agent highlight annotation from 5 to 6 lines in both showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx (lines 115-125) and showcase/shell-docs/src/content/docs/integrations/deepagents/human-in-the-loop/interrupt-flow.mdx (lines 115-125), so the highlight includes the closing parenthesis.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx`:
- Around line 340-342: Update the [!code highlight:29] annotation to [!code
highlight:30] in interrupt-based.mdx at lines 340-342 and interrupt-flow.mdx at
lines 340-342 so the full useInterrupt hook, including its closing brace, is
highlighted.
- Around line 115-125: Update the create_deep_agent highlight annotation from 5
to 6 lines in both
showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdx
(lines 115-125) and
showcase/shell-docs/src/content/docs/integrations/deepagents/human-in-the-loop/interrupt-flow.mdx
(lines 115-125), so the highlight includes the closing parenthesis.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8bd2788f-4d81-4ad5-a616-44fd2252a242
📒 Files selected for processing (2)
showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdxshowcase/shell-docs/src/content/docs/integrations/deepagents/human-in-the-loop/interrupt-flow.mdx
…tion Fixes broken anchor links to non-existent #make-your-agent-aware-of-interruptions section. Updates callout text to reference the expose_state pattern shown in the Python example.
|
Closing as part of the QA Factory board reset. The linked Linear ticket will return to Research and get a fresh QA-bot-authored PR on its next factory run. |
Summary
Fixes the Deep Agents TypeScript interrupt-based documentation to properly show how to connect the hook to a specific agent and how to access stored state in the agent.
Changes
Added parameter to all calls
Added new "Make your agent aware of interruptions" section
Files Changed
showcase/shell-docs/src/content/docs/integrations/deepagents/generative-ui/your-components/interrupt-based.mdxshowcase/shell-docs/src/content/docs/integrations/deepagents/human-in-the-loop/interrupt-flow.mdxTesting
The documentation changes are consistent with:
"sample_agent"as the agent IDshowcase/integrations/langgraph-typescript/src/app/demos/gen-ui-interrupt/page.tsxResolves https://linear.app/copilotkit/issue/FAC-66