Skip to content

fix(sessions): keep transcript workers outside Doctor repair imports - #197153

Merged
roboclaw-bot merged 9 commits into
mainfrom
openclaw/briny-barnacle
Nov 11, 2026
Merged

roboclaw-bot merged 9 commits into
mainfrom
openclaw/briny-barnacle

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related: #196079

What Problem This Solves

Fixes: standalone transcript-worker builds pull unrelated Gateway/update code into their dependency graph when reading canonical session rows.

User Impact

User impact: transcript workers can read canonical session rows without loading the Doctor restoration dependency owner. Session data, permissions, malformed-row handling, and Doctor's offline-custody restoration of renamed-agent cold transcripts remain unchanged; no migration or user action is required.

Why This Change Was Made

#196079 (7010349a97d3b94f5a15cbf90abca5c9cadd234d) added a dynamic cold-restoration import to the shared canonical-repair module. The transcript → retirement-read → legacy-claims → exact-reader path then reached that mutable Doctor module. This change moves the unchanged exact-row reader into a dedicated read module and migrates all six callers, including three fixture imports, without retaining the obsolete export. It preserves the complete Doctor implementation rather than rolling back cold restoration, and changes no SQL, queries, schema, authority, tests, graph assertions, baselines, or timeouts.

Evidence

  • Main run 42979421592, job 130386514647: the standalone config/sessions/session-transcript.worker graph check reports 616 forbidden Gateway/update inputs.
  • Reviewed source proof: the exact 47-line reader and the remaining Doctor implementation are byte-identical to their prior versions; all six reader callers migrated. The existing graph assertion remains unchanged as the regression check. Diff: eight files, +62/−57.
  • Independent isolated review: scoped-clean, report produced, no P2 findings, confidence 0.92.
  • Local limitation: the named runtime-process-build-graph test could not collect because task dependencies were missing. Source invariance is not full transitive-graph or integration proof. Exact-head graph, type, integration, and build CI are required before landing, through normal PR CI; no manual dispatch or passing CI is claimed.
  • Publication preflight git diff --check reports one extra blank line at EOF in the new read module; the exact already-reviewed commit is preserved without source edits.

Contributor credit: @steipete and @obviyus.

Work sessions

Linked for team reference; these sessions aren’t public.

Worked on by

roboclaw-bot and others added 2 commits November 11, 2026 08:49
Separate the unchanged exact-row reader from the mutable Doctor repair graph introduced by #196079. Preserve cold restoration, malformed-row handling and all read callers; keep standalone transcript worker graph assertions unchanged.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
Worked on by:
- @obviyus
- @steipete

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: a5810362-f6b3-86b4-b15f-fda48e461821
@clawsweeper

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

roboclaw-bot and others added 2 commits November 11, 2026 08:54
Migrate three test imports outside the sessions directory and bind the existing database inventory operation to the extracted reader owner. Preserve all assertions.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts commands Command implementations agents Agent runtime and tooling labels Nov 11, 2026
@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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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 Nov 11, 2026
@clawsweeper

clawsweeper Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR extracts the unchanged canonical session-row reader from Doctor repair code and updates its callers and database inventory.

Example: Build the standalone config/sessions/session-transcript.worker entry.

  • Before: Its retirement-read dependency reaches Doctor cold restoration and unrelated Gateway/update code.
  • After: Canonical row reads use a separate module without importing the Doctor restoration implementation.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-preserving repair with passing build and validation metadata; the specific graph regression trace was not independently inspectable.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored mechanical extraction is outside the ordinary contributor proof gate; source preserves the read and repair implementations, and the exact-head build passed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Standalone transcript-worker builds include unrelated Gateway/update dependencies through a shared Doctor module.
Reason: The maintainer-authored direction repairs an explicit worker boundary while retaining the earlier lossless Doctor repair and introducing no configuration or public contract.

Regression provenance

Regression provenance — suspected predecessor, not a causality claim: source commit a6e2cd3c1449 by Peter Steinberger; no PR verified.

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR: it repairs an owned worker import-boundary regression while preserving Doctor restoration, with no introduced defect identified.

Priority: P2
Reviewed head: 823a6197a971b7b69ad6b34eb029104904270c3d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The submitted evidence does not show the named graph test failing on the base and passing on this head; raw CI logs were unavailable to this review.
Agent review details

How this fits together

Transcript workers and Doctor consume canonical SQLite session rows; the extracted reader returns the same entry and row while Doctor retains ownership of restoration and repair.

