Skip to content

acp: optionally name new codex sessions so the adapter skips its title thread - #133

Merged
shoedog merged 3 commits into
mainfrom
fix/codex-title-suppress-20261013
Oct 14, 2026
Merged

shoedog merged 3 commits into
mainfrom
fix/codex-title-suppress-20261013

Conversation

@shoedog

@shoedog shoedog commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Problem

After a new session's first turn, the codex-acp adapter starts an ephemeral title-generation thread and never unsubscribes it (upstream issue agentclientprotocol/codex-acp#628, fix PR agentclientprotocol/codex-acp#629, both open). The bridge has no id for that thread, so session/close (#131) cannot reach it. Its codex-config-level MCP servers (for example prism-mcp, node_repl) live until the adapter exits, and each session costs one extra gpt-5.6-luna turn. Measured on adapter 1.13.1 and 2.2.2.

Change

  • New per-agent opt-in rename_new_sessions (default false). Validation accepts true only when cmd has the file name codex-acp.
  • When it is on, the mint sends /rename <name> once, after mode/model/effort settle and before the session id is published. The adapter answers this locally with no model turn, and an explicitly named session skips title generation.
  • The rename is best effort: one attempt bounded at 5 s, after which the mint publishes the same session whatever happened. No retry, no cancel, nothing added to prompt_inner.
  • The catalog/model probe never renames.
  • rename_new_sessions joins the frozen provider-effect digest only when true, so existing persisted identities keep their digest.
  • No wire, journal, agent-card or persisted-enum change.
  • Docs: README.md, docs/onboarding.md, docs/compatibility.md (accepted limits R1–R5), CHANGELOG.md.

Accepted limits (documented)

R1 a wrapper with another file name cannot opt in; R2 tied to the tested adapter versions' /rename; R3 a never-prompted session is still renamed; R4 on timeout the adapter may still be handling the rename; R5 output from a rename that was not answered within the bound may reach the first turn.

Review

  • Three review rounds rejected the first commit over the unanswered-rename policy. The spec contradicted itself on that point.
  • The owner resolved it with a contract amendment: one bounded attempt, R5 accepted, flag in the digest only when true. The second commit implements the amendment.
  • One independent Sol/xhigh review of the combined diff then returned APPROVE.
  • Deferred, immaterial: if the connection is fenced while the rename is outstanding and the adapter then answers successfully, the trace event is acp.session_rename_acknowledged (debug) instead of acp.session_rename_interrupted (warn). Logging only; the published session and the close contract are unaffected.

Verification

  • Local verification was scoped to the touched crates, per this repo's standing rule: cargo fmt --all -- --check, clippy -D warnings, and cargo test for bridge-acp, bridge-core, bridge-container, bridge-registry, bridge-workflow and a2a-bridge. All passed on macOS with 0 failures.
  • The full workspace suite is this PR's CI.
  • New behaviour has fail-first tests: ordering, default off, rejection, timeout, a late answer, update suppression, naming, release during the exchange, fence outcomes, config validation and propagation, and the digest (legacy golden values plus both reload directions).
  • Not yet verified: a live adapter turn. One fixed PONG against the operator serve follows the merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ

a2a-implement and others added 3 commits October 13, 2026 19:27
…effect digest

Contract Amendment 1: the mint sends `/rename` once, waits at most the bound and
publishes the same session whatever the outcome. The unanswered-rename settlement
(cancel, hold-back of the first turn) is removed; late output after an unanswered
rename is a documented residual. `rename_new_sessions` is now part of the frozen
provider-effect digest, encoded only when true so existing identities stay valid.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ
A bare `cmd = "codex-acp"` on a host entry goes through the packaged wrapper,
which resolves the binary on PATH; CI runners have none. Use an absolute path
with the same file name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ
@shoedog

shoedog commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

CI failure on the first push: cli_tests::serving_configs_carry_the_entrys_rename_new_sessions passed a bare cmd = "codex-acp" to acp_spawn_inputs, which resolves the packaged wrapper's binary on PATH; the runner has no codex-acp (ConfigInvalid: codex-acp wrapper could not resolve "codex-acp" on PATH). Reproduced on macOS by removing it from PATH (same message), passes with it. Test-only fix: absolute cmd with the same file name. Re-verified locally: that test with PATH=/usr/bin:/bin, and the full a2a-bridge bin target (1120 passed), fmt, clippy.

@shoedog
shoedog merged commit 1db1b50 into main Oct 14, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 14, 2026
@shoedog
shoedog deleted the fix/codex-title-suppress-20261013 branch October 14, 2026 03:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant