Skip to content

fix(transcripts): keep model summary completion deadline on the monotonic clock - #185146

Merged
obviyus merged 1 commit into
openclaw:mainfrom
SunnyShu0925:fix/transcript-summary-model-deadline-monotonic
Oct 28, 2026
Merged

obviyus merged 1 commit into
openclaw:mainfrom
SunnyShu0925:fix/transcript-summary-model-deadline-monotonic

Conversation

@SunnyShu0925

@SunnyShu0925 SunnyShu0925 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A forward wall-clock correction during asynchronous transcript-summary preparation can make a healthy model-summary deadline appear already expired. The shipped transcripts.summarize path then skips completion and silently saves deterministic heuristic notes instead of the model-enhanced notes it would normally generate.

The previous deadline used Date.now() for an elapsed-time budget. This PR uses performance.now() for its seed, expiry check and remaining completion budget, keeping all three reads in the same monotonic clock domain.

User Impact

Healthy model notes are no longer skipped solely because the wall clock steps forward. Meeting identity, calendar metadata, participants and captured utterances remain unchanged. Provider failures and genuine timeouts still use the existing heuristic fallback.

This is not an unbounded-hang fix. A rewind can inflate the downstream timeout argument on main, but the existing fixed outer 20-second abort already bounds active inference. That timer is unchanged by this PR.

Why This Change Was Made

The summary owner's deadline is private process-local elapsed state, not a persisted calendar time. Aligning its three reads with the existing monotonic timer is the smallest complete repair: three one-line substitutions, with no new abstraction, configuration option or retry policy.

The inference route, summary prompt, heuristic fallback, saved schema, calendar timestamps and outer MODEL_SUMMARY_TIMEOUT_MS abort remain unchanged.

Evidence

Independent shipped-RPC forward-step repetitions, no-step controls, provider-error controls and bounded stalled-request proof.

Built current main 542a03d30c953964f7d4176954d09a20423c147f and this candidate in an isolated Node 24.22.1 container. Each leg starts a fresh Gateway with task-owned state and a valid three-utterance transcript archive created through the supported store writer.

A proof-only prelude changes only process-local JavaScript Date.now during evaluation of the real lazy summary runtime, after the deadline seed. The host/VM clock, performance.now and native timers are not changed. No summary owner, completion wrapper or inference operation is mocked or skipped by the harness.

Build Step Completion requests Persisted notes
Main, twice +30s 0 each heuristic
Candidate, twice +30s 1 each model
Main and candidate controls none 1 each model

The local protocol-compatible HTTP fixture returns fixed valid model-note JSON through the real transport; this demonstrates routing and persistence, not real-model inference quality. Results are reread through transcripts.get, with unchanged utterances and meeting metadata.

A stalled HTTP fixture under a −30s process-local rewind returns heuristic notes in 20.648s on main and 20.640s on candidate, confirming the unchanged outer abort already bounds inference on both. Provider-error controls preserve identical heuristic note content on both. Stored calendar metadata also remains unchanged. All ten shipped-RPC legs complete successfully.

The existing committed rewind regression checks that the completion timeout argument stays within the configured budget. It does not establish an unbounded hang on the old code. No test-budget baseline was raised.

Merge Risk

Two-way door: reverting restores the prior deadline calculation without changing any stored format. Existing generated summaries remain readable; the change does not regenerate historical heuristic notes. Blast radius is the optional model-enhancement budget for transcript summaries. No public API, prompt, provider-precedence or timeout-policy changes.

…onic clock

The transcript summary lane seeds its deadline with Date.now() (wall clock)
and then derives the per-completion timeoutMs from that wall-clock deadline
before handing it to runIsolatedCompletion, which schedules the abort on the
monotonic clock. A wall-clock rewind inflates timeoutMs and lets a stalled
completion run well past the 20s budget; a forward jump clamps it toward 1ms
and aborts healthy summary generation. Seed, check, and remaining-budget all
now use performance.now() so the deadline stays in the same clock domain as
the downstream monotonic timer.
@clawsweeper

