Skip to content

fix(agents): preserve host authority across module reloads - #163725

Merged
vincentkoc merged 1 commit into
mainfrom
fix/host-authority-module-identity-20261003
Oct 2, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/host-authority-module-identity-20261003

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes trusted agent work being rejected with “operator run authority must be issued by the host” when its original authority crosses independently loaded runtime modules.

User Impact

Authorized agent turns and continuations can retain their existing authority across source, bundled, or reloaded module graphs. Scope limits, source revocation, cancellation, and release still apply. Copied or unissued objects remain rejected; no configuration change is required.

Why This Change Was Made

Use the existing process-local singleton owner for the weak issuer registry. Only provenance is shared; the original authority object and its lifetime checks remain authoritative.

Release note: prevent false host-authority rejection across independently loaded runtime modules.

Evidence

  • The real two-module regression fails on the unchanged base at the inherited-authority consumer: two valid-authority cases fail, while all three unissued/spread/JSON controls pass.
  • At e8fb6de6bcf4ceb6de9937d571209b211d149988, all five module-identity cases and the full 39-case spawn production-boundary suite pass, covering exact-object inheritance, narrowing, source/signal revocation, balanced retention, and the existing continuation boundary.
  • This head includes the separately landed cleanup prerequisite #163741. The former CI cleanup failure was reproduced with and without this authority change before that prerequisite.
  • New test file cost: 40 ms of assertions; 20.52 seconds for its cold Vitest phase. The combined two-file native command completed in 158.48 seconds. Exact-head hosted CI passed in 546 seconds from run creation to completion (run 37060583837); this is whole-workflow wall time, not marginal test cost.
  • Native changed checks passed: production types, all 27 test type graphs, dead-export scans, focused lint, and remaining source guards.
  • The full build passed, including declaration generation and Control UI budgets (7 minutes 36 seconds of active build time).
  • Fresh autoreview and independent exact-head source review found no actionable issues.

This is source-level regression proof; deployment and incident recovery are separate.

@vincentkoc vincentkoc self-assigned this Oct 2, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 2, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 2, 2026 19:05
@clawsweeper

clawsweeper Bot commented Oct 2, 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 P2 Normal backlog priority with limited blast radius. 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 Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 4:32 PM ET / 20:32 UTC (Revision 2).

ClawSweeper review

What this changes

Shares recognition of host-issued agent authority across independently loaded modules and adds regression coverage for inheritance, scope narrowing, revocation, and copied-object rejection.

Merge readiness

✅ Ready for maintainer review

The fix remains useful: current main and the latest release still use module-local issuer recognition. No actionable correctness or security defect was found in the introduced patch; the author is a repository member, so cleanup closure does not apply.

Priority: P2
Reviewed head: e8fb6de6bcf4ceb6de9937d571209b211d149988

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful boundary regressions and no actionable findings; reported validation was not rerun during this read-only review.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER author is exempt from ordinary contributor runtime proof. The captured evidence reports the real inherited-authority consumer exercised across two module instances, with revocation and forgery controls; it claims source regression coverage, not deployment proof. Inspection found no unresolved material authority violation requiring the scoped exception. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER author is exempt from ordinary contributor runtime proof. The captured evidence reports the real inherited-authority consumer exercised across two module instances, with revocation and forgery controls; it claims source regression coverage, not deployment proof. Inspection found no unresolved material authority violation requiring the scoped exception. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduced change: The merge-base-to-head patch changes only issuer-registry allocation and adds the module-identity regression. The verified test-merge result contains the same two-file change.
Still necessary on main: Fetched main retains a module-local WeakSet, so another loaded module instance cannot recognize the original issued object. Its authority construction and live checks otherwise match the reviewed behavior.
Latest release check: The v2026.9.7 source also allocates a module-local issuer WeakSet; the requested recognition fix is not present there.
Findings None None.
Security None None.

How this fits together

The Gateway captures an operator’s authority and carries it into agent runs and continuations. Host issuance establishes provenance, while the original authority’s live checks continue to control execution.

flowchart TD
 A[Authenticated operator] --> B[Host issues authority]
 B --> C[Shared weak issuer registry]
 B --> D[Original authority object]
 C --> E[Gateway inheritance check]
 D --> E
 E --> F[Scope and live authority checks]
 F --> G[Agent execution or rejection]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +5, Tests +122. Total +127 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 1 +5
Tests 1 122 0 +122
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 128 1 +127

Review metrics

None.

Technical review

Best possible solution:

Keep issuance recognition shared across module instances while preserving exact-object identity and the original source’s scope, revocation, and lifecycle checks.

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

Yes, from source: an authority issued by one loaded module is absent from another module’s local WeakSet and fails the inherited-authority consumer. The added regression exercises that boundary, but this review did not execute it.

Is this the best way to solve the issue?

