You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(chat): clear confirmed Codex Send now copies - #4478
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.
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
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.
Recognize when Codex accepts a follow-up directly. If the terminal check
cannot confirm it, clear the exact pending row once the bound Codex
transcript records a matching completed user item.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
Codex queued messages are now cleared when Codex accepts them into its active turn, including when confirmation arrives after a terminal check times out.
Send now submissions can be confirmed from Codex’s completed messages, helping prevent duplicate sends when confirmations are delayed or a connection is restored.
Bug Fixes
Codex steering avoids sending an unnecessary interruption when the submitted message is already accepted.
Ambiguous or unconfirmed messages remain queued rather than being treated as delivered.
Codex send confirmation now checks accepted screen rows and completed transcript events. Confirmed pending sends receive a consumed outcome, which can be replayed when a client reconnects.
Changes: Codex send confirmation
Layer / File(s)
Summary
Recognize accepted messages in the Codex screen server/codex-steering.ts, server/codex-steering.test.ts
Codex steering recognizes background-terminal status and detects a newly accepted user row before a pending panel appears. Tests cover matching, draft, repeated, and ambiguous messages.
Capture and match transcript receipts server/codex-delivery.ts, server/codex-delivery.test.ts
Transcript anchors require stable, complete session data. The tracker matches new completed user events to eligible sends and rejects ambiguous or stale evidence.
Pending delivery reconciles receipts against process identity and updates confirmed uncertain items to consumed. Transcript changes trigger reconciliation, and matching consumed receipts can be replayed after reconnect.
This change clears a queued Send now copy once Codex is confirmed to have accepted the message, and keeps the copy when evidence is missing or ambiguous. No concrete merge-blocking defect was established in the reviewed code. One theoretical screen-reflow edge case depends on external terminal behavior that was not verified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(chat): clear confirmed Codex Send now copies" matches the main change: the PR clears the queued Send now copy after Codex accepts the message, using transcript and terminal evidence. It…
Description check
The description follows the template with a Change section that describes the problem, the resulting behavior, and the linked issue (#4465). It also has a Validation section listing typecheck, test fi…
Linked Issues check
[#4465] requires clearing the queued Send now copy once Codex accepts the send, without sending input again, and keeping the copy when delivery is ambiguous. The whole-PR summary (merge base 440c869 t…
Out of Scope Changes check
All changed files connect to the #4465 objective: - server/codex-delivery.ts and server/codex-delivery.test.ts: transcript anchoring and receipt reconciliation. - server/codex-steering.ts and `s…
Full details: Title check
Explanation
The title "fix(chat): clear confirmed Codex Send now copies" matches the main change: the PR clears the queued Send now copy after Codex accepts the message, using transcript and terminal evidence. It is concise, specific, and follows a conventional prefix.
Full details: Description check
Explanation
The description follows the template with a Change section that describes the problem, the resulting behavior, and the linked issue (#4465). It also has a Validation section listing typecheck, test files with results, and skipped suites. The Change section adapts the fix from an upstream fork and cites reproduction steps. The template's contract-test coverage requirement for HTTP/WS changes is not clearly addressed, since the description cites a contract test file but does not state whether HTTP/WS contract coverage applies. It also does not mention the changelog entry in changelog.d/ explicitly, although the diff includes it.
Full details: Linked Issues check
Explanation
[#4465] requires clearing the queued Send now copy once Codex accepts the send, without sending input again, and keeping the copy when delivery is ambiguous. The whole-PR summary (merge base 440c869 to head 70baa58) shows the required behavior:
Terminal check: interruptCodexSteering in server/codex-steering.ts counts complete matching user rows before submission. During polling it returns without a keypress when exactly one additional accepted row appears above a working status. Background-terminal status is covered.
Transcript fallback: CodexDeliveries in server/codex-delivery.ts captures a transcript anchor and reconciles completed native user-message events. It requires a timestamp and normalized-text match and one-to-one candidate uniqueness, and it consumes each event once. A supplied process verifier must pass before matches settle.
Ambiguity: missing, ambiguous, or mismatched evidence leaves the record in place. Tests cover matches from other sends, process replacement, and refused sends.
Wiring: server/core/pending.ts and server/core/server-core.ts run Codex reconciliation after transcript changes. server/pending-input.ts adds confirmRecorded and the consumed outcome.
Tests: server/pending-input.contract.test.ts and the Codex delivery, steering, and reconciliation tests cover the late item_completed user message case.
The conclusion relies on the summary. I did not read the source hunks directly. No unmet coding requirement is evident.
Full details: Out of Scope Changes check
Explanation
All changed files connect to the #4465 objective:
server/codex-delivery.ts and server/codex-delivery.test.ts: transcript anchoring and receipt reconciliation.
server/codex-steering.ts and server/codex-steering.test.ts: terminal check and background-terminal status matching.
server/core/pending.ts, server/core/server-core.ts, server/pending-input.ts: wiring of Codex reconciliation and the consumed outcome, which the confirmed copy requires.
server/core/codex-reconciliation.test.ts, server/pending-input.contract.test.ts: tests for the objective.
changelog.d/codex-completed-user-receipts.md: documents the behavior change.
No demonstrated unrelated change was found. The conclusion relies on the whole-PR summary, not on direct inspection of each hunk.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 440c869 and 70baa58.
Files selected for processing: 10
changelog.d/codex-completed-user-receipts.md
server/codex-delivery.test.ts
server/codex-delivery.ts
server/codex-steering.test.ts
server/codex-steering.ts
server/core/codex-reconciliation.test.ts
server/core/pending.ts
server/core/server-core.ts
server/pending-input.contract.test.ts
server/pending-input.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Merged through pr-merge at head aafb0052f. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.
main had moved since the checks of c804251ee: pr-merge --update merged it in (03d50dd2c), and every required check was green at this head.
External fix PR touching queued input; reviews: omo gate (2 HIGHs: the restart double-send introduced here was fixed in b50d9b2 with a persisted, capped receipt store; the terminal-fallback clear is pre-existing on main, reproduced there, filed as #4769) + Codex adversarial (HIGH text-match misattribution fixed in 4c5e955, 4 MEDIUMs fixed in 22ced30); a Chat copy is cleared only on Codex's own turn/steer reply or a transcript item with that send's clientUserMessageId (checked on Codex 0.171.0); repro: codex-steering test fails on main 741a7f1, passes on head; CodeRabbit skipped this head; merged on the lane brief ext-fix-prs-1126.
We reproduced it first: on main the steering test "confirms a message Codex put in the active turn" fails with "Immediate delivery was not confirmed", and on your branch it passes.
Because this touches queued input, where nothing typed may be lost or sent twice, the reviews were strict. The maintainer commits on top of yours:
4c5e955: a Chat copy is cleared only when Codex acknowledges that exact send, either through the reply to its own turn/steer request or through a completed transcript item carrying that send's clientUserMessageId. We checked this against Codex 0.171.0. An earlier terminal submission with the same text no longer counts.
22ced30: fixes stale thread selection, an unsent request being counted as written, queue reordering when a subagent is loaded, and an older steering-panel entry being credited to Chat.
b50d9b2: after a restart, a consumed id is never written again. Receipts are stored before consumed is published, capped at 4,096. When the store is full or cannot be written, the warning stays.
One older behaviour on main that this PR does not change is now tracked in #4769: the terminal fallback clears a row without a send-specific receipt.
Release 0.5.10, prepared only. **Waiting for the maintainer's go**:
nothing here is merged, tagged, deployed or submitted to a store by this
PR's session. Relay PR #4779 is merged and the A15 recheck passed on
`main` 12b8d90, so this PR is now ready for review; it is on `main`
84469d3. #4790's fragment, merged after the fold, was moved into
0.5.10 by hand.
- `package.json` and `herdr-plugin.toml`: 0.5.9 -> 0.5.10.
- `REMOTE_BUNDLE_VERSION` 53 -> 54 (`shared/machines.ts`): the release
guard says the bundle's inputs changed since `remote-v53` (the files
under `server/`, `shared/`, `patches/`, `scripts/` and others). After
this merges, `remote-v54` is tagged on the merge commit and the **Remote
PC bundles** run publishes it before the Release run. Until the Release
run is done, nothing touching `server/`, `shared/`, `bun.lock` or
`patches/` merges.
- `CHANGELOG.md`: `bun scripts/changelog-fold.ts 0.5.10` folded 258
fragments (186 PRs) under 0.5.10, dated 2026-11-26, with their PR links.
`by @login` credits added to the 31 links of PRs from outside
contributors (one, #4176, already had it).
- `release-summaries.json`: 0.5.10 in en, ko, ja and zh: 5 new, 5
improved, 5 fixed, each English line at most 70 characters. Left out on
purpose (they stay in the changelog): everything behind the account's
signed list (its switches stay off at the account service), and the
phone apps' carried shell and iPhone SSH, which reach people only with
the next store builds.
- Android 1.0.7 (15) bump included (`app/android/app/build.gradle`,
`app/store/android.md`; commit cherry-picked from
`chore/android-1.0.7`): the store build is made from the v0.5.10 tag, so
it must be on `main` before the tag.
- `telemetry/deployed.json` unchanged: `shared/telemetry.ts` changed
since v0.5.9, but main already records that Worker deploy, and the
release guards agree.
## Release checklist (maintainer's go needed for every step)
1. [ ] **Account service first** (ovis-sh/account): production runs
migrations up to **0039** and the Worker at **26eabfd**. Apply the
migrations, then deploy the Worker right after (the account README's
order; migrations only go forward). Confirm which migration production
is on before the release: the pre-release survey could not read it.
2. [ ] **Relay**: `relay/` changed since v0.5.9 only in
`relay/bun.test.ts` (#4557), so no relay deploy is needed for that
range. #4779 and the commits since did not touch `relay/` either, apart
from `relay/worker.test.ts` (#4787). If `relay/` changes before the tag,
deploy relay.ovis.sh and relay-ap from the **same commit** before it.
3. [ ] **#4553** (privacy policy: direct connections are off by default)
merges together with this release: the default changed in #4543 and the
site deploys on merge.
4. [ ] `MIN_SUPPORTED_CLIENT_VERSION` stays **0.4.20**
(`server/relay/client-floor.ts`): raising it would stop the live phone
apps (iOS 1.0.2 (11), Android 1.0.5 (13)) at "Update the app".
5. [ ] The account's list switches stay **off** (`OVIS_LIST_ACCOUNTS =
""`, `OVIS_LIST_MIGRATE_ACCOUNTS = ""`, `PC_LIST_PROOF = "off"`): a list
pin cannot be undone; turn them on separately once the new store builds
are installed.
6. [ ] Right before merging, rebase onto `main` and move by hand any
`changelog.d/` fragment merged after the fold (the Release run refuses
while one is left; #4788 merged after the last sync). Merge this PR
after CI passes, push `remote-v54` on the merge commit, wait for
**Remote PC bundles** to publish it, then run **Release** with `0.5.10`.
7. [ ] **Android: a new store build on release day.** On the live
Android app (1.0.5 / 1.0.6 native), Back on More -> Connect a PC
(`/#add`) closes the app (the on-screen back arrow works; reopening
returns to the PC). The page cannot fix it safely; main's native code
already does (#4435). Android 1.0.7 (15) bump included in this PR;
upload that build from the v0.5.10 tag the same day (steps:
`~/.dori-sa/reports/android-store-build-0510/STEPS.ko.md` on the
maintainer's PC).
8. [ ] **iOS next build**: it moves the shell to
`capacitor://app.ovis.sh`, so people who update sign in once more and
re-pair PCs that are not in an account. Write that line into the update
notes before it ships.
Evidence for the checklist: the pre-release blocker survey and the
old-native QA of the 0.5.10 shell on the live store apps (iOS 1.0.2
(11), Android 1.0.5 (13) and 1.0.6 (14)): every flow passed except the
Android Back in step 7; signed-in account flows were not exercised
there.
## Contract diff v0.5.9..main (old phone apps, mixed versions)
**Not purely additive.** No HTTP route or method, WebSocket message
`type`, or relay frame was removed or renamed, and `WIRE_VERSION` "1",
`RELAY_PROTOCOL` 1, `BRIDGE_PROTOCOL` 1, the minimum server version
0.4.21 and the client floor 0.4.20 are unchanged. The live iOS 1.0.2 /
Android 1.0.5 apps load the hosted shell, so they pin no old parser; the
old-native QA above passed on it. What changed meaning, all in adding
one account PC to another (#4435) or behind the signed list:
| Change | v0.5.9 -> main | Mixed versions |
| --- | --- | --- |
| `POST /api/machines/relay/account/pair` NDJSON progress `{digits}` ->
`{waiting:true}` | `server/machine-api.ts`, `src/lib/api.ts`
`pairAccountPc` | A 0.5.10 shell (app.ovis.sh) on a 0.5.9 PC, or the
reverse, ignores the other's progress line, so the approval hint does
not show; the final `machine`/`error` lines still arrive. |
| Relay `pair-intent-vouched` needs `pair-pc-proof` |
`server/relay/session.ts`, `server/relay-pc.ts` | Adding a PC between a
0.5.9 and a 0.5.10 PC fails (the old one is told it is outdated).
Existing pairings reconnect as before. |
| Vouched approval: `RemotePairingRequest.choices` [] and
`proven_server_id` + `pc_label` instead of six digits |
`shared/machines.ts`, `server/relay/pairing-approvals.ts`,
`server/relay/routes.ts` | An old approver cannot approve a new vouched
request. Ordinary digit comparisons keep their shape. |
| A PC pinned to a signed list refuses legacy joins and signed
`link`/`add`; one-press admission needs `listing_id` |
`server/relay/session.ts`, `server/account/*` | Only with the list
switches on, which stay off for this release. |
| Direct connections default off when no choice is saved (#4543) |
`server/relay/service.ts` | Relay keeps working; a saved choice is kept.
Hence #4553 with this release. |
| `POST /api/relay/reset-identity` validates its body, adds an optional
`removed` guard | `server/relay/routes.ts` | An old shell's empty body
still works. |
The commits after the first audit (03d50dd..84469d3: #4779, #4784,
#4478, #4787, #4790) only add, or change no wire shape: `list_held` on a
non-list PC's own joins, a `held_here` join refusal for a key a block
keeps out, and a `consumed` outcome for a settled pending input.
Verified by reading both refs (`git diff v0.5.9 origin/main -- shared/
server/ relay/`, `git show` of each file at both refs); the first row
was checked line by line. No skew test was run. **For the maintainer's
go:** the first three rows mean PC-to-PC adds need both PCs on 0.5.10;
nothing else an old phone app or an existing pairing uses was removed.
## Validation
- `bun run check fast` on this PC at 8f4a344 (main 84469d3 + this
PR's three commits): every step ok (unit: 28779 pass, 0 fail, 259 skip).
Before that at f914315 (main 12b8d90 + the release commit): every
step ok (unit: 28770 pass, 0 fail, 259 skip; typecheck, build, generated
types and themes, workflow syntax). Earlier also at 0caf043 on main
03d50dd: 28720 pass, 0 fail.
- CodeRabbit's three findings on 8f4a344 fixed in d96ac26
(superseded delegated-helper and plain `ovis` lines made to say the
final behavior; the Memory summary no longer says agents use the notes);
`bun run check fast` there: every step ok (unit: 28779 pass, 0 fail). CI
on 8f4a344: success. CI on d96ac26: success after one rerun of
Browser regression 3/3, where `scripts/application-paging-regression.ts`
failed once and passed on the retry (a flake not quarantined; the PR
changes no code it runs). CodeRabbit reviewed d96ac26 with nothing
new.
- After the Android cherry-pick: `bun test
scripts/app-bundled-shell.test.ts scripts/app-shell.test.ts
scripts/ci-browser-reach.test.ts` (the tests that read the Android
version files): 120 pass, 0 fail.
- `bun test scripts/changelog-fold.test.ts scripts/release-notes.test.ts
server/release-notes.test.ts scripts/release-guards.test.ts`: 60 pass, 0
fail.
- `bun scripts/release-guards.ts --base origin/main`: "Release 0.5.10:
remote bundle, telemetry Worker and release metadata are in order."
(before the bump it asked for 53 -> 54).
- `bun scripts/release-notes.ts 0.5.10` renders the notes (New features
5, Improvements 5, Bug fixes 5).
- Not run: `check full` (versions, notes and one constant); a
mixed-version runtime test of the contract rows above.
- Release day (lane release-0510-go, on the maintainer's go): merged
`main` 3fbdb17 and moved by hand the three fragments merged after the
fold (#4788 under Changed, #4791 and #4794 under Fixed; #4787 and #4795
are test-only and had none). `bun run check fast` at 0bbca5b: every
step ok (unit: 28807 pass, 0 fail, 259 skip). `bun
scripts/release-guards.ts --base origin/main`: in order. The
release-notes and guard tests: 60 pass, 0 fail. The account service is
already on migrations 0039 and Worker 26eabfd in production, with the
list switches off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 · Receipt tracking · Completed user events
Fixes #4465
Validation
mainate16802a2. Codex recorded one user message, and Ovis kept one Not confirmed copy. Reproduction and recordingsbun run typecheckpassed.server/pending-input.contract.test.tspassed in an isolated Herdr session.server/codex-delivery.test.ts,server/codex-steering.test.ts,server/core/codex-reconciliation.test.tsandserver/pending-input.test.ts.server/core/pending.test.ts,server/core/pending-agy-send-now.test.tsandscripts/changelog-fold.test.ts.server/codex-live-rendered.test.tsandserver/codex-processes.test.ts. All 25 tests inserver/conventions.test.tsalso passed.