Skip to content

feat(skills): add personal libraries for shared Gateways - #134068

Merged
steipete merged 16 commits into
mainfrom
steipete/team-server-custom-skills-3525ad
Sep 1, 2026
Merged

steipete merged 16 commits into
mainfrom
steipete/team-server-custom-skills-3525ad

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #133602.

Shared-Gateway teammates can now own complete reusable skill libraries without host access. Sessions pin immutable revisions, so later edits or sharing changes cannot silently replace a selected skill. This PR also updates fs-safe to exact 0.7.0 and repairs the filesystem, authoring, editor, and generated-client defects found during maintainer review.

Earlier authorization, node-worker, persistence and package evidence.

Merged as 75bcd267, from validated source head 93fbd9f4488f9c332b2d54f07580841a1b468da8. Cleanup removes 111 net production lines after the three-line passive-health repair. The final runtime build and both real Gateway/node-worker scenarios passed (2/2,226.97s); 49 health/inventory tests and 27 installer tests passed. Exact-head CI passed, including the Apple checks recovered through the existing same-run GitHub-hosted retry route. Detailed proof and limits. Outstanding post-merge follow-up: the newer review identifies monopolization of the global pending ZIP-upload pool by one profile; the recorded live proof does not cover this case, and no fix or policy acceptance is claimed. Earlier validation below retains its original commit identities. No changelog entry is included; release context remains below.

Behavior and ownership

Libraries belong to authenticated profiles. Explicit sharing grants discovery and use without edit access; administrator transfer preserves identity and authorship. Solo administrators keep the existing workspace workflow. The feature uses the existing Skills UI, CLI, Skill Workshop, and execution transports. Bundles preserve supporting text, binary bytes, and executable flags. Attach, detach, and refresh take effect at the next safe turn.

The persistence checkpoint accepted in #133602 covers four lazy additive STRICT tables and immutable filesystem bundle artifacts. Artifact publication completes before the synchronous authorization/CAS metadata commit. State/agent schema versions remain 15/19. There is no new configuration option or protocol-version bump. This remains one trusted Gateway domain, not hostile-tenant isolation.

Authoring uses the requester's host-validated live authority. Callable capabilities remain in private host grant state; requests retain the exact admission across body parsing, tool execution, and publication. New-session Workshop preparation happens before acknowledgment and stays under the session writer barrier. Cleanup follows the accepted allocation's placement owner even after cancellation. Each turn prepares its complete bundle once; two cross-turn delivery caches and duplicate bundle verification were removed.

The editor now preserves drafts when discard is declined or a save/import is busy. Its supporting-file selector, conflict recovery, narrow layouts, and private/read-only views have browser proof below. Preview fixtures use the canonical request handler, preventing concurrent sockets from sharing one response.

Repairs found during integration

  • Filesystem staging: fs-safe 0.7.0 deliberately does not claim a callback's partial file when the producer throws before admission. OpenClaw now creates an identity-owned temporary directory before the producer runs, then uses the canonical root move and unchanged sibling publisher. Existing destination bytes, modes, atomic replacement, and path checks remain intact. Physical replacement and lossless Windows identity-collision tests cover substituted directories. This compatibility repair adds 71 production lines; the narrower alternatives could not own cleanup before the producer returned.
  • Consumed media streams: a final-rename ENOENT previously replayed an exhausted stream and reported a successful zero-byte save. A failing-before regression reproduced this on the captured main owner. The stream owner now allows directory recreation only before iteration starts; buffers retain replayable recovery. Removing the single-caller wrapper keeps this repair production-neutral (+45/−45).
  • Swift client types: adding a skills session key exposed a structural-schema collision: approval-source dictionaries became SkillsStatusParams. Closed schemas now retain private nominal identity through TypeBox clones; Swift property naming checks identity and shape. Duplicate names remain ambiguous, existing union names remain intact, and the terminal catalog request explicitly aliases its locator. Regeneration changes exactly eight type lines across the four approval variants. All 857 serialized protocol schemas are byte-identical before and after this repair. A real dictionary initializer failed to compile before the fix and compiles and round-trips afterward.
  • Current main: the four i18n conflicts use main's canonical catalog loader with the existing lazy Skills catalog registered once. Its three callers match main. Main's Gateway error, cron preview, Talk-target, package-export, Web Awesome, and test-lifecycle changes are retained. Claude CLI docs now accurately distinguish prompt-catalog/pinned-path delivery for library selections from native-plugin delivery for other sessions.

