Skip to content

fix(sidebar): keep proving a Codex finish its task_complete dated again - #2136

Merged
devswha merged 2 commits into
mainfrom
fix/sidebar-done-dot-accuracy
Oct 28, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/sidebar-done-dot-accuracy

Conversation

@devswha

@devswha devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Change

Part of #1430 (DONE dot accuracy follow-ups from #1342): fixes item 4, and maps every other item to where main already stands.

Codex dates the last assistant turn again when its task_complete lands (server/codex.ts sets end_ts), and the answer fingerprint the DONE dot is proved with includes that time. If the chat read finish N once before the pane counted as presented (scrolled away from the end, covered by a sheet, a retained hidden renderer) and task_complete then moved end_ts, every later read of the same finish compared the whole fingerprint and was refused. The dot stayed until the next finish.

  • src/lib/panePresentation.ts ConversationFinishEvidence.accept: for the same finish id, an answer whose proof identity (source, history, turn start and final text) equals the known answer still proves the finish when only its completion time moved, provided the turn has a native start time. The next-finish comparison already ignored the time this way. Without a start time (ts: null, e.g. OpenCode without time.created) two replies with the same text are indistinguishable, so only an exact match counts there, as before. A different answer for the same finish is still refused.
  • src/lib/panePresentation.test.ts: a Codex answer accepted at end_ts 00:00:05 and read again at 00:00:06 is still accepted for finish 3, and another answer is not; with ts: null, an older reply with the same text is not taken for the current finish.
  • changelog.d/done-dot-codex-late-completion.md.

Where the rest of #1430 stands on main

Item State
1. Recovery joiner acknowledges the previous answer Fixed by #1472 (output-recovering frame)
2. A fresh response carrying the previous answer clears a newer finish with no baseline Not changed: this is the trade-off #1802 kept ("a fresh read whose transcript lags behind herdr can bind an earlier final answer to the newest finish"). While the agent works, a final answer on screen can be the previous turn's or this turn's, written just before herdr reports done. Refusing it would bring back a dot that never clears.
3. Dot never clears after skipped finishes / a Terminal read Fixed by #1802 (#1693)
4. Codex completion metadata invalidates the proof Fixed here
5. Agents without native completion evidence keep DONE in Chat Documented, conservative; unchanged
Stale readiness comment, demo fakes the old order Fixed by #1472
Page-wide mutation observer Gone: the observer now watches only the chat scroller (ChatView.tsx)

Still open from the smaller notes (filed as a follow-up, not changed here): Finishes.status() stats the herdr socket on every status frame; clientSnapshot() reads again without a bound when the epoch changes mid-read; the phone's masked password field hides during recovery; no browser regression for the masked-prompt detection during recovery.

Verification

  • bun test src/lib/panePresentation.test.ts: the new case fails with only panePresentation.ts at main ("Expected: true, Received: false" on the second read) and passes with the change.
  • src/lib/panePresentation.test.ts, src/lib/sidebarActivity.hook.test.ts, src/lib/seenFinishes.test.ts: 74 pass, 0 fail.
  • The ts: null case fails on the first commit's implementation (21 pass, 1 fail) and passes on the second.
  • src/lib/panePresentation.test.ts, src/lib/sidebarActivity.hook.test.ts, src/lib/seenFinishes.test.ts at the head: 75 pass, 0 fail.
  • dori heavy … bun run check run --build bun scripts/sidebar-activity-demo-regression.ts: 44 PASS, exit 0.
  • bun run check fast: workflow syntax, generated files, typecheck, build ok; unit tests 7,874 pass, 0 fail at the head (bbe4100).

Reviews

  • omo-native-code-reviewer: APPROVE, no CRITICAL/HIGH/MEDIUM. Its LOW-1 (ts: null) is fixed in the second commit; LOW-2 (the remembered answer keeps the pre-task_complete fingerprint) was checked to leave the next finish correct; LOW-3 is style.
  • Codex Sol 6.1 Fast xhigh: BLOCK on the first commit with one MEDIUM (the same ts: null case, reproduced); PASS on the second commit.

Part of #1430 (accuracy follow-ups from #1342): item 4.

Codex dates the last assistant turn again when its task_complete lands
(server/codex.ts sets end_ts), and the answer fingerprint the DONE dot is
proved with includes that time. When the chat read finish N once before
the pane counted as presented (scrolled away, covered, a retained hidden
renderer) and task_complete then moved end_ts, every later read of the
same finish compared the whole fingerprint and was refused, so the dot
stayed until the next finish.

`ConversationFinishEvidence.accept` now treats the same finish's answer
as unchanged when only its completion time moved (same source, history,
turn start and final text), as the next-finish comparison already did.
A different answer for the same finish is still refused.
…art time

Review of the previous commit (Codex MEDIUM, omo LOW): a turn with no
start time (ts: null, as OpenCode writes when time.created is missing)
fingerprints as source, history and text alone, so an older reply with
the same text ("Done") could prove the current finish. The same-finish
relaxation now needs the final answer's native start time; otherwise
only an exact fingerprint match proves it, as before.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between c5d9555 and bbe4100.

Files selected for processing: 3
  • changelog.d/done-dot-codex-late-completion.md
  • src/lib/panePresentation.test.ts
  • src/lib/panePresentation.ts
  • 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.

❤️ Share

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

@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Merging bbe4100: omo-native-code-reviewer and Codex both pass this head (LOW notes only), and the required checks are green. Fast checks first failed on a timing assertion in server/codex.test.ts, a file this PR doesn't touch, and passed on rerun. CodeRabbit did not review this head. The LOW notes go to a follow-up issue.

@devswha
devswha merged commit db83dea into main Oct 28, 2026
19 of 20 checks passed
@devswha
devswha deleted the fix/sidebar-done-dot-accuracy branch October 28, 2026 02:51
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