Skip to content

fix: serialize unsupported parallel tool calls - #197

Merged
franciscojavierarceo merged 2 commits into
mainfrom
codex/disable-parallel-tool-calls
Aug 21, 2026
Merged

franciscojavierarceo merged 2 commits into
mainfrom
codex/disable-parallel-tool-calls

Conversation

@franciscojavierarceo

Copy link
Copy Markdown
Collaborator

Summary

  • Accept client requests with parallel_tool_calls: true for compatibility.
  • Force the upstream Responses request to use parallel_tool_calls: false until gateway parallel tool execution is supported.
  • Emit a startup warning documenting the serialized behavior.
  • Addresses the interim behavior discussed in Testing with codex: Handle parallel_tool_calls flag #190 and avoids rejecting Codex requests based on client configuration.

Test Plan

  • cargo clippy --all-targets -- -D warnings
  • cargo test --workspace
  • cargo fmt --all -- --check
  • git diff --check

Full workspace tests passed; PostgreSQL integration tests were skipped because TEST_POSTGRES_URL was not configured.

@franciscojavierarceo
franciscojavierarceo force-pushed the codex/disable-parallel-tool-calls branch from 324acb3 to b732f0d Compare August 21, 2026 18:12
@franciscojavierarceo
franciscojavierarceo merged commit e35fbb2 into main Aug 21, 2026
6 checks passed
@franciscojavierarceo

Copy link
Copy Markdown
Collaborator Author

This actually fixed #190

franciscojavierarceo added a commit that referenced this pull request Aug 21, 2026
Reference #197 (serialized parallel tool calls) instead of the reverted
#191 in the Codex catalog comment and the harness testing guide.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Francisco Javier Arceo <[email protected]>
franciscojavierarceo added a commit that referenced this pull request Aug 21, 2026
## Summary

On current `main`, both harness paths of the `agentic` CLI fail out of
the box against vLLM serving Qwen:

- `agentic run codex --upstream … --model …` → Codex exits with `Error
loading config.toml: … unexpected key or value, expected newline`. The
generated file contains literal `\n` sequences instead of newlines.
- `agentic run claude --upstream … --model …` (without `--yolo`) → `API
Error: 500 Unexpected reasoning effort high. Supported types are xhigh
(default), medium, and low`. The compatible effort was only pinned under
`--yolo`.

This PR fixes those and the other CLI failure modes hit while
reproducing #190 end-to-end. It does **not** change gateway behavior for
`parallel_tool_calls`; that is #197. The Codex catalog keeps
`supports_parallel_tool_calls: false` to match #197's serialized
execution.

- **Codex config**: write `config.toml` with real newlines and complete
the model catalog schema codex 0.144.6 requires (`shell_type`,
`priority`, `base_instructions`, `truncation_policy`, context windows).
- **Claude effort**: always pass `--effort medium` and set
`CLAUDE_CODE_EFFORT_LEVEL=medium` (the env var wins inside Claude Code),
overridable with `AGENTIC_CLAUDE_EFFORT`. `--yolo` stays strictly opt-in
and only adds the harness's native bypass flag.
- **Validate `--upstream` at parse time** as an `http(s)://` URL with a
host. A typo such as `http//127.0.0.1:8000` previously started the
gateway and surfaced only as 502s on every request.
- **Discover the model when `--model` is omitted with `--upstream`**
from `GET {upstream}/v1/models`, instead of sending the `agentic-api`
placeholder that vLLM rejects.
- Clamp Anthropic `output_config.effort` `high`/`max` → `xhigh` on
`/v1/messages` for Qwen templates.
- Print the resolved gateway URL and model on launch.
- Add `docs/guides/harness-cli-testing.md`: a shareable checklist
covering validate → smoke test → tool-call round trip → interactive
session → direct #190 curl repro → Kubernetes verification (Claude Code
and Codex over WebSocket) → troubleshooting. README and getting-started
updated to match.

Split out of #193; the Kubernetes base fixes are in #199.

Known follow-up (not in this PR): the CLI places the Codex session home
under the system temp dir, so Codex warns `Refusing to create helper
binaries under temporary dir "/tmp"` and skips its PATH aliases.
Sessions still work.

## Test Plan

- `cargo fmt --all -- --check`, `cargo clippy --all-targets -- -D
warnings`, `cargo test --workspace` (743 passed), `pre-commit run
--all-files`.
- New unit tests: malformed upstream rejection + trailing-slash
normalization, effort pinned without `--yolo`, model discovery against a
stub HTTP server, explicit `--model` precedence.
- Live, with a binary built from this branch against vLLM serving
`Qwen/Qwen3.8-27B-FP8`:
- `agentic run claude --upstream http//…` → rejected at parse with
`invalid upstream URL`.
- `agentic run claude --upstream http://127.0.0.1:8000` (no `--model`,
inherited `CLAUDE_CODE_EFFORT_LEVEL=high`) → discovered model, effort
pinned to medium, `-p` turn answered.
- `agentic run codex --upstream http://127.0.0.1:8000 --yolo -- exec …`
(no `--model`) → Codex loaded the generated config, ran a shell tool
call over WebSocket, listed the crates.
- Baseline on `main` (same commands, binary built from `origin/main`):
Codex fails to load `config.toml`; Claude Code returns the effort 500
above.
- Kubernetes (kind, kustomize base with PostgreSQL): Claude Code
tool-call turn and Codex `exec` + shell tool through the cluster
gateway.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Francisco Javier Arceo <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
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