flowchart TD
  A[Transcript worker] --> B[Retirement comparison reader]
  B --> C[Canonical row reader]
  C --> D[SQLite session rows]
  E[Doctor imports and lifecycle repair] --> C
  E --> F[Doctor cold restoration]
Loading

Technical review

Best possible solution:

Keep the exact-row reader separate from Doctor restoration, with every caller using the extracted implementation and the existing graph guard unchanged.

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

Source establishes the transcript-worker → retirement reader → legacy claims → canonical repair → cold-storage import path; the linked main job failed, but its detailed trace was inaccessible and no target code was executed.

Is this the best way to solve the issue?

This is the smallest complete fix: separate the unchanged read operation from the mutable repair dependency graph, migrate its callers, and preserve existing restoration and regression assertions.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • RoboClaw: Raw commit 7010349 adds src/config/sessions/session-accessor.sqlite-canonical-repair.ts:191 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7010349a97d3; files: src/config/sessions/session-accessor.sqlite-canonical-repair.ts)

PR surface

Source +4, Tests 0, Other +10. Total +14 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 58 54 +4
Tests 6 6 6 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 11 1 +10
Total 12 75 61 +14

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A focused worker-build dependency regression warrants repair without evidence of an urgent user-facing runtime outage.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A focused worker-build dependency regression warrants repair without evidence of an urgent user-facing runtime outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 November 11, 2026, 4:18 AM ET / 09:18 UTC.

roboclaw-bot and others added 5 commits November 11, 2026 09:59
Keep all three PostgreSQL 17 conformance shards at 30 minutes and run the unchanged pinned PG16 Gateway target in an independently gated 15-minute job. Preserve reporter, aggregate, completion and hosted-cost accounting. Six net lines extend existing guard cases; allocate exactly six lines in pg16-independent-smoke.txt, with no new cases or shared scalar increase.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
Keep independent PG16 admission and deadline in a fourth matrix row while restoring default YAML alias guard compatibility. Retain all PostgreSQL checks and aggregate gate ownership.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>
Restore the workflow byte guard without changing matrix admission, execution budgets or tests. The pg16-smoke row remains identifiable by its matrix label.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>
Keep daily qualification at three shards and model PR matrix exclusions separately from Cartesian dimensions. Preserve actual jobs and guard thresholds; allocate twelve exact net guard lines.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>
Satisfy the existing curly lint rule without changing matrix behavior. Account for the two required brace lines in the exact scoped test allocation.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit 6d71e65 into main Nov 11, 2026
133 of 136 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/briny-barnacle branch November 11, 2026 12:07
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

rune-dandelion-cult pushed a commit to karmaterminal/openclaw that referenced this pull request Nov 11, 2026
…penclaw#197153)

* fix(sessions): keep canonical row reads outside Doctor restoration

Separate the unchanged exact-row reader from the mutable Doctor repair graph introduced by openclaw#196079. Preserve cold restoration, malformed-row handling and all read callers; keep standalone transcript worker graph assertions unchanged.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(sessions): keep transcript workers outside Doctor repair imports

Worked on by:
- @obviyus
- @steipete

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: a5810362-f6b3-86b4-b15f-fda48e461821

* style(sessions): remove extra canonical reader EOF line

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(test): complete canonical reader caller cutover

Migrate three test imports outside the sessions directory and bind the existing database inventory operation to the extracted reader owner. Preserve all assertions.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(ci): give PostgreSQL 16 smoke its own execution budget

Keep all three PostgreSQL 17 conformance shards at 30 minutes and run the unchanged pinned PG16 Gateway target in an independently gated 15-minute job. Preserve reporter, aggregate, completion and hosted-cost accounting. Six net lines extend existing guard cases; allocate exactly six lines in pg16-independent-smoke.txt, with no new cases or shared scalar increase.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(ci): isolate PostgreSQL smoke without expanding workflow aliases

Keep independent PG16 admission and deadline in a fourth matrix row while restoring default YAML alias guard compatibility. Retain all PostgreSQL checks and aggregate gate ownership.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

* fix(ci): simplify PostgreSQL matrix display names

Restore the workflow byte guard without changing matrix admission, execution budgets or tests. The pg16-smoke row remains identifiable by its matrix label.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

* fix(test): model PostgreSQL matrix exclusions in hosted admission

Keep daily qualification at three shards and model PR matrix exclusions separately from Cartesian dimensions. Preserve actual jobs and guard thresholds; allocate twelve exact net guard lines.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

