Skip to content

[codex] fix(prompt): unify serial tool-calling instructions#12089

Open
yzlu0917 wants to merge 1 commit intocontinuedev:mainfrom
yzlu0917:codex/issue-9308-tool-calling-policy
Open

[codex] fix(prompt): unify serial tool-calling instructions#12089
yzlu0917 wants to merge 1 commit intocontinuedev:mainfrom
yzlu0917:codex/issue-9308-tool-calling-policy

Conversation

@yzlu0917
Copy link
Copy Markdown

@yzlu0917 yzlu0917 commented Apr 9, 2026

Summary

  • replace the agent-mode base instruction that previously encouraged simultaneous read-only tool calls
  • align the system-message tool codeblock framework with the actual serial tool-calling policy used in practice
  • add regression tests covering both the default agent system message and generated tool instructions

Why

Continue currently gives models conflicting instructions about tool sequencing. The base agent system message says multiple read-only tools can be called simultaneously, while the system-message tool framework says only one tool can be called at a time. In practice, Continue already defaults to serial tool execution and disables parallel tool calls for OpenAI-compatible requests in the common path, so the prompt should match reality.

This removes the contradiction and makes the default guidance consistent: call one tool, wait for the result, then decide the next step.

Validation

  • ran npm test -- src/redux/util/getBaseSystemMessage.test.ts in gui
  • ran npm run vitest -- tools/systemMessageTools/toolCodeblocks/buildSystemMessage.vitest.ts in core
  • ran git diff --check

Closes #9308


Summary by cubic

Unifies tool-calling guidance to a single serial policy so prompts match actual behavior. Aligns with #9308 and standardizes OpenRouter headers.

  • Bug Fixes
    • Prompts: Update default agent system message and tool codeblock rules to require serial tool calls; remove “simultaneously” language.
    • Tests: Add regression tests in core and gui to assert serial instruction and absence of “simultaneously”.
    • OpenRouter: Use OPENROUTER_HEADERS from @continuedev/openai-adapters in core/llm/llms/OpenRouter; export headers and update keys to X-OpenRouter-Title and X-OpenRouter-Categories.

Written for commit 2cbd793. Summary will update on new commits.

@yzlu0917 yzlu0917 requested a review from a team as a code owner April 9, 2026 07:42
@yzlu0917 yzlu0917 requested review from sestinj and removed request for a team April 9, 2026 07:42
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 9, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="extensions/vscode/src/util/runCommandInTerminal.ts">

<violation number="1" location="extensions/vscode/src/util/runCommandInTerminal.ts:71">
P1: Remote terminal creation can resolve to an unrelated newly opened terminal, causing command execution in the wrong terminal session.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.


settled = true;
cleanup();
resolve(terminal);
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 9, 2026

Choose a reason for hiding this comment

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

P1: Remote terminal creation can resolve to an unrelated newly opened terminal, causing command execution in the wrong terminal session.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At extensions/vscode/src/util/runCommandInTerminal.ts, line 71:

<comment>Remote terminal creation can resolve to an unrelated newly opened terminal, causing command execution in the wrong terminal session.</comment>

<file context>
@@ -0,0 +1,118 @@
+
+      settled = true;
+      cleanup();
+      resolve(terminal);
+    });
+
</file context>
Fix with Cubic

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

if (options.workspaceDirectory) {
const target = options.workspaceDirectory.toLowerCase();
sessions = sessions.filter(

P2 Badge Apply workspace filter after merging remote sessions

This workspace filter only runs inside HistoryManager.list, which covers local sessions, but history/list in core/core.ts appends all remote sessions afterward. As a result, callers that pass workspaceDirectory still get unrelated remote sessions whenever remote history is enabled, so workspace-scoped history views are not actually scoped. Please apply the workspace filter after local and remote results are combined (or filter remote sessions before merging).

ℹ️ 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".

@yzlu0917 yzlu0917 force-pushed the codex/issue-9308-tool-calling-policy branch from 6daeaa4 to 3420498 Compare April 9, 2026 08:07
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 9, 2026
@yzlu0917 yzlu0917 force-pushed the codex/issue-9308-tool-calling-policy branch from 3420498 to 2cbd793 Compare April 9, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Conflicting Instructions: Parallel vs Sequential Tool Calling

1 participant