Earlier validation (retained evidence)

Runtime validation commit: 7aba28a22dacdeaf073452761b03fcd9c6cad8a8, integrated with immutable main 6a11089d4b0ed7df871650b806f71d96ad25908c. The complete runtime CI run 33523707270 passed. The documentation-only publication head must also satisfy the normal native hosted gates before merge.

Surface Observed evidence
Persistence Candidate → separately built pre-feature main → candidate passed again on final head 7aba28a22dacdeaf073452761b03fcd9c6cad8a8: read-only open, older preference write/read, session-label edit, reopen, exact records, old pins, complete bytes, and executable modes. Two entries, four revisions, seven events, one upload, and two pins survived.
Browser Nine scenarios across the library editor and chat-selection files passed against the bundled UI on integrated tree 81ad66a7; later changes do not touch UI source. Covers dirty/busy dismissal, ZIP/support-file import, sharing, session selections, and 375px layouts.
Schema contracts Nine tests passed on tree 48fe0f5c for nominal clone identity, unchanged JSON schema, and session catalog validation. Swift dictionary initializer compile and runtime round-trip passed; permanent coverage exercises all four terminal approval variants. The focused SwiftPM package used the exact protocol target sources: the old generated types failed compilation; the corrected types passed all 15 compatibility tests, including four approval variants.
Gateway/library boundaries All 28 cases passed across the four boundary files: 15 service cases on tree e77c004c, then three separate-process persistence cases and ten Gateway/node cases on tree e6e82d72. The SIGKILL test first exceeded its unchanged 120-second deadline during concurrent compiler work; its isolated rerun passed in 51 seconds. No assertion or timeout changed.
Filesystem owners 691 tests across 18 files passed on b348a684 (one platform-specific skip): snapshots, filesystem guards, media, CLI output, browser downloads, WhatsApp identity, and Google Meet exports. Its hosted CI completed successfully.
Final checks/build Normal pnpm build passed on 7aba28a2, including CLI bootstrap, 64 plugin builds, 53 built control-plane module checks, and UI asset validation. Startup JS is 345,224 bytes gzip against the unchanged 349,244-byte limit. All configured check stages are covered by the retained full run, corrected-file lint, and remaining canonical commands: type, dead-code, boundary, storage, import, and pairing guards pass; 1,035 macOS tooling tests pass; pinned SwiftLint 0.65.0 reports no violations. The initially failed full invocation is retained as a failure, not relabeled green.
Final real node worker One full scenario passed on exact 7aba28a2: allowed shared-session pin versus denied private/unpinned access; actual helper execution from node-owned materialization; authenticated Bob create/read/update; owner denial, mid-turn refresh, removal, cancellation, replacement and reclaim. All 36,201 tracked sources, dependency metadata and build fingerprints unchanged; all 79 observed children stopped.
Final live Gateway/CLI Passed all 17 public CLI operations against the actual built 7aba28a2 Gateway with two authenticated synthetic profiles. The physical 209-byte ../SKILL.md ZIP is rejected before publication; foreign append/commit/read requests are denied; the valid 979-byte bundle preserves exact text, binary bytes and executable flags; commit replay is idempotent. Gateway shutdown, all CLI joins, source identity and build fingerprints verified.

The initial integration check passed all type, dead-code, runtime, package, and boundary checks, then failed on one missing pair of braces in a worker fixture. That lint error is corrected. A subsequent unused-export finding was fixed by deleting the runtime getter; all three canonical dead-code scans now pass without exclusions. The final full run passed its type and structural stages, then found two new-schema lint issues (symbol description and JSON-test syntax); those are corrected and the affected lint plus the remaining selected stages are recorded separately. Fresh complete P0-scoped Codex autoreview of final tree 48fe0f5c returned no findings in three complete chunks; this is scoped review, not an all-priority correctness certificate. The first filesystem CI run exposed 28 failures across eight jobs, repaired before the green run above. The superseded Linux gate was cancelled, not counted as a pass; its lease and sync checkout were closed.