* fix(test): brace matrix exclusion control flow

Satisfy the existing curly lint rule without changing matrix behavior. Account for the two required brace lines in the exact scoped test allocation.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
steipete added a commit that referenced this pull request Nov 11, 2026
…entry budget (#197269)

* ci(update): enforce the installed-tree budget in the published-driver cell

The 47,500-entry budget check only ran in Package Acceptance, which main never
reached on a schedule (Update Migration is blocked at image prep), and the
hourly published-driver cell uses the latest published driver, which degrades
past the walk cap instead of refusing. So #196079 pushed main past the 50,000
entries that 2026.9.x updaters enforce without any CI going red.

Measure the tree the published driver actually installed and assert the same
release budget, so scheduled main validation goes red within the hour.

Refs #196079

* test(sessions): bound the retirement-read worker build

#196079 let the transcript worker's private build reach Doctor's cold-restore
graph, which pushed the installed package past the 50,000 entries that
2026.9.x updaters accept; #197153 fixed the import edge. Build the
retirement-read worker with its real private config and require it to stay
small, so the edge cannot come back unnoticed: 5,408 emitted files before
#197153, 58 after.

Refs #196079
Refs #196418

* ci(update): mount the installed-tree budget module in the Docker harness

The published-driver cell imports scripts/check-openclaw-installed-package-budget.mts,
which the harness did not mount, so the cell would fail on import.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
…penclaw#197153)

* fix(sessions): keep canonical row reads outside Doctor restoration

Separate the unchanged exact-row reader from the mutable Doctor repair graph introduced by openclaw#196079. Preserve cold restoration, malformed-row handling and all read callers; keep standalone transcript worker graph assertions unchanged.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(sessions): keep transcript workers outside Doctor repair imports

Worked on by:
- @obviyus
- @steipete

Co-authored-by: obviyus <[email protected]>
Co-authored-by: steipete <[email protected]>
OpenClaw-Publication: a5810362-f6b3-86b4-b15f-fda48e461821

* style(sessions): remove extra canonical reader EOF line

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(test): complete canonical reader caller cutover

Migrate three test imports outside the sessions directory and bind the existing database inventory operation to the extracted reader owner. Preserve all assertions.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(ci): give PostgreSQL 16 smoke its own execution budget

Keep all three PostgreSQL 17 conformance shards at 30 minutes and run the unchanged pinned PG16 Gateway target in an independently gated 15-minute job. Preserve reporter, aggregate, completion and hosted-cost accounting. Six net lines extend existing guard cases; allocate exactly six lines in pg16-independent-smoke.txt, with no new cases or shared scalar increase.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>

* fix(ci): isolate PostgreSQL smoke without expanding workflow aliases

Keep independent PG16 admission and deadline in a fourth matrix row while restoring default YAML alias guard compatibility. Retain all PostgreSQL checks and aggregate gate ownership.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

* fix(ci): simplify PostgreSQL matrix display names

Restore the workflow byte guard without changing matrix admission, execution budgets or tests. The pg16-smoke row remains identifiable by its matrix label.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

* fix(test): model PostgreSQL matrix exclusions in hosted admission

Keep daily qualification at three shards and model PR matrix exclusions separately from Cartesian dimensions. Preserve actual jobs and guard thresholds; allocate twelve exact net guard lines.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

* fix(test): brace matrix exclusion control flow

Satisfy the existing curly lint rule without changing matrix behavior. Account for the two required brace lines in the exact scoped test allocation.

Co-authored-by: steipete <[email protected]>

Co-authored-by: obviyus <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
…entry budget (openclaw#197269)

* ci(update): enforce the installed-tree budget in the published-driver cell

The 47,500-entry budget check only ran in Package Acceptance, which main never
reached on a schedule (Update Migration is blocked at image prep), and the
hourly published-driver cell uses the latest published driver, which degrades
past the walk cap instead of refusing. So openclaw#196079 pushed main past the 50,000
entries that 2026.9.x updaters enforce without any CI going red.

Measure the tree the published driver actually installed and assert the same
release budget, so scheduled main validation goes red within the hour.

Refs openclaw#196079

* test(sessions): bound the retirement-read worker build

openclaw#196079 let the transcript worker's private build reach Doctor's cold-restore
graph, which pushed the installed package past the 50,000 entries that
2026.9.x updaters accept; openclaw#197153 fixed the import edge. Build the
retirement-read worker with its real private config and require it to stay
small, so the edge cannot come back unnoticed: 5,408 emitted files before
openclaw#197153, 58 after.

Refs openclaw#196079
Refs openclaw#196418

* ci(update): mount the installed-tree budget module in the Docker harness

The published-driver cell imports scripts/check-openclaw-installed-package-budget.mts,
which the harness did not mount, so the cell would fail on import.
RomneyDa added a commit that referenced this pull request Nov 15, 2026
Backport the omitted inventory hunk from 6d71e65 (#197153), keeping its existing T2 ownership with the extracted canonical reader. Document the existing model-navigation assertion at its operator for the safety ratchet. No runtime behavior or gate thresholds change.

Co-authored-by: steipete <[email protected]>
Co-authored-by: obviyus <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Nov 19, 2026
…stage 2)

Catches the pure continuation candidate bc7e568 up to openclaw/openclaw
main 41bdde2 (fetched 2026-11-19T14:32:59Z),
2,996 upstream commits past the old merge base 401a1de. Merge commit only;
rerere disabled, so every resolution was made here.

80 conflicted paths (77 content, 3 modify/delete), each recorded with base,
ours and theirs blobs and its reason in the lane's stage2-conflicts.md:
- 8 take upstream whole: the openclaw#197153 pg16-smoke cherry-pick (6909b64) now
  ships upstream (ci.yml, ci-build-manifest, ci-workflow-planning test), the
  Control UI settings child moved onto runDistArtifactChild, the canary
  worker target and two active-facts migration tests.
- 3 deleted with upstream: session-fork and update-candidate-canary suites
  whose production paths upstream removed; cwd-split folded away (openclaw#198916),
  its one continuation case rehomed to attempt.continuation-tools.test.ts.
- One-owner cutovers where upstream now owns a fork extraction: the
  requester-origin projection and replacement-text helpers (openclaw#200533) replace
  the fork's byte-identical copies in user-turn-transcript.metadata.ts.
- Ports into fork-extracted owners: removalReason in the queued-start plan
  and collector-group sweep (openclaw#199868), the async prepared-pricing usage
  diagnostic, the announce flow types, and the session-delivery codec, which
  gains upstream's mediaCandidate kind, reviewedTaskId and their schemas
  (openclaw#198227), importing its retention type from the leaf types module.
- Transcript repair (openclaw#201304, post-b894): upstream's payload-free adapter
  kernel carries the fork's continue_delegate attachment redaction through a
  payload-adapter-only fact and a withBlock update.
- Reset cleanup: upstream's process and retained-send stops (openclaw#199079,
  openclaw#200326) with the fork's continuation-aware reason as the single input;
  the chat reset's retention adapter wraps upstream's stopSessionResetWork,
  the Gateway preemption keeps stopSessionResetSubagents as upstream does.
- Schema: upstream owns agent 42 (tool usage) and 43 (pending-input
  endings) and is at 43; 44 is unused upstream. Continuation's recipient
  authority moves 42 -> 44: version constants, step order, historical
  schemas, witness additive table and version set, backup scope, PostgreSQL
  ladder (V43 = current minus the authority table) and port descriptor.
  package.json schemaVersions state 40, agent 44.
- Generated outputs regenerated, never hand-merged: config baseline,
  gateway validators, postgres schema catalogs, worker-access inventory.
- Compile follow-through for upstream's delivery-union narrowing and its
  readSessionDelivery callers.

Refs openclaw#129388
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Nov 19, 2026
check:test-lines-ratchet --base 41bdde2 at c5b57d9 measured
+113058 net test lines against 400 allowance plus 112361 credit, 297
over. Every fork record credited at bc7e568 is still credited, so the
gap is this lane's own growth: measured per file as (HEAD - 41bdde2)
minus (bc7e568 - 401a1de), the fork's test lines grew by 696. The
new continuation-stage2-coverage.txt breaks that down by commit: the O4a
real-producer pins (+324), O3 and H1 custody pins (+137), O2 (+54),
capacity pools (+30), O1 (+32), schema-44 pins (+47), fixtures that
follow upstream contracts merged at 41bdde2 (+52), merge resolutions
(+62) and fork deltas upstream absorbed (-42).

pg16-independent-smoke.txt was the fork's cherry-picked copy of upstream
openclaw#197153's record. Upstream retired it in openclaw#197656. The merge kept the
fork's copy, but its 14 lines are now upstream's, in the base. It goes
too.

With both changes: "Test lines OK. Net test lines: +113058; allowance:
400; allocation credit: 113043."

Refs openclaw#129388

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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