Skip to content

ui: enable the agentic flow when only the JS sandbox is active#25865

Merged
allozaur merged 1 commit into
ggml-org:masterfrom
ServeurpersoCom:ui/js-sandbox-only-agentic
Jul 20, 2026
Merged

ui: enable the agentic flow when only the JS sandbox is active#25865
allozaur merged 1 commit into
ggml-org:masterfrom
ServeurpersoCom:ui/js-sandbox-only-agentic

Conversation

@ServeurpersoCom

Copy link
Copy Markdown
Contributor

Overview

Enable the agentic infrastructure even when the browser-side JS sandbox is the only active tool source. The agentic gate counted MCP servers, builtin and custom tools but not frontend tools, so with the sandbox alone the flow was skipped, no tools field reached the server and the chat template rendered without the tool system prompt.

Additional information

Fixes #25856

Requirements

The agentic gate counted MCP servers, builtin and custom tools but not
frontend tools, so with the JS sandbox as the only tool source the
agentic flow was skipped, no tools field reached the server and the
chat template rendered without the tool system prompt.

The sandbox is fully client-side: frontendTools derives from the
Developer settings toggle alone, counting it in the gate restores that
single source of truth.
@ServeurpersoCom
ServeurpersoCom requested a review from a team as a code owner July 18, 2026 16:12
@ServeurpersoCom
ServeurpersoCom requested a review from allozaur July 19, 2026 08:48
@rankaiyx

Copy link
Copy Markdown
Contributor

Testing has confirmed that the issue has been resolved.

LGTM

<|im_start|>system
# Tools

You have access to the following functions:

<tools>
{"type": "function", "function": {"name": "run_javascript", "description": "Execute JavaScript in a sandboxed browser worker (no DOM, no page access). Top level await is supported. Use console.log to print intermediate values; a top level return statement is captured as the result.", "parameters": {"type": "object", "properties": {"code": {"type": "string", "description": "JavaScript source to execute"}, "timeout_ms": {"type": "number", "description": "Execution timeout in milliseconds, default 10000, max 30000"}}, "required": ["code"]}}}
</tools>

If you choose to call a function ONLY reply in the following format with NO suffix:<think>
Brief explanation of tool call
</think>
<tool_call>
<function=example_function_name>
<parameter=example_parameter_1>
value_1
</parameter>
<parameter=example_parameter_2>
This is the value for the second parameter
that can span
multiple lines
</parameter>
</function>
</tool_call>
<IMPORTANT>
Reminder:
- You can use the <think></think> block to plan your next tool call OR to synthesize data and formulate your final response to the user.
- ALL explanation and reasoning MUST be placed strictly inside the <think></think> block.- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags.- If you choose to call a tool, you MUST output the <tool_call> block IMMEDIATELY after thinking, with NO conversational text before it.- The <tool_call> and <function> tags MUST be at the very beginning of a new line, with NO spaces or indentation before them.- To call multiple functions, output a separate, completely closed <tool_call></tool_call> block for EACH function. Do NOT nest <tool_call> blocks.
- If you have all necessary data, provide your final answer directly to the user without any tool call.
</IMPORTANT><|im_end|>

@allozaur
allozaur merged commit 1521a9a into ggml-org:master Jul 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: JS Sandbox Tool Not Included in Chat Template When No Server Tools Are Enabled

4 participants