Repository navigation
feat(claws): add local packages through the gateway and preserve setup - #174959
Patrick-Erichsen wants to merge 7 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper autofix |
|
|
|
|
The required CI aggregate is currently blocked by the unchanged updater mock at The native failure classifier marks this pre-existing. Independently, the scheduled main run at The first-turn native setup regression passes locally with 53 gateway/workspace tests, and live final-stack proof confirms custom setup and memory injection. No unrelated updater change or baseline exception is included. ClawSweeper review remains queued; its router reports that autofix is retired. |
e9e3c58 to
e3caab2
Compare
|
Codex review: blocked before merge. What this changesAdds admin-authorized local Claw sources to Gateway Add and preserves first-run setup through rollback and workspace preparation. Example: An administrator adds the package at /srv/claws/research-bot with custom BOOTSTRAP.md instructions.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-directed PR adds a useful Gateway capability that current main lacks; no introduced code defect was identified. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway plan/apply RPCs resolve a Claw source, review its resources and permissions, and invoke the existing Add lifecycle to create ordinary agents, workspace files, and dependencies. flowchart TD
A[Admin RPC client] --> B[Gateway authority checks]
B --> C[Local or ClawHub source]
C --> D[Existing Add planning and consent]
D --> E[Native Add lifecycle]
E --> F[Agent configuration and workspace]
E --> G[Worker owned setup state]
Technical reviewBest possible solution: Extend the existing Gateway Add source boundary while retaining native consent, integrity checks, lease authority, rollback, and workspace setup ownership. Do we have a high-confidence way to reproduce the issue? Current-main schemas establish the missing local-source path, and source inspection explains premature custom-bootstrap completion; no target code was executed during this review. Is this the best way to solve the issue? The patch is a focused extension of existing owners, with no parallel installer, new persistent model, or unnecessary production machinery identified. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7058d9e0dff2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +166, Tests +279, Docs +17. Total +462 across 19 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 26, 2026, 11:10 PM ET / October 27, 2026, 03:10 UTC (Revision 3). |
|
The requested local-source authority proof is now published at For the compatibility request, I compared the actual Saved real before/after receipts also qualify the setup behavior: pre-fix The PR body now records this proof and its limits. Current-head CI is running; prior-head CI passed all selected lanes except the separately proven upstream mock-exports failure. The private-QA declaration budget failure is also inherited: a separate captured-main build produced the same 456 public declaration files byte-for-byte. No budget or authority checks were weakened. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Resolve conflicts with the publisher-name catalog, Claw drafts, workspace attestation hashes, and rollback effect leases on main. Co-authored-by: Patrick-Erichsen <[email protected]>
Gateway Add runs bootstrap setup-state writes through its plural state leases, but the worker requested generic admission, so lease admission refused every Claw that ships BOOTSTRAP.md. Pass the held lease identities to the worker and assert them inside the transaction, as worktree capacity does. Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Integrations cannot add a converted local Claw package through a running gateway: the gateway Add API only accepts ClawHub coordinates, while an offline writer cannot mutate live gateway state.
User Impact
An admin-authorized client can plan and add an absolute local package path on the gateway host. Installation uses the existing Claw checks, lifecycle, plugin consent, integrity validation, and rollback. Retrying an installation that rolled back before agent creation preserves its first-run instructions. Imported memory and skills no longer cause the first turn to discard custom setup instructions.
Why This Change Was Made
The source adapter feeds the existing Add owner:
Local planning and application require
operator.admin. Remote clients must transfer their package to the gateway host first. Rollback retires the existing workspace setup state along with a workspace it created and removed.Evidence
BOOTSTRAP.mdas an ordinary agent.BOOTSTRAP.md. After: the same actual-handler regression preserves the setup file.BOOTSTRAP.md; stock-template cleanup and explicit completion retain their existing behavior.e33e4d5ca2b: a fresh Stalk Bot installation completed a real agent turn with all 236 characters of custom setup instructions and 3,459 characters of memory injected without truncation. The setup file remains after the turn.Merge risk: reversible code change; affects the Claw Add source boundary and cleanup of newly created workspaces. Existing ClawHub behavior remains covered.
Prior-head CI blocker: the unchanged updater mock check also fails on scheduled main; the native classifier marks it pre-existing. That aggregate remains red; no exception or unrelated fix is included. The conflict-only stack restack onto
acd27635preserves all three core patches exactly; current-head CI must run separately.Additional private-QA full-build check: SDK declarations exceed the private testing budget. An isolated captured-main build produces the same 456 public-reachable declaration files byte-for-byte (5,440,829 bytes versus the 5,340,536-byte cap). No budget change or unrelated repair is included. Runtime/UI artifacts were generated; the full command is recorded as failed.
Compatibility evidence is scoped to the existing state contract and production boundaries. Compared directly with
v2026.10.4, setup state remains version 1,WorkspaceSetupStatefields are identical, and the completeworkspace_setup_stateSQL definition is byte-identical. The PR changes no persisted schema or config format. Existing completed state skips reconciliation; rollback cleanup only retires a newly created, uncommitted workspace. The 48 passing workspace cases plus 5 native Add cases cover retained completed timestamps/content, stock cleanup, concurrent completion, custom pending setup, and explicit completion. This is not a claim that a full product upgrade was executed.Paired saved runtime proof: before the setup fix (
5ffb1320fcc),bootstrapExists=falseandbootstrapInjected=false; after (e33e4d5ca2b),BOOTSTRAP.mdinjected 236/236 characters without truncation and remained present after the turn. The baseline predates the fix; it is not an exact current-merge-base replay.Main refresh (2026-10-27)
Merged current
main(cfccaef15a4) into this branch instead of rebasing, so the stacked #174960 keeps its history. Conflicts were resolved against main's publisher package names, Claw drafts, workspace attestation hashes, and rollback effect leases; the gateway validators were regenerated.Main's Gateway Add now holds plural state leases (#184784), but its bootstrap setup-state write still requested generic worker admission, so lease admission refused every Claw that ships
BOOTSTRAP.md("State lease worker ownership was refused").8d64690136bpasses the held lease identities to the worker and asserts them inside the transaction, as worktree capacity does. The existing local Add handler test fails on the unfixed code and passes with the fix; it now confirms the Gateway config-write application, which main's Add requires.Local proof on
ed5ea8ff143: 14 focused test files pass (Claw Add plan/apply/stateless/manifest, local handler, Gateway method scopes, workspace and bootstrap, agent creation, state-lease transactions; 2m17s wall with--maxWorkers=1);tsgo:core, core src test types, oxlint, oxfmt,protocol:check, andgateway:validators:checkpass. The real-Gateway e2e was not rerun locally; PR CI covers it.Upgrade compatibility after the refresh (ClawSweeper's data-model request): the PR's diff against
maintouches no persisted schema, migration, config, or Doctor file. Its only schema change is the Gateway wire protocol (Add request params and the plan-response manifest disclosure), which is not stored. Lease identities travel only in the in-process worker command. Theworkspace_setup_statetable andWorkspaceSetupStateshape belong tomainand this PR leaves them unchanged. Existing completed setup still skips reconciliation; a never-completed workspace with a customBOOTSTRAP.mdnow stays pending until setup completes, which is the intended fix.