Yes. Sharing weak issuance provenance repairs the recognition failure without replacing the original authority or duplicating its live authorization policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5e6982748add.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs false rejection of authorized agent work across module instances without changing configuration or execution policy.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER author is exempt from ordinary contributor runtime proof. The captured evidence reports the real inherited-authority consumer exercised across two module instances, with revocation and forgery controls; it claims source regression coverage, not deployment proof. Inspection found no unresolved material authority violation requiring the scoped exception. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head patch changes only issuer-registry allocation and adds the module-identity regression. The verified test-merge result contains the same two-file change. (src/agents/admitted-run-context.ts:66, e8fb6de6bcf4)
  • Still necessary on main: Fetched main retains a module-local WeakSet, so another loaded module instance cannot recognize the original issued object. Its authority construction and live checks otherwise match the reviewed behavior. (src/agents/admitted-run-context.ts:64, 5e6982748add)
  • Latest release check: The v2026.9.7 source also allocates a module-local issuer WeakSet; the requested recognition fix is not present there. (src/agents/admitted-run-context.ts:64, c074824a27c9)
  • Authority invariant inspection: Issuance remains exact-object membership. Authority objects remain frozen, abort and source failures remain latched, and Gateway inheritance validates provenance and current authority before narrowing scopes or retaining the source. In-process dispatch carries current-authority assertions into its commit guard; the patch does not change these checks. (src/gateway/operator-run-authority.ts:211, e8fb6de6bcf4)
  • Focused regression coverage: The complete added test uses two real module instances and the production inherited-authority consumer. Two cases cover source and abort revocation, narrowing, and balanced retention; three reject unissued, spread, and JSON objects before callbacks. The captured body reports baseline failure and five passing cases at this head; these were not executed during this read-only review. (src/gateway/operator-run-authority.module-identity.test.ts:38, e8fb6de6bcf4)
  • Prior ownership direction considered: fix: recognize verified team admins as channel owners #153508 deliberately removed process-wide authority/context bridges while adopting the canonical native SDK graph. Its commit replaced this shared issuer registry with a local WeakSet. The present patch restores only weak issuance provenance; Gateway context ownership and source-liveness checks remain with their existing owners. (src/agents/admitted-run-context.ts, c69b8b986867)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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-10-02T19:09:09.674Z sha bd1481bbd70ad87c27e496d931d052a1bf0b2bb4 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/host-authority-module-identity-20261003 branch from bd1481b to e8fb6de Compare October 2, 2026 20:26
@vincentkoc
vincentkoc merged commit ff1c395 into main Oct 2, 2026
132 of 133 checks passed
@vincentkoc
vincentkoc deleted the fix/host-authority-module-identity-20261003 branch October 2, 2026 20:37
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 2, 2026
* commit '79be075e5aa46be9e42dbd53ed6e30e81469210a': (33 commits)
  fix(ui): keep selected-text comment input readable while scrolling (#163772)
  test(memory): open corpus database explicitly
  fix: bound Doctor migration capture to plugin data (#163780)
  fix(ui): gate system information at the shared reader (#160982)
  chore(db): reclassify worker inventory sites with caller evidence (#163754)
  refactor(channels): deslop Slack and Matrix (#163740)
  fix(agents): reject empty sessions_search queries in the tool schema (#129120)
  perf(nodes): load only what a worker turn needs (#160442)
  test(cli): assert concise Gateway failure copy in CLI process tests (#163649)
  refactor(discord): deslop discord (#163728)
  fix(workboard): make Sessions boards work on multi-agent Gateways (#163761)
  test(gateway): add sustained heap retention diagnostics (#163764)
  test(ui): disambiguate session filter controls
  refactor(plugins): deslop imessage, mattermost, and voice-call (#163767)
  fix(qa): run Telegram plugin source in --source-gateway userbot runs (#163718)
  feat(macos): add a --no-activate launch flag for background automation (#163758)
  fix(agents): preserve host authority across module reloads (#163725)
  perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (#163690)
  fix: keep video widgets scrollable and preload initial frames (#163762)
  feat(memory): add a provider-neutral memory provider runtime (#162175)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 3, 2026
* commit '1fda703fb4d3630e4633461967b2a2186e8f15fd': (33 commits)
  fix(ui): keep selected-text comment input readable while scrolling (openclaw#163772)
  test(memory): open corpus database explicitly
  fix: bound Doctor migration capture to plugin data (openclaw#163780)
  fix(ui): gate system information at the shared reader (openclaw#160982)
  chore(db): reclassify worker inventory sites with caller evidence (openclaw#163754)
  refactor(channels): deslop Slack and Matrix (openclaw#163740)
  fix(agents): reject empty sessions_search queries in the tool schema (openclaw#129120)
  perf(nodes): load only what a worker turn needs (openclaw#160442)
  test(cli): assert concise Gateway failure copy in CLI process tests (openclaw#163649)
  refactor(discord): deslop discord (openclaw#163728)
  fix(workboard): make Sessions boards work on multi-agent Gateways (openclaw#163761)
  test(gateway): add sustained heap retention diagnostics (openclaw#163764)
  test(ui): disambiguate session filter controls
  refactor(plugins): deslop imessage, mattermost, and voice-call (openclaw#163767)
  fix(qa): run Telegram plugin source in --source-gateway userbot runs (openclaw#163718)
  feat(macos): add a --no-activate launch flag for background automation (openclaw#163758)
  fix(agents): preserve host authority across module reloads (openclaw#163725)
  perf(gateway): serve the listener before multi-gigabyte store validation and honor clean-close receipts at startup (openclaw#163690)
  fix: keep video widgets scrollable and preload initial frames (openclaw#163762)
  feat(memory): add a provider-neutral memory provider runtime (openclaw#162175)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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