Dependency and installed-package proof

The actual physical ../SKILL.md ZIP was accepted and normalized by fs-safe 0.5.6; 0.7.0 rejects it with ArchiveSecurityError before extraction. No filesystem escape was observed. Permanent shared-facade cases and real authenticated Gateway rejection proof cover this change. ClawHub fixtures now exercise valid physical ZIP records with an understated entry count; the canonical preflight owns that limit, removing eight duplicate production lines.

Runtime and compiled-test builds preserve fs-safe's package boundary so nested pnpm installs resolve the matching optional binary. Removed the native-copy helper and loader rewrite; sealed portable workers explicitly use guarded JavaScript. No native-mode override, dependency patch, or manual dependency-directory edit was used for proof. This incorporates #132240's platform-package integration.

Clean Linux Node 24.19.0 installs passed for npm global, pinned pnpm 12.1 global, Bun 1.4 global, and a fresh local npm project with --omit=optional. All four used the same canonical 21e77e0d tarball (SHA-256 14946abe54c45eeda99e32a0081db08704f9cad242ef6a2a1d61c83a85f4eb7a). All 28 commands passed: installed SDK write/create/hash and actual CLI version/help; default native mode off; explicit native mode loaded the exact GNU 0.7.0 package in all three managers; omission installed and loaded zero native binaries. The owned Testbox run completed and was stopped. This is Linux package proof at that stated source, supplemented by the integrated build and final hosted CI.

The first verifier incorrectly assumed Bun installed only one libc variant and npm applied --omit=optional to global trees. Direct Bun source and npm source established the actual contracts. The corrected proof checks the loaded binary and uses a fresh local npm project for absence. Failed receipts remain retained. The eight exact-version release-age exclusions are removable after September 7, 2026 at 16:29:50 UTC.

Live execution and persistence limits

Earlier actual Claude Code 2.1.236 / Agent SDK 0.3.241 proof completed fresh-chat and warm-second-turn create/read/update through host MCP in the same native session and process: eight Messages requests, six MCP calls, independent CLI byte/revision checks, and Bob's private-read denials. Fresh chat and first-Goal authoring also passed through the public CLI with two authenticated synthetic profiles. Supporting files included binary bytes and executable metadata. These use synthetic provider decisions, not live model billing/auth or cloud-provisioning claims. Separate real Gateway/node WebSocket suites passed on macOS and Linux. All owned proof processes were closed.

The refreshed persistence baseline is genuine feature-absent main 6a11089d, built with its own frozen dependencies, matching SQLite worker and SQL assets. All 7,260 source/SQL/lock digests were independently checked against Git. This proves source-runtime compatibility, not packaged stable-release downgrade compatibility. The older intermediate 5835fbea reader rejects session_pending_inputs.consumed_event_id, added by main in #133457; main explicitly documents that limitation in docs/reference/database-schemas.md. The same failure occurs using only old validation and main SQL without library changes. Its failed receipts remain retained; this PR does not change that schema or weaken validation. Separate-process restart and actual SIGKILL-before-pointer-commit recovery proof also remains recorded.

The original independent source-blind run classified all 54 subchecks (45 pass, three fail, five blocked, one out of scope). The two editor failures were fixed and 19 affected/nearby follow-up checks passed; fs-safe 0.7.0 resolves the raw-ZIP rejection gap. No separate zero-profile/merged-profile UI fixture, public expired-authoring-handle probe, ambiguous ordinary-agent scenario, or host-wide ClawHub side-effect audit is claimed.

The latest ClawSweeper review found no remaining source defect and requested inspectable allowed/denied authority, worker-delivery, persistence and published-package evidence. The linked final-head trace addresses those requests and both rank-up moves, with exact source boundaries and limitations. The maintainer's explicit instructions and #133602's persistence checkpoint cover feature and dependency scope. The earlier Claude delivery documentation finding is also fixed. Exact-head hosted checks and the native landing workflow remain mandatory.

