Skip to content

fix(chat): restore upstream recovery and reconcile Codex sends - #18

Merged
christso merged 3 commits into
christso/mainfrom
fix/compact-send-recovery
Nov 6, 2026
Merged

christso merged 3 commits into
christso/mainfrom
fix/compact-send-recovery

Conversation

@christso

@christso christso commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Change

Restore upstream’s original saved-message bubble, “Not confirmed. Check the terminal before sending again.” wording, and Copy/Discard controls. PendingMessages.tsx, its stylesheet and component tests match upstream exactly. Remove the fork’s raised/compact recovery controls and browser transcript matcher.

A Codex Send now can reach the agent even when its immediate-interruption check times out. The backend now captures the bound rollout’s session, file identity, append boundary and server-side send time, then clears the saved warning when a unique new canonical native user record matches that send. It uses the existing consumed receipt, including browser/device-scoped recovery after reconnect, so confirmation creates no temporary duplicate bubble and sends no input. Later held messages stay held.

Queued and ordinary Chat sends, terminal input-line submissions, and Enter writes with lost replies reserve their possible echoes. Repeated or competing matches, session/file replacement, missing bindings, unsupported record formats and exhausted evidence keep the original warning. Failed reads, missing placement and transient null rollout results get at most three fresh probes. Native confirmation proves delivery, not immediate interruption. Codex exposes no Ovis submission ID, so identical input entered independently in the same native session after capture remains a documented attribution limit.

This keeps upstream Ovis’s recovery UI and extends its existing Pi native-receipt pattern. It follows Claude Code’s explicit queued-input controls without adding another recovery interaction.

Related: #16, #17.

Validation

  • bun run check fast: passed: 10,644 tests, zero failures, 41 repository skips; typecheck, build, workflow and generated-file checks passed.
  • bun run check run bun test server/pending-input.contract.test.ts: 123 passed on the final product source, including real watcher reconciliation, relayed native confirmation, device/browser isolation, reconnect, interruption guards and no input replay.
  • bun scripts/terminal-autoswitch-demo-regression.ts: passed desktop/phone, light/dark and terminal-return cases.
  • bun scripts/sent-waiting-browser-qa.ts: both desktop/phone cases passed.
  • Independent correctness, adversarial, standards, testing, maintainability, reliability and API-contract review completed. Three findings were repaired and independently closed; 46 isolated regression tests passed, including the real placement resolver’s swallowed-error path and existing shell-replacement guards.
  • The final test-fixture adjustment stubs native-store discovery and drains its receipt-observation jobs; all 24 guard assertions remain unchanged and pass.
  • Browser follow-up: the full ui-regression.ts and composer-fit-demo-regression.ts scripts passed in an isolated check run; bun run check run bun scripts/pending-pane-switch-regression.ts also passed. Four exact selectors now use upstream’s “Discard saved copy” label; independent review found no weakened assertions.
  • Hosted CI on final commit 07b134b4 passed all required checks: Fast checks, Integration and browser (both browser lanes and integration tests), and Native Windows install. Native macOS identity, Windows mirrored terminal, Rust PTY, live contract, SSH and bundle jobs also passed. Release was intentionally skipped.
  • Skipped locally: full integration/browser lanes, native Windows/macOS runs, the SSH fixture for machines-browser-qa.ts, and the authenticated live example. Direct auxiliary-script attempts lacked their parent fixtures and were not valid product checks. Tests used isolated herdr sessions or temporary/mock fixtures, never the user’s live pane.
  • Screenshots are not attached because the installed gh has no attachment-upload option; the demo runner generated local screenshots.

Compound Engineering

@christso christso changed the title fix(chat): keep send recovery compact and hide matching echoes fix(chat): restore upstream recovery and reconcile Codex sends Nov 6, 2026
@christso

christso commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Independent code review completed for commit 2f7a2dac and its final backend reconciliation and exact upstream recovery UI restoration. Correctness, adversarial, standards, testing, maintainability, reliability and API-contract reviewers ran locally; no external model review ran.