clawsweeper Bot commented Oct 26, 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.

@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. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Use a monotonic clock for the meeting-summary deadline, expiry check, and remaining completion budget.

Example: The wall clock advances 30 seconds while a meeting summary is preparing its model request.

  • Before: The deadline appears expired and model generation falls back to heuristic notes.
  • After: Model generation retains approximately 20 seconds of budget despite the clock adjustment.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal owner-level fix with a distinct regression, supplied shipped-entry-point fault proof, and successful exact-head checks.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Supplied terminal traces exercise the changed summary owner through an authenticated Gateway transcripts.summarize RPC and a real provider HTTP transport with injected ±30-second wall-clock changes, showing corrected remaining budgets and successful forward-jump model generation.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Meeting notes can silently lose model enhancement when the system clock advances during summary preparation.
Reason: The change restores the existing bounded-inference contract without changing configuration, routing, fallback policy, or persisted formats.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current deadline-calculation bug with a focused change and no actionable patch findings.

Priority: P2
Reviewed head: 058382eb824e780832724d8d60363fdcb5d695c9

Before merge

None.

Findings

None.

Agent review details

How this fits together

The transcript summary owner converts saved meeting utterances into model-enhanced notes, using isolated completions and retaining heuristic notes when inference fails.

flowchart TD
  A[Transcript summarize RPC] --> B[Capture summary owner]
  B --> C[Model summary deadline]
  C --> D[Utility or isolated completion]
  D --> E[Model provider]
  E --> B
  B --> F[Saved meeting notes]
Loading

Technical review

Best possible solution:

Keep the existing summary owner and use performance.now() consistently for its process-local completion deadline.

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

Current-main source establishes the forward-jump failure, and the contributor supplies matching pre-fix/post-fix RPC traces and a red/green rewind regression; no target code was executed during this review.

Is this the best way to solve the issue?

The three substitutions repair the clock-domain invariant without new machinery; the PR's rewind-hang claim is overstated because the unchanged outer abort timer already bounds active inference.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Meeting-summary deadline and resource settlement keeps the original intent (feat(meetings): summarize meetings during live capture #151957: Live meeting summaries must remain bounded while preserving primary-model and heuristic fallbacks; the subsequent ownership refactor retained resource settlement, and the private-input cleanup retained the existing deadline.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The introduced diff replaces all three wall-clock deadline operations with performance.now() and adds one clock-rewind regression using existing fixtures. (src/transcripts/summary-model.ts:89, 058382eb824e)
  • Current-main bug remains: Current main still seeds, checks, and subtracts the summary deadline using Date.now(); its affected files match the introduced base. (src/transcripts/summary-model.ts:121, dd1743951ddc)
  • Completion clock contract: Isolated completion derives its deadline from performance.now() and combines its timeout signal with the summary owner's abort signal. (src/agents/isolated-completion.ts:85, 058382eb824e)
  • Supplied production-path proof: The PR body supplies authenticated Gateway transcripts.summarize RPC traces with a real provider transport: a forward clock step skips inference before the fix and retains about 19.6 seconds afterward; rewind traces show the inflated completion argument corrected. Downloaded screenshots were inspected and belong to the earlier live-meeting feature, so they are not proof of this clock fix. (058382eb824e)
  • Feature ownership and intent: History identifies Peter Steinberger's meeting-summary introduction, live-capture work, ownership refactor, and utility fallback changes; feat(meetings): summarize meetings during live capture #151957 establishes bounded inference with preserved primary and heuristic fallbacks. (src/transcripts/summary-model.ts:121, a06bd2c520a1)
  • Exact-head checks and mergeability: Both check-run pages contain no failing or unfinished checks, commit statuses report success including openclaw/ci-gate, and GitHub reports the reviewed head cleanly mergeable. (058382eb824e)

PR surface

Source 0, Tests +20. Total +20 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 3 0
Tests 1 20 0 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 23 3 +20

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: System clock adjustments can suppress model-generated meeting notes, while heuristic notes remain available.
  • 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.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-26T23:27:46.911Z sha 058382e :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-27T00:59:00.092Z sha 058382e :: needs maintainer review before merge. :: none

Reviewed October 26, 2026, 11:05 PM ET / October 27, 2026, 03:05 UTC (Revision 3).

@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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 27, 2026
@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 27, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 27, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Oct 28, 2026
@obviyus

obviyus commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Independent proof through the built Gateway's authenticated transcripts.summarize RPC, using current main 542a03d30c953964f7d4176954d09a20423c147f and candidate 058382eb824e780832724d8d60363fdcb5d695c9.

Each leg uses a fresh Gateway process and isolated profile/state. A supported TranscriptsStore.writeSession / appendUtteranceForSession fixture creates a valid stopped meeting with three utterances and no summary before startup. No private SQL or mocked summary owner is used.

A proof-only in-memory prelude at evaluation of the real compiled summary-model.runtime.js changes only that Gateway process's JavaScript Date.now. This occurs during the real lazy import, after the summary deadline seed. performance.now, native timers, the host clock and VM clock are untouched. No completion wrapper or inference operation is replaced or skipped by the harness.

The configured provider is a task-owned HTTP fixture speaking the existing OpenAI-compatible protocol. It returns fixed valid notes JSON through the real completion transport. This proves routing and persistence, not real-model inference quality; no external provider credential is involved.

Shipped build Process-local step Real completion HTTP requests Persisted summary source RPC elapsed
Main, repeat 1 +30s 0 heuristic 544ms
Main, repeat 2 +30s 0 heuristic 567ms
Candidate, repeat 1 +30s 1 model 726ms
Candidate, repeat 2 +30s 1 model 714ms
Main control none 1 model 658ms
Candidate control none 1 model 666ms

The model-note marker is Model notes: the CLI release was approved. It is absent after the forward step on main and present on both candidate repetitions. Every result is reread with transcripts.get to verify persistence.

Important correction to the earlier impact wording: this is premature fallback after a forward step, not an unbounded rewind hang. The unchanged outer 20-second abort already bounds active inference on main. With a −30s process-local rewind and a deliberately stalled HTTP fixture, main returns heuristic notes in 20,648ms, and candidate in 20,640ms. Both make a real request; the fixed outer abort remains effective.

Provider-error controls also return heuristic notes on both builds (654ms main, 619ms candidate). The heuristic overview, decisions, action items, risks, participants and utterance count are identical across all fallback legs. Title, start/stop calendar times, participants and all three utterances survive each RPC unchanged; the supported archive readback also confirms unchanged stored calendar metadata. All ten legs complete successfully.

No production, prompt, schema, inference-route or timeout-policy change was needed beyond the contributor's three clock-domain substitutions. The body is being corrected to remove the unbounded-hang claim.

@obviyus
obviyus merged commit 8cebac4 into openclaw:main Oct 28, 2026
193 checks passed
@obviyus

obviyus commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Landed in 8cebac4. Thanks @SunnyShu0925. Transcript summaries no longer skip the model after a clock jump.

@SunnyShu0925

Copy link
Copy Markdown
Contributor Author

@obviyus Thanks!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…onic clock (openclaw#185146)

fix(transcripts): keep the model summary completion deadline on the monotonic clock

The transcript summary's model completion deadline was measured with the wall clock, so after a forward clock step it treated the deadline as already passed and fell back to heuristic notes without asking the model. The deadline now uses monotonic time.

Evidence: authenticated transcripts.summarize on built Gateways with a local HTTP provider fixture and Date.now stepped forward 30 seconds inside the process only. On main no completion request was sent and heuristic notes were saved (twice); with this change one request was sent and model notes were saved (twice). No-step runs give model notes and provider errors give the same fallback on both refs; the existing 20-second outer abort still bounds a stalled request. Details: openclaw#185146 (comment). Production 6 lines.

Thanks @SunnyShu0925.

Co-authored-by: SunnyShu <0668000539@local>
Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawtributors PR from a clawtributor P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS 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.

3 participants