Direct dependency inspection includes pinned Codex 0.151.0 skill selection, dynamic-tool argument/result/cancellation handling, published Claude SDK process/MCP contracts, fs-safe's published implementation, and TypeBox's clone behavior. Existing host seams remain authoritative.

Before and after

These are inspected synthetic-only captures from isolated real-Gateway flows. “Before” shows the pre-repair feature candidate. No assets are committed, and existing attachments are retained.

Before: Escape closes the editor after discard is declined

After: declining discard preserves the editor and exact draft

Shared skill: Bob can read the complete bundle but cannot edit

Shared skill reader at 375px

attachment-1304308149.mp4

Before editor repair: discarded conflict leaked into a blank importer

After editor repair: fresh importer has empty inputs and no stale conflict

Before editor repair: mobile File selector disagreed with the supporting-file editor

After editor repair: mobile selector and supporting-file editor agree

Shared personal skill: Bob can read the exact revision but cannot edit

Earlier scope accounting and follow-ups

Against integrated main, production is +8,012/−460 (net +7,552; excluding 50 moved lines each way gives +7,962/−410). Tests are +6,096/−722; test support +2,084/−10; tooling/manifests +65/−70; generated output +418/−1; lockfile +81/−7. Growth implements the approved ownership/storage boundary, UI/CLI, complete resource delivery, and live host-bound authoring. The generator repair adds nominal identity without changing wire schemas; test support, generated files, lockfiles, and tooling are counted separately.

Named follow-ups: preserve modified tracked lockfiles in checksum-based Testbox sync; personal pending drafts for /learn; convert fractional mediaMaxMb to whole bytes at its existing owner; replace the accurate RPC-name hint in publication receipts with the session-menu action. These are separate from the repaired invariants above.

Workshop reads return a requested whole UTF-8 artifact capped at 16,000 characters plus at most 32 supporting filenames. Binary/oversized content gives an explicit UI/CLI route. This bounded allowance serves requested guidance, not automatic prompt injection.

Docs: skills, authoring, Workshop, CLI.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime cli CLI command changes scripts Repository scripts agents Agent runtime and tooling extensions: codex size: XL maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete steipete self-assigned this Sep 1, 2026
@steipete
steipete force-pushed the steipete/team-server-custom-skills-3525ad branch from 69fef28 to 4f97aac Compare September 1, 2026 06:58
@steipete
steipete force-pushed the steipete/team-server-custom-skills-3525ad branch from 4f97aac to 1f8f162 Compare September 1, 2026 08:01
@steipete
steipete marked this pull request as ready for review September 1, 2026 08:02
@steipete
steipete requested a review from a team as a code owner September 1, 2026 08:02
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review the refreshed personal skill-library candidate at 1f8f1620d49f0aa26e36f4bfb44d36fdd5937d7c. The PR body records the main integration, lazy UI catalog fix, fresh Goal and native Claude warm-session proof, changed checks, and before/after screenshots.

ZIP import validation remains a known merge blocker pending the canonical fs-safe 0.6.0 integration and explicit dependency-cooldown exception. This requests review only.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 1, 2026, 4:06 PM ET / 20:06 UTC.

ClawSweeper review

What this changes

The PR adds authenticated, profile-owned skill libraries with immutable revisions, session selection, ZIP and ClawHub imports, and delivery to agents and workers.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 6 items remain

Keep open: the ZIP-import admission path lets one authorized profile exhaust all pending upload slots and deny imports to other authorized profiles.