The review reproduced three findings, all fixed and independently closed:

  • P1, lost Enter reply: reserve the attempt before awaiting the key RPC; only an acknowledged Enter makes its pending ID eligible for automatic confirmation. A lost reply remains a competing reservation, so its delayed echo cannot clear a held follower.
  • P2, terminal-line attribution: reserve typed: true submissions as unbound competitors without extra identity reads or Chat receipts. Their echoes cannot clear an earlier uncertain Chat send.
  • P2, transient final-append reads: retry failed reads, unplaced native-home results and null rollout bindings with at most three fresh probes. A regression uses the real placement resolver, whose RPC failure becomes placed: false, and confirms recovery without another append or reconnect.

The existing final-process-read guard tests also caught a regression from receipt lookup. Revalidation now runs after every Codex lookup, even when no anchor is captured; Enter stays withheld when a shell replaces Codex. The guard fixture now stubs store discovery and drains receipt jobs before replacing its RPC spies.

Independent closure passed 46 isolated tests: nine reconciliation, 24 agent-only guards and 13 native-file matching tests. Final fast/integration results are recorded in the PR Validation section. No review finding remains unresolved. Native records still provide no Ovis submission ID; the documented independent-identical-input limitation remains, and known ambiguity retains the original warning.

@christso

christso commented Nov 6, 2026

Copy link
Copy Markdown
Owner Author

Merge review: CodeRabbit did not run on this fork PR. The independent code-review agent review recorded above stands in for it; all product findings were fixed and closed. A final read-only review of commit 07b134b4 found no issues: its four exact browser selectors match upstream’s “Discard saved copy” label and preserve all assertion scopes and outcomes.

Validation after the selector fix: bun run check fast passed (10,644 tests, 0 failures, 41 repository skips); bun run check run bun scripts/pending-pane-switch-regression.ts passed; the complete ui-regression.ts and composer-fit-demo-regression.ts scripts both exited 0 inside an isolated check run. The auxiliary machines/media scripts need parent fixtures; direct attempts were invalid setup checks, not product validations. Native Windows/macOS and the complete integration/browser lanes were not rerun locally. Required hosted checks on 07b134b4 are pending and must pass before merge.

@christso
christso merged commit 64923cf into christso/main Nov 6, 2026
20 of 21 checks passed
@christso
christso deleted the fix/compact-send-recovery branch November 6, 2026 23:51
devswha added a commit to devswha/ovis that referenced this pull request Nov 26, 2026
## Change

After Codex accepts a follow-up sent with **Send now**, Ovis can show
the message in Chat and leave the queued copy marked **Not confirmed**.

Clear the copy when Codex shows the newly accepted message above its
working status. If the terminal check times out, look for a completed
user item in the bound Codex transcript. Ovis clears the copy when one
new item matches one tracked send and the same Codex process still owns
the pane. If the evidence is missing or ambiguous, Ovis keeps the copy.
Confirming delivery sends no additional terminal input.

This adapts the fix from the MIT-licensed Ovis fork. [Terminal
check](christso#61) · [Receipt
tracking](christso#18) · [Completed user
events](christso#62)

Fixes #4465

## Validation

- Reproduced the duplicate with real Codex 0.171.0 on upstream `main` at
`e16802a2`. Codex recorded one user message, and Ovis kept one **Not
confirmed** copy. [Reproduction and
recordings](#4465)
- The contract regression checks that a late completed user item clears
the copy without sending any more input. Unit tests cover matching text
from another send, a process replacement during reconciliation, and a
send refused before input.
- `bun run typecheck` passed.
- All 130 tests in `server/pending-input.contract.test.ts` passed in an
isolated Herdr session.
- 145 tests passed across `server/codex-delivery.test.ts`,
`server/codex-steering.test.ts`,
`server/core/codex-reconciliation.test.ts` and
`server/pending-input.test.ts`.
- 98 tests passed across `server/core/pending.test.ts`,
`server/core/pending-agy-send-now.test.ts` and
`scripts/changelog-fold.test.ts`.
- 285 tests passed across `server/codex-live-rendered.test.ts` and
`server/codex-processes.test.ts`. All 25 tests in
`server/conventions.test.ts` also passed.
- Full integration, browser and native platform suites were skipped
locally.

---------

Co-authored-by: devswha <[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