Skip to content

Agent JS-fication (1.5.0)#1674

Open
toubatbrian wants to merge 3 commits into
mainfrom
1.5.0
Open

Agent JS-fication (1.5.0)#1674
toubatbrian wants to merge 3 commits into
mainfrom
1.5.0

Conversation

@toubatbrian
Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 1, 2026

🦋 Changeset detected

Latest commit: 57c1634

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 34 packages
Name Type
@livekit/agents Major
@livekit/agents-plugin-google Major
@livekit/agents-plugin-openai Major
@livekit/agents-plugin-anam Major
@livekit/agents-plugin-assemblyai Major
@livekit/agents-plugin-baseten Major
@livekit/agents-plugin-bey Major
@livekit/agents-plugin-cartesia Major
@livekit/agents-plugin-cerebras Major
@livekit/agents-plugin-deepgram Major
@livekit/agents-plugin-elevenlabs Major
@livekit/agents-plugin-fishaudio Major
@livekit/agents-plugin-hedra Major
@livekit/agents-plugin-hume Major
@livekit/agents-plugin-inworld Major
@livekit/agents-plugin-lemonslice Major
@livekit/agents-plugin-liveavatar Major
@livekit/agents-plugin-livekit Major
@livekit/agents-plugin-minimax Major
@livekit/agents-plugin-mistral Major
@livekit/agents-plugin-mistralai Major
@livekit/agents-plugin-neuphonic Major
@livekit/agents-plugin-perplexity Major
@livekit/agents-plugin-phonic Major
@livekit/agents-plugin-resemble Major
@livekit/agents-plugin-rime Major
@livekit/agents-plugin-runway Major
@livekit/agents-plugin-sarvam Major
@livekit/agents-plugin-silero Major
@livekit/agents-plugin-soniox Major
@livekit/agents-plugin-tavus Major
@livekit/agents-plugins-test Major
@livekit/agents-plugin-trugen Major
@livekit/agents-plugin-xai Major

Not sure what this means? Click here to learn what changesets are.

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

…1525)

Co-authored-by: rosetta-livekit-bot[bot] <282703043+rosetta-livekit-bot[bot]@users.noreply.github.com>
Co-authored-by: u9g <jason.lernerman@livekit.io>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b85bfea91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +413 to +414
for (const inner of tool.tools) {
addTool(inner);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Rebuild dynamic toolsets after setup

For a dynamic Toolset.create({ tools: () => client.getTools(), setup: ... }) as documented above, this loop snapshots tool.tools into _functionToolsMap when the ToolContext is constructed, before AgentActivity.setupToolsets() runs. If setup() connects/discovers tools, the later realtime/session updates and tool execution still read the stale map, so newly discovered tools are never advertised or executable unless the caller manually calls updateTools() again.

Useful? React with 👍 / 👎.

/** Code interpreter container ID or configuration. */
readonly container: OpenAI.Responses.Tool.CodeInterpreter['container'] | null;

constructor({ container = null }: CodeInterpreterOptions = {}) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Provide a default Code Interpreter container

When callers use new CodeInterpreter() (the advertised no-arg constructor), container defaults to null and toToolConfig() omits it, but the OpenAI Responses Code Interpreter tool requires a container value (for example { type: 'auto' } or a container id). As a result, enabling this tool with the default options produces a request that the API rejects before the model can run code.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment on lines +371 to +373
get providerTools(): ProviderTool[] {
return this._providerTools;
}
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.

🟡 providerTools getter returns mutable internal array instead of a defensive copy

The providerTools getter at agents/src/llm/tool_context.ts:371-373 returns this._providerTools directly, despite the JSDoc saying "A copy of all provider tools". Every other collection getter on ToolContext returns a defensive copy: functionTools creates a new object via Object.fromEntries() (line 367), toolsets spreads into a new array [...this._toolsets] (line 377), and tools spreads into [...this._tools] (line 384). Since providerTools returns the raw internal array, any caller that mutates the returned list (e.g. .push(), .splice()) would silently corrupt the ToolContext's internal state, affecting equals() comparisons, flatten() results, and hasTool() lookups.

Suggested change
get providerTools(): ProviderTool[] {
return this._providerTools;
}
get providerTools(): ProviderTool[] {
return [...this._providerTools];
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 11 additional findings in Devin Review.

Open in Devin Review

Comment on lines +204 to +210
if (tools.length > 0 && providerTools.length > 0) {
throw new Error('Gemini does not support mixing function tools and provider tools');
}

if (onlySingleType && tools.length > 0) {
return tools;
}
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.

🔴 onlySingleType guard is unreachable when function tools and provider tools coexist

In toToolsConfig, the error at line 204 ('Gemini does not support mixing function tools and provider tools') fires before the onlySingleType early-return at line 208 can take effect. The Google Chat LLM at plugins/google/src/llm.ts:361 calls toToolsConfig({ ..., onlySingleType: true }) specifically to handle the case where function tools should be preferred over provider tools. But if a user constructs a ToolContext with both function tools and GeminiTool provider tools (e.g. new ToolContext([tool({name:'foo',...}), new GoogleSearch()])), the Chat LLM will throw instead of gracefully returning just the function tools. The onlySingleType check at line 208 should be moved before the mixing error at line 204, so it can short-circuit and return function tools only.

Suggested change
if (tools.length > 0 && providerTools.length > 0) {
throw new Error('Gemini does not support mixing function tools and provider tools');
}
if (onlySingleType && tools.length > 0) {
return tools;
}
if (onlySingleType && tools.length > 0) {
return tools;
}
if (tools.length > 0 && providerTools.length > 0) {
throw new Error('Gemini does not support mixing function tools and provider tools');
}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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