Skip to content

fix(send): skip Claude-tuned post-send verify for codex tools (#1205)#1228

Open
AndreIntelas wants to merge 1 commit into
asheshgoplani:mainfrom
AndreIntelas:fix/codex-send-skip-verify-1205
Open

fix(send): skip Claude-tuned post-send verify for codex tools (#1205)#1228
AndreIntelas wants to merge 1 commit into
asheshgoplani:mainfrom
AndreIntelas:fix/codex-send-skip-verify-1205

Conversation

@AndreIntelas
Copy link
Copy Markdown
Contributor

@AndreIntelas AndreIntelas commented May 29, 2026

Fixes #1205.

Problem

agent-deck session send (and launch -m) to a tool=codex session always fails with send dropped silently: no evidence of delivery after N checks (issue #876) (exit 1). In the session-send path the Ctrl+C recovery then quits codex and kills the pane, so the session goes to error. As the issue reports, the message is actually delivered and codex responds — only the verification is wrong.

Root cause

The #876 delivery-evidence verifier is Claude-tuned: it waits for an "active" status transition plus composer / unsent-paste markers. Codex's TUI exposes neither, so a successful send false-negatives, and the Ctrl+C-then-resend recovery tears the session down.

Fix

Codex reliably consumes the atomic send-keys input and readiness is already gated before sending, so for codex tools skip the Claude-tuned post-send verify:

  • internal/session/instance.go sendMessageWhenReady (launch -m): return nil right after SendKeysAndEnter for codex (also avoids 50x stray Enter nudges).
  • cmd/agent-deck/session_cmd.go session-send + sendNoWait: pass skipVerify for codex.
  • cmd/agent-deck/launch_cmd.go --no-wait initial send: pass skipVerify for codex.

Gated via the existing session.IsCodexCompatible(tool).

Tests

cmd/agent-deck/issue1205_codex_send_test.go:

  • codex/skipVerify path -> single atomic send, no Ctrl+C, no Enter-nudge spam, no error (even when the status never goes active).
  • guard: the same codex-shaped waiting state without skipVerify drives the destructive Ctrl+C recovery the fix avoids.

gofmt / go vet clean; cmd/agent-deck + internal/session package tests green; builds on main.

Verified live

codex-cli 0.134.0 with agent-deck built from this change: session send --wait, launch -m, and --no-wait all succeed, the session stays alive, and codex receives + processes the message.

Summary by CodeRabbit

  • Tests

    • Added tests validating send-and-retry and recovery behavior for Codex-shaped sessions, covering both verification and skip-verify scenarios.
  • Bug Fixes

    • Send flow now skips unnecessary post-send verification and retry for Codex-compatible tools, improving initial message delivery reliability.
  • Behavior

    • The skip-verify option is now derived from tool compatibility for no-wait sends.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dd804c2d-d329-4291-98ac-e7b5e103ea42

📥 Commits

Reviewing files that changed from the base of the PR and between f6bc0f5 and d9aaf5a.

📒 Files selected for processing (4)
  • cmd/agent-deck/issue1205_codex_send_test.go
  • cmd/agent-deck/launch_cmd.go
  • cmd/agent-deck/session_cmd.go
  • internal/session/instance.go

📝 Walkthrough

Walkthrough

Returns immediately after SendKeysAndEnter for Codex-compatible sessions (skipping post-send verification), propagates IsCodexCompatible to sendWithRetryTarget/sendWithRetry call sites, and adds tests that validate skip-verify and non-skip recovery behaviors.

Changes

Codex Tool Delivery Verification Fix

Layer / File(s) Summary
Codex skip-verify implementation
internal/session/instance.go
sendMessageWhenReady returns early after successful SendKeysAndEnter for Codex-compatible tools, bypassing the post-send verification loop that otherwise waits for "active" state and composer/unsent-paste markers.
Codex compatibility propagation
cmd/agent-deck/launch_cmd.go, cmd/agent-deck/session_cmd.go
handleLaunch and sendNoWait now pass session.IsCodexCompatible(tool) to sendWithRetryTarget/sendWithRetry instead of hardcoded false, making retry behavior tool-aware.
Codex send verification tests
cmd/agent-deck/issue1205_codex_send_test.go
Adds codexShapedTarget() mock and three tests: skip-verify asserts a single atomic SendKeysAndEnter with no Ctrl+C or Enter-nudge calls; non-skip asserts Ctrl+C recovery is triggered; one test documents RemoteSession not applicable and is skipped.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits format with 'fix:' prefix, clearly summarizes the main change (skipping post-send verification for codex tools), and includes the issue number (#1205).
Linked Issues check ✅ Passed All coding objectives from #1205 are met: skipped Claude-tuned verification for Codex via IsCodexCompatible() gating, avoided destructive Ctrl+C recovery, prevented repeated Enter nudges, and ensured reliable send/launch for tool=codex.
Out of Scope Changes check ✅ Passed All changes directly address #1205's root cause. The code modifications (sendMessageWhenReady early return, skipVerify parameter passing, IsCodexCompatible checks) and comprehensive tests are scoped to fixing codex send verification without introducing unrelated changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 70.00%.
Remote_parity ✅ Passed PR properly handles RemoteSession with explicit t.Skip documenting why N/A: sendWithRetryTarget affects only local tmux paths; remote sessions use RemoteKeySender without post-send verify.
Test_coverage_per_surface ✅ Passed This is a bug fix, not a new feature. Tests cover affected surfaces (CLI/TUI). Test file documents why RemoteSession testing is not applicable to this local/CLI send path.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@AndreIntelas AndreIntelas force-pushed the fix/codex-send-skip-verify-1205 branch from 8fb80cb to fe046c9 Compare May 29, 2026 15:51
…goplani#1205)

agent-deck's asheshgoplani#876 delivery-evidence verify is Claude-tuned: it waits for an
"active" status transition plus composer/unsent-paste markers. Codex's TUI
exposes neither, so every send to a codex session false-negatives as
"send dropped silently" (exit 1). In the session-send path the Ctrl+C
recovery then quits codex and kills the pane, flipping the session to error.

Codex reliably consumes the send-keys input and readiness is already gated
before sending, so for codex tools skip the post-send verify:

- instance.go sendMessageWhenReady (launch -m): return nil right after
  SendKeysAndEnter for codex (also avoids 50x stray Enter nudges).
- session_cmd.go session-send + sendNoWait: pass skipVerify for codex.
- launch_cmd.go --no-wait initial send: pass skipVerify for codex.

Tests (issue1205_codex_send_test.go): the codex/skipVerify path issues a
single atomic send with no Ctrl+C and no Enter-nudge spam; the same
codex-shaped waiting state WITHOUT skipVerify drives the destructive Ctrl+C
recovery the fix avoids.

Fixes asheshgoplani#1205.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AndreIntelas AndreIntelas force-pushed the fix/codex-send-skip-verify-1205 branch from fe046c9 to d9aaf5a Compare May 29, 2026 16:11
@AndreIntelas
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

✅ Actions performed

Full review triggered.

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.

[BUG] session send fails with tool=codex — "no composer/unsent-paste marker" despite message being delivered

1 participant