Skip to content

fix(gateway): start with retained deleted-agent databases - #198145

Merged
roboclaw-bot merged 1 commit into
mainfrom
r50-held-agent-db-startup
Nov 13, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
r50-held-agent-db-startup

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related #172740.

What Problem This Solves

Gateway startup fails after an upgrade when historical ACP metadata references a deleted or unconfigured agent database that Doctor intentionally leaves at an older schema.

User Impact

Configured agents can start while those retained stores stay unavailable and untouched. Configured databases with older schemas still require offline repair; no schema, config, migration, or retention behavior changes.

Why This Change Was Made

ACP startup validation followed historical row owners before the session maintenance loop applied its configured/deleted-store exclusions. Scope that validation to the existing configured physical database targets and candidate paths, retaining shared-store ownership checks and admission refusals. Historical ACP metadata remains preserved for explicit restoration.

Evidence

  • Existing startup owner regression, startup scopes old-schema ACP stores: on base 066c7ecdeccf3f958d356cfdadac7a7146133021, retained-by-deletion and unconfigured schema-41 stores both reject with gateway.maintenance_required (required schema 42); the configured-store rejection control passes. With the fix, all 17 tests in startup-migration.acp.test.ts pass, including byte preservation (49.73 s Vitest, 51.85 s wrapper).
  • All seven tests in session-startup-migration.test.ts pass through the Gateway preparation and maintenance handoff (30.64 s Vitest, 32.40 s wrapper). These timings include worker preparation; PR CI supplies broad proof.
  • Touched-file lint, typecheck, formatting, and git diff --check pass. Initial borrowed-dependency setup refusals were resolved with a private frozen install and are excluded from product proof.
  • Independent Codex autoreview of the complete local patch against the base above: scoped-clean through P2, no actionable findings. Simplification retains existing owners with no new helper or state: production +8 net lines; tests +58. The real database/schema, completed-deletion journal, and configured-agent control share one parameterized fixture. No redundant existing test could be removed without losing separate ACP ownership/lifecycle proof.

Contributor credit: @steipete.

Work sessions

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

Scope historical ACP startup validation to configured physical database targets. Preserve held data and retain schema rejection for configured stores.

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

clawsweeper Bot commented Nov 13, 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 13, 2026
@roboclaw-bot
roboclaw-bot merged commit 63b5280 into main Nov 13, 2026
121 checks passed
@roboclaw-bot
roboclaw-bot deleted the r50-held-agent-db-startup branch November 13, 2026 07:00
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 14, 2026
…98145)

Scope historical ACP startup validation to configured physical database targets. Preserve held data and retain schema rejection for configured stores.

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

Labels

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. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant