Repository navigation
fix(sidebar): accept final answers after skipped finishes - #1802
Conversation
Bind the final answer in front to the current finish instead of storing a lower baseline that cannot advance while the agent rests. Preserve stale ID, prior answer, and cached response guards, and cover skipped finishes and saved finishes without answer proofs. Fixes #1693
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Accept later finish evidence src/lib/panePresentation.ts, src/lib/panePresentation.test.ts, changelog.d/done-dot-skipped-finish.md |
The acceptance logic no longer rejects later finish IDs through the removed branches. Tests cover skipped IDs, answer comparisons, and saved finish evidence. The changelog describes the DONE-dot behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Merge Risk: 
Low · up to 8f41c
-
In a timing-dependent skipped-finish case, the DONE dot can clear before the latest answer arrives and stay cleared. This is a bounded risk rather than a merge blocker.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description explains the problem, resulting behavior, design trade-off, linked issue, and validation results. It uses Summary and Verification headings instead of the template's Change and Validation headings, but it provides the required information.
Full details: Linked Issues check
-
Explanation
Issue
#1693requires the web UI to accept a newer finish after multiple unseen finishes.ConversationFinishEvidence.acceptnow binds the current final answer to the current finish without the skipped-ID and missing-answer baseline refusals. The tests cover finish 10 after finish 4, finish IDs 5 and 10 after an answer-less saved finish, stale IDs, and repeated answers. The focused-pane server limitation is explicitly outside this client change and does not block the requested browser path.
Full details: Out of Scope Changes check
-
Explanation
The source change directly implements
#1693. The test changes verify the new acceptance behavior and retained rejection guards. The changelog entry documents the same fix. No unrelated change is shown.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- 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.
Comment @coderabbitai help to get the list of available commands.
|
Merge pass: a gate reviewer on a different model than the author's approved this, with high confidence for the scoped fix. Checks: 73 tests across Trade-off accepted. The reviewer confirmed it is real:
The PR accepts this deliberately: a dot that may clear a little early is better than one that never clears. Cached-response guards still hold, and Terminal's separate presentation gate is unchanged. Not run: browser QA. The persistence probe drove the real sidebar hook with simulated Chat presentation. All required checks are green and no review thread is open. |
…in (#2136) ## 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.
Fixes #1693. Picks up
78093f11efrom the local branchfix/done-dot-skipped-finish(never pushed, no PR) unchanged, on a branch from the latest main. Authorship is kept.Summary
src/lib/panePresentation.tsConversationFinishEvidence.accept: two branches refused a finish when finishes had been skipped while no browser showed the pane (id > known.id + 1), or when the saved previous finish carried no answer (read in Terminal). Instead they stored a baseline and waited for a different answer, which an agent at rest never writes, so the DONE dot stayed for good. Both branches are gone: the final answer in front of the reader is bound to the current finish. These guards stay:conversation === before).src/lib/panePresentation.test.ts:skipped-scopecase now expects the skipped finish to be accepted, so a later, different answer for the same finish is refused.changelog.d/done-dot-skipped-finish.md.One trade-off is kept: a fresh read whose transcript lags behind herdr can bind an earlier final answer to the newest finish. This is the assumption the existing next-id path (
id === known.id + 1) already makes. Here it replaces a dot that could never clear.The pane that is also herdr's focused pane (the issue's server-side
CompletionTracker.seen()note) is not changed here. Its dot clears through this client path once a browser shows the pane.Design precedent
This follows T3 Code. A thread there shows an unseen completion while its latest run completed after the last visit (
hasUnseenCompletionin Sidebar.logic.ts#L716-L725). Opening the thread moves its visit watermark up to the thread's latest update (ThreadVisitWatermark.tsx#L29-L68), so one visit clears every run that finished while away, however many there were. Ovis has no visit timestamp to compare herdr's finish ids with, so it keeps its own proof: the reader has the transcript's newest final answer in front. That proof now covers every finish up to the current one.Verification
src/lib/panePresentation.tsback at main, four tests fail: the two new cases (three runs) and the flippedskipped-scopeexpectation. They pass with this change.src/lib/panePresentation.test.ts,src/lib/sidebarActivity.hook.test.ts,src/lib/seenFinishes.test.ts: 73/73.bun run check fast.