Priority: P2
Reviewed head: 93fbd9f4488f9c332b2d54f07580841a1b468da8

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR has substantial feature-flow evidence, but the introduced resource-isolation defect prevents a higher rating.
Proof confidence 🐚 platinum hermit (4/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Gateway and worker evidence supports the primary feature flow, but it does not prove that the nearest competing authorized profile can still reach upload admission after another profile exhausts pending slots. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Gateway and worker evidence supports the primary feature flow, but it does not prove that the nearest competing authorized profile can still reach upload admission after another profile exhausts pending slots. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Introduced global import quota: The ZIP begin path counts every unfinished upload without filtering by the authenticated profile, then creates an upload owned by that profile; 32 pending begins by one writer therefore reject another writer before it can start.
Cross-profile callers are authorized separately: All new upload operations are Gateway methods requiring operator.write, so multiple independently authenticated profiles can reach the unscoped quota.
Request reserves capacity before archive transfer: The begin schema accepts only a slug, byte count, and hash; the implementation reserves the row for one hour before any archive bytes are required.
Findings 1 actionable finding [P1] Reserve ZIP upload capacity per profile
Security Needs attention Cross-profile ZIP upload starvation: The global pending-upload query has no owner profile condition, allowing one operator.write principal to exhaust all reservations before any archive data is uploaded.

How this fits together

Skill libraries are created or imported through authenticated Gateway and CLI entry points, stored as immutable revisions, then selected into sessions and materialized for agents or workers. ZIP imports first reserve a temporary upload row before publishing a library revision.

flowchart LR
  A[Authenticated operator] --> B[Gateway or CLI]
  B --> C[Skill library service]
  C --> D[ZIP upload reservation]
  D --> E[Immutable library revision]
  E --> F[Session selection]
  F --> G[Agent and worker resources]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Gateway and worker evidence supports the primary feature flow, but it does not prove that the nearest competing authorized profile can still reach upload admission after another profile exhausts pending slots. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Reserve ZIP upload capacity per profile (P1) - begin counts all unfinished rows before inserting owner_profile_id, so one operator.write profile can leave 32 uploads pending and make every other profile’s ZIP import fail for an hour. Scope admission to the authenticated profile or reserve capacity for other profiles, and add a two-profile regression.
  • Resolve security concern: Cross-profile ZIP upload starvation - The global pending-upload query has no owner profile condition, allowing one operator.write principal to exhaust all reservations before any archive data is uploaded.
  • Resolve merge risk (P1) - A single operator.write profile can reserve every one-hour ZIP-import slot, denying imports to other authorized profiles.
  • Resolve merge risk (P1) - The PR has 281 changed files; this review found one concrete defect but does not establish whole-branch correctness, and exact-head hosted CI remains incomplete.
  • Resolve merge risk (P1) - The declared @openclaw/fs-safe 0.7.0 package source was absent locally and network resolution failed, so its archive-extraction contract was not independently verified.

Findings

  • [P1] Reserve ZIP upload capacity per profile — src/skills/library/import.ts:111-120
  • [medium] Cross-profile ZIP upload starvation — src/skills/library/import.ts:111
Agent review details

Security

Needs attention: The introduced shared upload quota allows a permitted profile to deny another permitted profile’s import capacity.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test delta production/tooling +7,962/-516; test/support +8,395/-756; docs +302/-34; generated +418/-1; lockfile +81/-7 The supplied 281-file accounting reflects substantial feature growth, so the shared auth, persistence, and resource-limit boundaries need focused maintainer scrutiny.

Stored data model

Persistent data-model change detected: durable storage schema: packages/gateway-protocol/src/schema/worker-skill-workshop.ts, serialized state: ui/src/pages/chat/chat-commands.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/skill-library.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/worker-skill-workshop.ts, unknown-data-model-change: ui/src/pages/chat/chat-commands.ts, unknown-truncated-pull-files, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Reserve active import capacity per profile (recommended)
    Keep the global resource bound but cap or reserve pending ZIP uploads per authenticated profile, then prove another profile can begin an import after one profile reaches its quota.
  2. Accept the shared-capacity tradeoff
    Land the global quota only if maintainers intentionally treat every operator.write profile as entitled to deny import capacity to the others for up to one hour.
  3. Pause the ZIP-import surface
    Defer the upload feature if a fair capacity policy cannot be agreed without broadening the product’s tenant or resource model.

Technical review

Best possible solution:

Keep a bounded global import limit only with per-profile admission or reserved capacity, and add a two-profile regression proving one profile cannot deny another a begin request.

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

Yes: use two operator.write profiles, leave 32 valid begin requests pending from the first, then issue begin from the second; the unscoped query deterministically rejects it for up to one hour.

Is this the best way to solve the issue?

No: the feature’s per-profile authorization model is undermined by a shared unpartitioned reservation quota; per-profile capacity protection at upload admission is the owner-level repair.

Full review comments:

  • [P1] Reserve ZIP upload capacity per profile — src/skills/library/import.ts:111-120
    begin counts all unfinished rows before inserting owner_profile_id, so one operator.write profile can leave 32 uploads pending and make every other profile’s ZIP import fail for an hour. Scope admission to the authenticated profile or reserve capacity for other profiles, and add a two-profile regression.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.93

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b49119b44f41.

Labels

Label changes:

  • add merge-risk: 🚨 availability: Exhausting the global pending-upload quota rejects every other ZIP import until an entry expires or completes.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Gateway and worker evidence supports the primary feature flow, but it does not prove that the nearest competing authorized profile can still reach upload admission after another profile exhausts pending slots. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove merge-risk: 🚨 compatibility: Current PR review merge-risk labels are merge-risk: 🚨 security-boundary, merge-risk: 🚨 availability.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a substantial unshipped feature with a bounded but real multi-profile import failure.
  • merge-risk: 🚨 security-boundary: An authorized profile can consume a shared admission quota and interfere with other authorized profiles despite per-profile ownership checks.
  • merge-risk: 🚨 availability: Exhausting the global pending-upload quota rejects every other ZIP import until an entry expires or completes.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the supplied Gateway and worker evidence supports the primary feature flow, but it does not prove that the nearest competing authorized profile can still reach upload admission after another profile exhausts pending slots. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Cross-profile ZIP upload starvation — src/skills/library/import.ts:111
    The global pending-upload query has no owner profile condition, allowing one operator.write principal to exhaust all reservations before any archive data is uploaded.
    Confidence: 0.96

Acceptance criteria:

  • [P1] Run the focused skill-library service/import suite containing the new two-profile quota regression.
  • [P1] Run the repository changed-file checks for the touched library and Gateway paths.
  • [P1] Demonstrate an authenticated profile A exhausting its allowed pending imports while profile B can still begin one.

What I checked:

  • Introduced global import quota: The ZIP begin path counts every unfinished upload without filtering by the authenticated profile, then creates an upload owned by that profile; 32 pending begins by one writer therefore reject another writer before it can start. (src/skills/library/import.ts:111, 93fbd9f4488f)
  • Cross-profile callers are authorized separately: All new upload operations are Gateway methods requiring operator.write, so multiple independently authenticated profiles can reach the unscoped quota. (src/gateway/methods/core-descriptors.ts:200, 93fbd9f4488f)
  • Request reserves capacity before archive transfer: The begin schema accepts only a slug, byte count, and hash; the implementation reserves the row for one hour before any archive bytes are required. (packages/gateway-protocol/src/schema/skill-library.ts:82, 93fbd9f4488f)
  • Existing test misses inter-profile capacity: The active-upload test fills all 32 slots as Alice and asserts Alice is rejected; it does not prove Bob can still begin an import. (src/skills/library/service.test.ts:511, 93fbd9f4488f)
  • Introduction provenance: The implicated file was added in this commit; comparison with its recorded parent shows the quota hunk was introduced there, and it remains unchanged at the review head. (src/skills/library/import.ts:111, 343b128e19a8)
  • Current-main check: Current main has neither the skill-library implementation directory nor its Gateway methods, so the feature is neither implemented nor released from this branch. (src/skills/library/import.ts:92, b49119b44f41)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a two-profile Gateway or service regression showing quota exhaustion by one profile does not reject another profile before I/O.

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 (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-01T10:39:42.611Z sha 21e77e0 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T11:22:06.173Z sha ceb94a1 :: found issues before merge. :: [P3] Clarify Claude CLI delivery for library selections
  • reviewed 2026-09-01T12:51:45.392Z sha 2cdcf1b :: found issues before merge. :: [P1] Preserve generic approval source in Swift generation
  • reviewed 2026-09-01T13:16:23.734Z sha 2cdcf1b :: needs real behavior proof before merge. :: [P1] Keep approval source generic in generated Swift
  • reviewed 2026-09-01T15:15:46.863Z sha 7aba28a :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-01T15:41:26.035Z sha 7aba28a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T16:05:40.113Z sha ad0aba2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T17:47:32.697Z sha c98e0a6 :: needs maintainer review before merge. :: none

Use the published platform-package boundary and remove copied native assets.
Keep CLI bootstrap imports lazy, preserve sealed-worker defaults, and align
archive fixtures and current-main contracts with the stricter dependency.
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated to the maintainer-requested fs-safe 0.7.0 and its platform packages. The original-name ZIP rejection now passes through the actual Gateway and CLI; valid complete bundles, profile isolation, and commit replay also pass. Full build, configured changed checks, focused tests, and P0-scoped review are green. The PR body records clean package-install proof and exact-head hosted CI as pending.

The latest review’s archive finding is addressed by the canonical dependency admission check, existing physical traversal tests with and without directory records, and the exact ../SKILL.md Gateway proof. The PR body also cites the maintainer agent’s direct pinned Codex source inspection for selection and dynamic-tool forwarding; the reviewer’s unavailable sibling checkout is not relied on as proof.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/onepassword/package.json
  • package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
## What Problem This Solves

Fixes: Web UI (`chat.send`) turns that stall before replying still end with "⚠️ This turn was interrupted because it stopped making progress. Please try again." instead of the automatic recovery that channel DMs get since openclaw#161069.

## User Impact

- When a Web UI turn stalls before replying, the user now gets the recovered answer instead of the retry notice. The stalled run ends as aborted, and the answer arrives as its own run in the same chat, the same way any queued Web UI follow-up arrives. If the recovery also stalls, the existing notice is sent once.
- The recovery keeps its normal tools, except that Skill Workshop can't write to the skill library during a recovery. It answers "send a fresh message" instead.
- Group-thread participant turns keep the notice. That is now the only exception, and it's stated in the docs.

## Why This Change Was Made

openclaw#161069 kept the notice for Web UI turns because the recovery run had no owner that would deliver its answer ([maintainer decision](openclaw#161069 (comment))). Provenance of that owner:

- openclaw#116649 binds every queued `chat.send` reply to its originating Gateway admission, so a late answer never goes out through a later same-session dispatcher.
- openclaw#129001 added `createSourceRetry`, which gives a front-requeued run of the same source a fresh owner, and the `pending` state: a source that never handed its request to the queue keeps its own terminal, so a finished run gets no duplicate or late reply.
- The recovery run inherited the stalled turn's still-`pending` owner, so its answer was dropped (`terminal-not-recorded`).

The fix:

- **The stalled turn hands its request to the recovery through the source's existing `createSourceRetry`.** A `pending` source that hands off is settled, so the original can never deliver once the retry exists, and the recovery owns the only delivery. The relaxed `pending` case is reachable only through the stall continuation, which runs after the stale watchdog aborted the source before any output. `createSourceRetry` has two callers:
  - the follow-up source retry in `followup-delivery.ts`, which only sees owners that already queued (`deliver`/`drop`);
  - the stall continuation.
- **The openclaw#161069 early return is narrowed.** Only a source that explicitly declares no owner (`drop`) keeps the notice.
- **Library authoring is not carried into the recovery.** Every authenticated Web UI human turn mints a library-authoring grant (`prepareGatewaySkillAuthoring`), and every run binds it at admission. By design (openclaw#134068) the grant refuses a replacement run, and the recovery is a new run, so it doesn't inherit the grant. Before this change the recovery failed with "Personal authoring cannot move to a replacement run" instead of answering.
  - Rule: a recovery run never inherits skill-library authoring. Whatever the original grant's target, the recovery gets an expired personal grant. The Workshop tool can't fall back to the workspace tool (`createSkillWorkshopTool`), and every call returns `AUTHORITY_EXPIRED` asking for a fresh message. All other tools stay available, and no access is widened.
  - Alternatives considered:
    - The existing per-run `conversationToolPolicy` replaces the configured group policy instead of adding to it, so using it as a deny list could widen access in group sessions.
    - Minting a fresh grant would relax openclaw#134068's replacement-run guard.

Hermes (sibling framework) returns its timeout result through each turn's own reply path on every surface. This PR follows that idea of one reply owner per source. Hermes has no auto-continuation to borrow.

### Group threads: left for a follow-up

Group-thread participant turns keep the notice. Participant reply options set `onQueuedFollowupReplyBatch: undefined` (openclaw#141411), which openclaw#116649's `in` check turns into a `drop` owner, so every queued participant reply is dropped. Omitting that key makes the recovery reach the group: in a qa-channel run the group got `STALLED-TURN-RECOVERED-OK` instead of the notice. The same run showed a second group message, arriving while the recovery ran, ending `skipped:reply-operation-active` with no reply. Participant reply options also clear `turnAdoptionLifecycle`, so a participant turn on a busy session never reaches queue policy (`allowGatewayQueueResolution` in `dispatch-from-config.lifecycle.ts`). Fixing that needs its own change to participant admission, so this PR doesn't enable group recovery.

## Bounded cost

- **Recovery runs at most once per stalled turn.** `continueStalledTurn` is armed only for direct turns and called once from the aborted-dispatch finisher. The recovery runs on the follow-up runner, which never arms it, so if the recovery also stalls the existing notice is sent and nothing else starts. Tested: "sends the Web UI notice, not a second recovery, when the recovery also stalls" (2 model turns total, empty queue).
- **One delivery per handed-off source.** After `createSourceRetry` from `pending`, the original owner is settled and refuses both delivery and further retries. Tested: "gives a pending source's only delivery to the retry it hands off to".
- **No recovery where its answer would be dropped.** Tested: "leaves the notice with a group-thread participant whose source declares no reply owner".
- **No wider tool access.** Tested: "never lets a personal/workspace-target recovery author skills while keeping its other tools". No tools are disabled.

## Evidence

- **Real Gateway `chat.send`.** A QA Gateway child, mock-openai with the stalled-turn fixture, `QA_DIAGNOSTIC_STUCK_SESSION_ABORT_MS=30000`, and an operator `GatewayClient` (TUI pattern) recording `chat` broadcasts:
  - Before (`80290b4`): `+56.4s state=error "⚠️ This turn was interrupted because it stopped making progress. Please try again."`, then `aborted`. 5 mock requests, none guided.
  - After: `+58.6s aborted` for the stalled run, then `+59.5s state=final` under the recovery's own run id with the recovered answer. 6 mock requests: 5 stalled, 1 guided success. The answer is persisted in `chat.history`.
  - An intermediate run without the authoring change: the recovery was delivered through the new owner but failed with the authoring error. That run is what found the issue.
- **Unit tests:**
  - The two Web UI tests in `agent-runner.stalled-turn.test.ts` fail on `main` (`continueStalledTurn` returned `false`) and pass now.
  - The owner, drop and authoring tests pass.
  - Wall times: `agent-runner.stalled-turn.test.ts` + `followup-delivery.test.ts`: 51 s (75 tests; plus `skill-workshop-tool.test.ts` 19 tests). `chat-send-late-followup.test.ts`: 2 s (6 tests).
- `node scripts/check-changed.mjs` passes (typecheck, lint, guards).
- **Head `c1bca05` (delivery path unchanged since):** the stalled run ends `aborted` at +59.1s, then `state=final` with the recovered answer under the recovery's run id at +60.1s. 6 mock requests, 1 guided. The answer is persisted in `chat.history`.

LOC vs `origin/main`: production +36/−6, tests +130/−5, docs +1/−1.

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

agents Agent runtime and tooling app: android App: android app: web-ui App: web-ui channel: whatsapp-web Channel integration: whatsapp-web cli CLI command changes dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: browser extensions: codex extensions: onepassword 1Password plugin fleet gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: file-transfer rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security Security documentation size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile-owned custom skills for shared Gateways, preserving solo defaults

1 participant