Skip to content

fix(ui): keep completed work duration after later run updates - #181844

Merged
vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/worked-duration-20261023
Oct 23, 2026
Merged

vyctorbrzezowski merged 1 commit into
mainfrom
brzezowski/worked-duration-20261023

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

What Problem This Solves

A completed answer can show only “Worked” above its activity while still showing “Done in 13 seconds” below the answer after session metadata advances to another run.

User Impact

The existing Worked disclosure keeps the known duration for its own run. The footer keeps output tokens without repeating that duration; answers without a matching Worked disclosure retain their footer timing.

Why This Change Was Made

Reuse the terminal recap already associated with the answer's run when the session no longer carries that run's timing. This changes presentation only: no transcript rewriting, timestamp estimates, new state, or grouping changes. Production delta: +26 lines; tests add 73 lines for the lifecycle boundary, token display, and zero-runtime case.

Evidence

  • Reproduced in the compiled Control UI against synthetic Gateway events on main d90c4d0: the regression fails with “Worked”; the candidate preserves “Worked for 13 seconds”, keeps 42 output tokens, and survives reload.
  • Chat lifecycle browser suite: 16/16 passed, 44.16 seconds; the changed scenario took 1.816 seconds. After the final zero-runtime guard, the affected browser scenario passed again (19.91 seconds including setup). This exercises actual WebSocket delivery, session reconciliation, rendering, and reload. CI timing is pending.
  • Duration, message, and recap tests: 62/62 passed, 1.56 seconds, including unavailable metadata, independent runs, and session/agent/connection changes.
  • UI and chat E2E TypeScript checks, focused lint/format, and diff checks passed. Independent Codex review completed. The zero-runtime finding is fixed and protected by an 87 ms regression; no other P0–P2 findings.

Before (main, same synthetic scenario):

Before: Worked has no duration; the footer shows 42 output tokens and Done in 13 seconds

After (0303124):

After: Worked for 13 seconds; the footer retains 42 output tokens

Risk and coverage

Historical work without matching lifecycle facts remains untimed. Zero runtime keeps the existing footer duration because Worked cannot format it. Rollups without a safe run association retain their existing presentation and any legitimate footer timing. Handoff request-wide timing, multi-run grouping, final answers, and token/cost metadata are unchanged. No live provider or private conversation was accessed.

@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 23, 2026 19:04
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves a completed answer’s known duration in its Worked disclosure and removes duplicate footer timing while retaining output tokens.

Example: A 13-second answer with 42 output tokens remains visible after session metadata advances to another run.

  • Before: The disclosure says “Worked”; the footer says “42 output tokens · Done in 13 seconds.”
  • After: The disclosure says “Worked for 13 seconds”; the footer says “42 output tokens.”

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with directly inspected visual proof, meaningful lifecycle and zero-runtime regressions, green exact-head checks, and no open findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show the compiled Control UI consuming synthetic Gateway events: after metadata advances, the candidate displays Worked for 13 seconds and retains 42 output tokens without duplicate timing.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A completed answer’s work disclosure loses its known duration after session metadata advances to another run.
Reason: The maintainer-authored direction restores useful timing through existing owners without adding configuration, persistence, or grouping policy.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a current Control UI timing defect with a focused change, inspected before/after proof, and green exact-head CI; no actionable defects were found.

Priority: P2
Reviewed head: 0303124763d7005848dc6f1b54543e0deb623040

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI projects Gateway lifecycle and usage facts into run-owned transcript frames, which render work disclosures and answer footers.

flowchart TD
  A[Gateway lifecycle and usage] --> B[Session reconciliation]
  B --> C[Run recap owner]
  B --> D[Transcript grouping]
  C --> E[Run frame]
  D --> E
  E --> F[Worked disclosure]
  E --> G[Answer footer]
Loading

Technical review

Best possible solution:

Use the existing run-associated recap to fill missing work timing and hide footer timing only when the matching disclosure displays it.

Do we have a high-confidence way to reproduce the issue?

Current source shows work timing disappearing when session lastRunId advances while the watched recap remains available; the supplied compiled-UI before screenshot demonstrates that scenario.

Is this the best way to solve the issue?

The patch is a small, complete presentation repair using existing timing ownership, with matching-run checks and preserved handoff, ambiguous-history, and zero-runtime behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2f5cb8110d7a.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 53fbcbb adds ui/src/pages/chat/components/chat-working-indicator.tsx:234 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 53fbcbbb3055; files: ui/src/pages/chat/components/chat-working-indicator.tsx)

PR surface

Source +26, Tests +73. Total +99 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 48 22 +26
Tests 2 73 0 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 121 22 +99

Labels

Label changes:

  • add P2: Completed answers lose useful timing in their work disclosure after later session updates, with limited presentation-only impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Completed answers lose useful timing in their work disclosure after later session updates, with limited presentation-only impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 23, 2026, 3:21 PM ET / 19:21 UTC.

@vyctorbrzezowski
vyctorbrzezowski merged commit 25f6775 into main Oct 23, 2026
160 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/worked-duration-20261023 branch October 23, 2026 23:36
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant