Skip to content

fix(js/ai): correctly tag registered interrupt as a non-dynamic tool#5376

Merged
pavelgj merged 1 commit into
mainfrom
pj/define-interrupt-not-dynamic
May 23, 2026
Merged

fix(js/ai): correctly tag registered interrupt as a non-dynamic tool#5376
pavelgj merged 1 commit into
mainfrom
pj/define-interrupt-not-dynamic

Conversation

@pavelgj
Copy link
Copy Markdown
Member

@pavelgj pavelgj commented May 21, 2026

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the defineInterrupt function to explicitly remove the dynamic metadata flag before registration and adds a test case to verify this behavior. The reviewer suggests refactoring defineInterrupt to use defineTool instead of manual registration to ensure consistency across API versions and reduce code duplication.

Comment thread js/ai/src/tool.ts
@MichaelDoyle
Copy link
Copy Markdown
Contributor

MichaelDoyle commented May 22, 2026

Can you add interrupts to /tool.v2? Or does that not make sense.

I think DevUI is going to skip these if it detects any other v2 tools (we assume all are of a single type).

@pavelgj
Copy link
Copy Markdown
Member Author

pavelgj commented May 23, 2026

Can you add interrupts to /tool.v2? Or does that not make sense.

I think DevUI is going to skip these if it detects any other v2 tools (we assume all are of a single type).

Hmm... I'm not sure if it's a breaking change to convert to interrupt to a tool.v2... will have to defer that.
But, I don't think the Dev UI behaviour is correct. That determination must be done per-tool. Today we only define tool.v2 for multipart tools, regular tools are still defined as tool

@pavelgj pavelgj merged commit c72554c into main May 23, 2026
8 checks passed
@pavelgj pavelgj deleted the pj/define-interrupt-not-dynamic branch May 23, 2026 01:34
@MichaelDoyle
Copy link
Copy Markdown
Contributor

MichaelDoyle commented May 23, 2026 via email

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants