Skip to content

fix(transcripts): preserve fixed and legacy capture history - #140563

Merged
steipete merged 1 commit into
mainfrom
codex/130860-id-origin
Sep 7, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/130860-id-origin

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #130860

What Problem This Solves

Fixes an issue where switching from a supplied transcript ID to occupancy-driven capture could reopen and append to that archived capture. Legacy records do not identify whether their IDs were supplied or generated, so ID spelling and current configuration cannot safely establish reopening eligibility.

Why This Change Was Made

Native capture and import admission record sessionIdOrigin in existing session metadata. Configured capture carries the original ID choice before supplying its selected ID; the meeting bridge records that its transcript ID was supplied by the meeting owner. The store preserves the original value, including missing or invalid legacy values, on later writes to the same identity. Provider results, mutated provider request metadata, and utterance text cannot establish that fact.

Occupancy uses the existing source/window query and newest-row selection. Only an explicitly generated candidate can reopen after the existing ownership checks; a newer ineligible row does not cause a search for an older generated meeting. The persistence decision is approved in #130860.

User Impact

New generated captures still continue within the existing ten-minute window. Supplied IDs and legacy captures with unknown or invalid origin start fresh, leaving prior notes and identities unchanged. Some genuinely generated legacy meetings therefore split after upgrade or restart, as approved. Doctor restoration preserves recorded origins without inferring or backfilling them.

No schema, index, configuration option, protocol/package version, or retention policy changes. Session writes add a bounded primary-key read inside the existing transaction to preserve admission metadata. Older runtimes do not enforce this policy; downgrading also removes the fixed-history protection.

Evidence

  • Five store regressions and four ineligible-reopen regressions failed on the original source for the expected reasons.
  • All 103 focused store, occupancy, capture/import lifecycle, and meeting-bridge cases pass, including database reopen, failed-start retries, forged provider metadata, and Doctor export/restoration.
  • Core types, the full changed-code gate, and fresh independent P0–P2 review passed.

Exact-head CI passed on f69ef976d1b40eabeec85f91e1a35133d89a7734.

The isolated live proof passed across three genuinely separate Gateway processes sharing fresh SQLite state. All capture admission and stopping used configured Gateway startup and Gateway.close(), with actual transcripts.status/get/list WebSocket readback. Generated history reopened in place; supplied/generated-looking and legacy absent/invalid histories started fresh; a newer supplied row prevented falling back to older generated history. The final ten rows, prior notes, raw IDs, selectors and archive responses matched the expected results. All 59 frozen source hashes were verified, and the owned Testbox is stopped.

The provider's occupancy and text are synthetic. No external channel, model call, operator Gateway, or agent-turn authority is exercised. An earlier harness attempted the unavailable HTTP transcript-tool surface and failed before policy validation; its evidence is retained. The final proof uses the supported Gateway lifecycle and archive RPCs without changing product authorization.

Record generated or supplied ID origin at native admission and preserve it
through later same-identity writes. Reopen only the newest explicitly generated
occupancy candidate; keep supplied and unknown legacy history intact and start
fresh without falling back to an older meeting.

Keep provider metadata separate from admission facts and preserve origins
through existing Doctor restoration. No schema, index, configuration, or
version change. Older runtimes do not enforce the new history policy.

The legacy restart tradeoff was explicitly approved in #130860.
Validation: 103 focused cases, regression-first store/reopen proof, core and
test types, changed-code guards, lint, and independent review.
Refs: #130860
@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: discord Channel integration: discord agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 01:12
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 6, 2026, 9:49 PM ET / September 7, 2026, 01:49 UTC.

ClawSweeper review

What this changes

Record how meeting transcript IDs were assigned, preserve that fact in SQLite, and reopen only known generated captures while leaving supplied-ID and legacy archives intact.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains a useful, maintainer-authored repair: current main lacks the ID-origin reopening guard. No blocking defect was found, and the updated Gateway evidence addresses the previous review’s proof request.

Priority: P2
Reviewed head: f69ef976d1b40eabeec85f91e1a35133d89a7734

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with useful regression coverage, an accepted compatibility contract, and relevant Gateway proof.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The captured updated body records the changed capture/store behavior across three real Gateway processes, shared SQLite, and WebSocket archive readback, including generated continuity and preserved supplied/legacy archives. This satisfies the prior restart-proof request at the production boundary; provider input is synthetic, and the linked artifact could not be independently fetched.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured updated body records the changed capture/store behavior across three real Gateway processes, shared SQLite, and WebSocket archive readback, including generated continuity and preserved supplied/legacy archives. This satisfies the prior restart-proof request at the production boundary; provider input is synthetic, and the linked artifact could not be independently fetched.
Evidence reviewed 7 items Current main still needs the repair: Fetched main selects a recent stopped capture using ownership and lifecycle checks without testing ID origin. The pinned introduced diff adds that missing condition; unrelated base-branch changes are excluded.
Admission metadata stays canonical: Capture and import derive origin from the actual ID choice; provider requests receive copied metadata. Store updates reread the exact primary key inside the existing synchronous transaction and preserve its original origin, including absence or invalidity.
Accepted persistence and upgrade policy: The supplied discussion for #130860 explicitly accepts fresh capture for unknown legacy origins, unchanged archives, no inferred backfill, and the loss of protection on downgrade. The branch documents those same boundaries.
Findings None None.
Security None None.

How this fits together

Meeting transcript capture receives configured occupancy events and provider speech, then saves sessions, utterances, and notes in SQLite. Reopening selection determines whether new speech continues an existing meeting or starts a separate archive.

flowchart TD
  A[Configured capture or import] --> B[Record ID origin]
  B --> C[SQLite transcript archive]
  D[Room becomes occupied] --> E[Select newest recent capture]
  C --> E
  E --> F{Known generated origin and existing checks pass}
  F -->|Yes| G[Continue saved meeting]
  F -->|No| H[Start fresh and preserve archive]
Loading

Before merge

  • Resolve merge risk (P1) - Upgrading intentionally splits genuinely generated legacy meetings whose origin was never recorded; downgrading removes fixed-history protection. Both tradeoffs are explicitly accepted and documented.
  • Resolve merge risk (P1) - The linked Gateway proof artifact could not be independently opened in this review environment; its detailed captured PR-body results remain the available runtime evidence.
Agent review details

Security

None.

PR surface

Source +34, Tests +148, Docs +21. Total +203 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 5 46 12 +34
Tests 4 165 17 +148
Docs 4 24 3 +21
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 235 32 +203

Review metrics

Metric Value Why it matters
Persistent contract 1 immutable metadata field; 0 schema or configuration additions The change affects restart eligibility through existing storage and has an explicit accepted upgrade policy.

Merge-risk options

Maintainer options:

  1. Retain the accepted legacy behavior (recommended)
    Proceed with the documented fresh-capture behavior for unknown legacy origins and the explicit downgrade limitation.

Technical review

Best possible solution:

Keep admission-owned ID provenance and the approved conservative legacy behavior, with archive preservation and restart compatibility documented and covered by the supplied Gateway proof.

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

Yes, from source: switching a recently stopped supplied-ID source to occupancy capture on current main can select that archive because reopening lacks an origin check; this review did not execute the scenario.

Is this the best way to solve the issue?

Yes. Recording the fact at admission and preserving it at the store avoids guessing from ID spelling or current configuration while retaining the existing query, window, and ownership checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured updated body records the changed capture/store behavior across three real Gateway processes, shared SQLite, and WebSocket archive readback, including generated continuity and preserved supplied/legacy archives. This satisfies the prior restart-proof request at the production boundary; provider input is synthetic, and the linked artifact could not be independently fetched.

Label justifications:

  • P2: This is a bounded repair to optional meeting capture that prevents unintended continuation of archived history.
  • merge-risk: 🚨 compatibility: Unknown legacy captures stop reopening after upgrade, and older runtimes do not enforce the new protection.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The captured updated body records the changed capture/store behavior across three real Gateway processes, shared SQLite, and WebSocket archive readback, including generated continuity and preserved supplied/legacy archives. This satisfies the prior restart-proof request at the production boundary; provider input is synthetic, and the linked artifact could not be independently fetched.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured updated body records the changed capture/store behavior across three real Gateway processes, shared SQLite, and WebSocket archive readback, including generated continuity and preserved supplied/legacy archives. This satisfies the prior restart-proof request at the production boundary; provider input is synthetic, and the linked artifact could not be independently fetched.

Evidence

What I checked:

  • Current main still needs the repair: Fetched main selects a recent stopped capture using ownership and lifecycle checks without testing ID origin. The pinned introduced diff adds that missing condition; unrelated base-branch changes are excluded. (src/transcripts/auto-start.ts:341, 940c359a3620)
  • Admission metadata stays canonical: Capture and import derive origin from the actual ID choice; provider requests receive copied metadata. Store updates reread the exact primary key inside the existing synchronous transaction and preserve its original origin, including absence or invalidity. (src/transcripts/store.ts:384, f69ef976d1b4)
  • Accepted persistence and upgrade policy: The supplied discussion for fix(discord): preserve meeting logs through voice reconnects #130860 explicitly accepts fresh capture for unknown legacy origins, unchanged archives, no inferred backfill, and the loss of protection on downgrade. The branch documents those same boundaries. Public docs: docs/reference/database-schemas.md. (docs/reference/database-schemas.md:71, f69ef976d1b4)
  • Regression coverage: The inspected tests cover all five origin states, preservation through SQLite reopen and Doctor restoration, provider metadata mutation, configured retries, newest-ineligible selection, and generated capture continuity. The captured PR body reports nine pre-fix failures and 103 passing focused cases; tests were not executed during this read-only review. (src/transcripts/store.test.ts:39, f69ef976d1b4)
  • Updated production-boundary proof: The supplied complete PR body, context sourceRevision f3be541fb836ca2b005a8b9b6e081fe1ccbbfc978f9c9a945624c2cbbb45c050, reports three separate Gateway processes sharing SQLite, configured startup and shutdown, and real transcripts.status/get/list WebSocket readback. It records generated continuity, fresh captures for supplied and unknown origins, no fallback past a newer supplied row, and preservation of ten final rows and prior notes. The linked run is https://github.com/openclaw/openclaw/actions/runs/34072269369. Attempts to inspect that run independently failed because the network fetch was unavailable; no contradictory result was observed. (f69ef976d1b4)
  • Related area history: Current-main history connects Peter Steinberger with occupancy capture, archive persistence, and recent startup lifecycle repairs. A deeper blame/search encountered unavailable historical objects, so no exact source-line introduction claim is made. (src/transcripts/store.ts, 3f123833e455)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-07T01:19:04.635Z sha f69ef97 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 7, 2026
@steipete
steipete merged commit 44f047f into main Sep 7, 2026
257 checks passed
@steipete
steipete deleted the codex/130860-id-origin branch September 7, 2026 01:53
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 7, 2026
…137098

* commit '8a540c252002878f3c3e9d8dfb837b83c8602a78': (2210 commits)
  perf(plugins): keep bundled catalog lookups lightweight (#140597)
  refactor: streamline skills JSON serialization (#140581)
  fix(feishu): expand quoted merged-forward messages (#136231)
  fix(talk): keep opaque realtime routes out of public config (#129144)
  fix(ci): avoid Linux packaging on pull requests (#140589)
  fix(usage): release completed request payloads (#140588)
  fix(tooling): omit Trae machine squash credit (#140562)
  fix(ui): stop catalog paging in hidden tabs (#140583)
  fix(portals): reach IPv6 loopback with IPv4-only localhost records (#140580)
  fix(transcripts): preserve fixed and legacy capture history (#140563)
  fix(ui): prevent Talk E2E audio capture stalls (#138803)
  fix(media): release completed document source buffers (#140561)
  fix(anthropic): preserve resumed CLI caches across Git changes (#140566)
  chore(ui): refresh control ui locales (#140586)
  fix(ui): keep usage exports bound to their session instance (#140573)
  refactor(exa): test response readers through tool execution (#140572)
  fix(macos): omit incompatible worker binaries from app bundles (#140557)
  fix: avoid retaining discarded tool output (#140570)
  refactor(gateway): share placement move matching (#140569)
  fix(gateway): preserve child turns during systemd drain (#140568)
  ...

# Conflicts:
#	.agents/skills/release-openclaw-maintainer/SKILL.md
#	docs/reference/RELEASING.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…#140563)

Record generated or supplied ID origin at native admission and preserve it
through later same-identity writes. Reopen only the newest explicitly generated
occupancy candidate; keep supplied and unknown legacy history intact and start
fresh without falling back to an older meeting.

Keep provider metadata separate from admission facts and preserve origins
through existing Doctor restoration. No schema, index, configuration, or
version change. Older runtimes do not enforce the new history policy.

The legacy restart tradeoff was explicitly approved in openclaw#130860.
Validation: 103 focused cases, regression-first store/reopen proof, core and
test types, changed-code guards, lint, and independent review.
Refs: openclaw#130860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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