Skip to content

fix(subagents): restore requester authority after Gateway restarts - #173873

Merged
steipete merged 6 commits into
mainfrom
steipete/perf-micro-subagent-restart-authority-20260919
Oct 16, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/perf-micro-subagent-restart-authority-20260919

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A Gateway restart could leave interrupted subagents with completion authority bound to the previous Gateway, producing operator source authority is no longer active instead of returning interrupted work to the requester. The registry owns child recovery; the main-session recovery exclusion is intentional.

Interrupted children now keep their clean interrupted result, and their requester can continue under a freshly validated operator grant with the original scope ceiling. The requester can inspect uncertain effects and decide whether to resume child history or assign replacement work. Children are not automatically relaunched.

Ownership and security

Gateway custody transfers through the registry's acknowledged replacement operation instead of rebinding the old runtime owner. Restoration uses the same policy owner as main-session recovery, which retains its exact reservation checks. Recovery validates the current profile, role, authentication policy, device/token identity, access grant, requester incarnation, registry owner, and Gateway. Stale callbacks remain invalid, and sibling batches must share their original admitted source and narrowed scopes. Completed follow-up tasks discard old source evidence when they acquire fresh caller custody.

Stored-shape change: one optional operatorRecoverySource in the existing registry payload/codec, captured once at admission and bounded to 65,536 bytes. It contains non-secret evidence, never executable authority or transport credentials. No new table, index, sidecar, backfill, or bulk rewrite.

Format 25 is necessary: the previous binary accepts the optional field but can ignore it during cold recovery and dispatch as system. The existing version guard therefore refuses older binaries instead of silently dropping the restriction. SQLite 24→25 publishes version metadata without reading or rewriting subagent payloads. PostgreSQL updates its version markers through the existing transactional migration owner with an unchanged catalog. Rollback requires a compatible binary or the verified pre-upgrade backup, through the normal update owner.

Missing, malformed, or revoked evidence preserves the interrupted result and refuses automatic dispatch; it never substitutes system authority. This also means source-less system-originated children do not automatically wake their requester: missing evidence cannot prove system authority. A fresh authorized turn can inspect the result and start new work; automatic adoption of that restricted old completion is not provided. The review suggestion to add a system fallback was declined under this approved contract.

An overload-only restoration deferral retries through the existing sweeper. Success or permanent refusal clears the runtime marker; later grant revocation never re-arms it. Requester retirement stays sticky across awaited restoration. No new timer, persisted state, or configuration.

Evidence

  • Original focused recovery proof: 129 passing tests across registry/restart (89), main operator restoration (33), and codec (7). The warm-restart regression fails on the original production code with the reported authority error and passes with the fix.
  • All nine cold-reload variants pass through production registration, SQLite reload, restoration, and the real requester-settle dispatcher. Coverage includes narrowed scopes, stale callbacks, missing/revoked grants, mismatched sibling sources, replaced requester incarnation, overload retry, and revocation/retirement before retry. Announcement delivery is intercepted; this does not run a live model or external delivery.
  • Seven SQLite schema-preflight tests pass, including retained-payload/catalog preservation and refusal of schema-24 targets. PostgreSQL generator tests: 19 passed. Exact SQL-writer guard: 99 passed. Required import-closure tests: 21 passed. Export-name guard and changed-file formatting/lint pass.
  • CI repair proof includes registry 103/103, persistence 22/22, resume 24/24, migration behavior 64/64, announcement retry 4/4, worker/publication/migration guards 14/14, voice-call migration 9/9, and selected Doctor/orphan/cold-recovery cases. These scoped results overlap earlier proof and are not an aggregate test count.
  • After conflict integration, all nine cold variants and both main descendant-notification cases passed. Canonical PostgreSQL regeneration and independent integration review passed.

PR CI owns broad validation. No Testbox/Crabbox leases were allocated. A subprocess-test wrapper began full-build preparation locally; it was stopped to respect host limits, and subprocess proof remains with PR CI. No production restart or live-state mutation was performed.

Measurement and size

Synthetic storage measurement on an isolated Linux rig: Node 26.8.1, 6,000 retained rows, two alternating pairs, sequential writes below 100 MB. Source JSON: 617 bytes; payload: +643 bytes/row. Serialization median: 5.92 → 10.93 µs/row. SQLite write median: 11.66 → 17.50 µs/row (+5.84 µs, +50.1%); ranges 11.60–11.71 versus 17.33–17.66 µs/row. Database: 7.99 → 14.15 MB. This is a correctness fix with measured storage overhead, not a performance optimization. The measurement uses the actual table/index schema, WAL/NORMAL, and checkpoint; it excludes codec normalization, worker IPC, and grant restoration. Remote scratch was removed.

Production delta: +353 lines (545 added, 192 removed; excluding tests/support/docs, including generated SQL). Test/support delta: +1,047 (1,295 added, 248 removed). Durable bounded evidence, fresh custody, and the downgrade fence require growth to preserve the approved security contract. The old resolver-rebinding path is removed; policy validation stays with one owner.

CI repairs and review

CI exposed a decoder import cycle and remaining schema-version consumers. Capture stays private to admission, the durable decoder remains independent of Gateway runtime policy, and migration previews/native ceilings/Doctor descriptions track format 25. The SQL guard permits only the exact reviewed content-version transition. PostgreSQL's state-port fixture now derives its expected version from the canonical constant.

A paired-node retention failure exposed stale prepared placement observations. The coordinator retries complete preparation once for typed stale-read failures, covering both initial-read and inventory-read invalidation. Retired, released, or indeterminate authority still refuses. A dispatch flag prevents retry after any invocation or partially applied pruning. Strict placement validation remains immediately before dispatch, including null-to-null transitions. All 32 coordinator cases and 12 placement-projection worker cases pass. This replaces the incomplete intermediate per-fact refresh repair. Streaming proof now waits for the first observed delta instead of assuming 20 ms timing, retaining ordering/terminal/persistence assertions.

Review: independent subagent review (autoreview route unavailable). No review configuration was changed. Reviews are clean after the completed-follow-up, failed-rebind, overload-retry, schema-fence, and retention corrections; the final five-file repair also has a clean independent review. Main was integrated only after GitHub reported a merge conflict; generated PostgreSQL output was regenerated to preserve main's agent-deletion migration.

CI attribution

Final-head CI run 38872939453 tests head 88b29015f147565490795ae492df0ce3c18ae33e through merge 984323177a142515126f13bf7db94be7ec4b0d98, whose main parent is 6ea0cbc94c7ce6f642c49b5c4633becd99a38122. Seven failed jobs are inherited; each reproduces on that exact unchanged main parent with serial single-file pnpm test <file> --maxWorkers=1 runs:

Failed job Exact-main reproduction
check-test-types session-binding.test.ts retains three undefined old import names; source is unchanged in the tested merge.
extensions-bundle-14 Same file: 41 pass, one missing fingerprint function ReferenceError.
extensions-bundle-6 attempt-startup-lifetime.test.ts: 2 pass, missing replacement binding; attempt-startup-retry.test.ts: 8 pass, missing recovered binding.
extensions-bundle-9 run-attempt-thread-cleanup.test.ts: 7 pass, eight matching incognito binding/cleanup failures.
extensions-bundle-33 registration-imports.test.ts: 2 pass, one forbidden import through provider-auth-aliases → current-plugin-metadata-snapshot → manifest-registry-installed.
extensions-bundle-30 bot-message-dispatch.progress-card.test.ts: 4 pass, the same five reasoning-delivery failures.
extensions-bundle-5 apply-deadline-real-transport.test.ts: the same 630000 ms versus 30000 ms deadline assertion.

The full app-server source tree is identical between the baseline and tested merge. The named import, migration, and Telegram production paths and all seven test files are also unchanged. No production edits were made for attribution; the clean lane checkout was restored afterward. The aggregate CI gate remains red downstream of these failures; this is an inherited-failure exception, not a claim of green CI. No CI rerun was requested to chase green.

Current-head paired-node lifecycle passes both cases, including reconnect retention after bundle loss; required-native same-session passes; Telegram model-button identity passes. PostgreSQL conformance, iOS screenshots, production types, lint, and security-fast pass. The latter two E2E failures on the previous head remain unexplained transient observations; passing replay is not claimed as a product fix. The native fixture now reports failed synthetic node RPC results and workspace.skills invocation IDs without changing assertions or retries.

Earlier CI also exposed unrelated debug-overlay lint, reasoning timer, directive-delivery, and database concurrent-opener failures. Those were independently attributed to their exact main parent and are green on this head. Database attribution required an identical temporary fixture barrier on main and head after ordinary main repetitions did not reproduce; the barrier preserved the production entry point and original two-winner assertion, and was removed byte-for-byte afterward. No database ownership repair is included. An earlier iOS runner lacked the requested watchOS runtime; current-head iOS proof passes.

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@steipete
steipete marked this pull request as ready for review October 16, 2026 06:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T08:25:18.904524Z 88b2901 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: XL labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e70dce05a9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Persist original operator source evidence and revalidate it before continuing a subagent’s requester after a Gateway restart.

Example: An operator with operator.write starts a child, then the Gateway restarts.

  • Before: Requester continuation fails with “operator source authority is no longer active.”
  • After: The requester continues under freshly validated operator.write authority while the child remains interrupted.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful owner-approved repair with meaningful integration coverage, but recovery regressions, incomplete migration consumers, and final-effect evidence gaps prevent readiness.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An interrupted operator-admitted child's result cannot wake its requester because completion custody still belongs to the previous Gateway.
Reason: Restoring accepted work under current policy has clear value, and the maintainer-authored PR establishes direction for the persisted evidence and downgrade fence.

Merge readiness

⛔ Blocked before merge - 10 items remain

Keep this PR open: it addresses a real restart-recovery defect, but introduced recovery regressions and incomplete migration cutover block merging.

Priority: P2
Reviewed head: e70dce05a99cbad318d522ae6904d2eaac03659d

Before merge

  • Add real behavior proof - Authority-chain proof required: the cold registry harness exercises persisted restoration and settlement but intercepts final announcement delivery; show an allowed restored requester reaching actual delivery or privileged I/O and rejection before that effect after grant revocation or requester replacement, with sensitive values redacted. Storage tests downgrade freshly created stores to v24; they do not establish a latest-stable upgrade with existing settings and data intact. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Preserve recovery for newly admitted channel and System work (P1) - Every unfinished non-collector entry is marked as requiring operator completion authority before checking its source. Legitimate channel authority created by captureChannelOperatorRunAuthority has no recoverySnapshot, and autonomous System work has no operator authority, so registration cannot persist operatorRecoverySource for these callers even after installing this patch. Their next restart permanently rejects completion with “Subagent completion authority is no longer active.” Preserve their actual admission boundary while continuing to refuse missing or invalid evidence for operator-owned work; do not solve this with an unrestricted fallback.
  • Retry restoration after transient preparation failures (P2) - A transient requester-worker read or profile/grant preparation failure reaches this catch after the row has already acquired the new Gateway resolver. No completion custody is installed, yet every subsequent binding pass skips the row because previous() is live. The requester therefore remains blocked even after the dependency recovers. Keep failed preparation retryable under the same current owner while preserving fail-closed handling for revoked or malformed sources.
  • Keep persisted-source decoding independent of Gateway runtime (P2) - The codec is imported by the shared-state database worker. This new runtime import reaches operator-role-policy and the Gateway protocol validator registry even when decoding an ordinary row without recovery evidence. The exact-head worker import test fails on that chain, violating the existing worker isolation contract. Extract the persisted-source schema and decoder into a lightweight module shared by capture and storage.
  • Add the new migration kind to the Voice Call consumer (P2) - The new kind is emitted for older Voice Call state databases, but extensions/voice-call/doctor-contract-api.ts has an exhaustive satisfies Record map without this key. That leaves the consumer type-incomplete and renders “Voice Call SQLite schema: undefined,” as exact-head CI confirms. Add the description through the existing consumer and update its schema-repair expectation.
  • Update existing migration inventories for schema 25 (P2) - Adding this migration changes the detector's result for existing publication-authority and restart-handoff fixtures. Their exact migration inventories still end at v24, so src/state/openclaw-state-db-publication-authority.test.ts and src/state/openclaw-state-db-restart-handoff-migration.test.ts fail in exact-head CI. Update those inventories to include the new metadata-only migration while retaining their row-preservation assertions.
  • Resolve security review attention item - No concrete authorization bypass was found, but restored authority lacks proof at the final effect boundary.
  • Resolve merge risk - Verify that restored custody rejects a revoked grant or replaced requester before actual delivery or privileged I/O; the supplied intercepted-delivery tests leave that authority boundary unproven.
  • Improve patch quality - Add final-effect proof that grant revocation or requester replacement invalidates restored custody before delivery or privileged I/O.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Preserve recovery for newly admitted channel and System work — src/agents/subagents/registry/subagent-registry-gateway-owner.ts:41-42
  • [P2] Retry restoration after transient preparation failures — src/agents/subagents/registry/subagent-registry-gateway-owner.ts:138-139
  • [P2] Keep persisted-source decoding independent of Gateway runtime — src/agents/subagents/registry/subagent-registry.store.codec.ts:3

Tests

  • Missing end-to-end proof: Missing final-effect coverage for allowed and revoked or replaced restored requesters, plus a latest-stable upgrade retaining existing settings and data; the warm regression's base failure is reported but was not rerun during this review.
Agent review details

How this fits together

The subagent registry persists child execution and completion state; Gateway recovery reloads those records, restores caller custody, and dispatches retained results to the requester.

flowchart TD
A[Admitted requester] --> B[Subagent registry]
B --> C[Shared state database]
C --> D[Gateway restart recovery]
D --> E[Current operator policy]
E --> F[Requester settlement]
F --> G[Delivery and tool effects]
Loading

Technical review

Best possible solution:

Restore caller-specific custody through the existing registry and policy owners while preserving legitimate channel recovery, retryability, worker isolation, and complete migration consumers.

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

Current main retains completion custody tied to the closed Gateway; the corrected warm-restart regression documents the exact authority error, and source inspection confirms the path without executing it.

Is this the best way to solve the issue?

Sharing operator restoration and replacing registry custody are appropriate, but applying operator-only evidence requirements to every restored caller breaks existing channel recovery.

Full review comments:

  • [P1] Preserve recovery for newly admitted channel and System work — src/agents/subagents/registry/subagent-registry-gateway-owner.ts:41-42
    Every unfinished non-collector entry is marked as requiring operator completion authority before checking its source. Legitimate channel authority created by captureChannelOperatorRunAuthority has no recoverySnapshot, and autonomous System work has no operator authority, so registration cannot persist operatorRecoverySource for these callers even after installing this patch. Their next restart permanently rejects completion with “Subagent completion authority is no longer active.” Preserve their actual admission boundary while continuing to refuse missing or invalid evidence for operator-owned work; do not solve this with an unrestricted fallback.
    Confidence: 0.97
  • [P2] Retry restoration after transient preparation failures — src/agents/subagents/registry/subagent-registry-gateway-owner.ts:138-139
    A transient requester-worker read or profile/grant preparation failure reaches this catch after the row has already acquired the new Gateway resolver. No completion custody is installed, yet every subsequent binding pass skips the row because previous() is live. The requester therefore remains blocked even after the dependency recovers. Keep failed preparation retryable under the same current owner while preserving fail-closed handling for revoked or malformed sources.
    Confidence: 0.99
  • [P2] Keep persisted-source decoding independent of Gateway runtime — src/agents/subagents/registry/subagent-registry.store.codec.ts:3
    The codec is imported by the shared-state database worker. This new runtime import reaches operator-role-policy and the Gateway protocol validator registry even when decoding an ordinary row without recovery evidence. The exact-head worker import test fails on that chain, violating the existing worker isolation contract. Extract the persisted-source schema and decoder into a lightweight module shared by capture and storage.
    Confidence: 1
  • [P2] Add the new migration kind to the Voice Call consumer — src/state/openclaw-state-db-schema-repair.ts:447-448
    The new kind is emitted for older Voice Call state databases, but extensions/voice-call/doctor-contract-api.ts has an exhaustive satisfies Record map without this key. That leaves the consumer type-incomplete and renders “Voice Call SQLite schema: undefined,” as exact-head CI confirms. Add the description through the existing consumer and update its schema-repair expectation.
    Confidence: 1
  • [P2] Update existing migration inventories for schema 25 — src/state/openclaw-state-db-schema-repair.ts:447-448
    Adding this migration changes the detector's result for existing publication-authority and restart-handoff fixtures. Their exact migration inventories still end at v24, so src/state/openclaw-state-db-publication-authority.test.ts and src/state/openclaw-state-db-restart-handoff-migration.test.ts fail in exact-head CI. Update those inventories to include the new metadata-only migration while retaining their row-preservation assertions.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Prove authorization at the final effect (recommended)
    Exercise an allowed restored requester through actual delivery or privileged I/O, then revoke its grant or replace its requester while work is awaited and show rejection before the effect.

Provenance checked

  • Registry completion custody keeps the original intent (e2e5b0b: Retain the original caller's completion restrictions after its spawning execution yields, without reviving revoked authority.)
  • Gateway owner replacement keeps the original intent (fcc6b90: Recover durable requester wakes through acknowledged replacement while preventing superseded transfer records from blocking unrelated recovery.)
  • Operator restart policy keeps the original intent (961f5c0: Re-admit the exact authenticated source under current identity, grant, device, role, and model restrictions rather than granting System callers operator privileges.)
  • Child restart policy keeps the original intent (18f1c11: Return interrupted child results to the parent, which decides remaining work; do not automatically relaunch children.)
  • Shared-state version admission changes intended behavior with a stated reason (a251bd1: Publish versioned state changes through existing bounded migration and backup owners while preserving retained rows.)

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete authorization bypass was found, but restored authority lacks proof at the final effect boundary.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: Raw commit 961f5c0 adds src/gateway/operator-run-recovery.ts:80 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 961f5c0b7099; files: src/gateway/operator-run-recovery.ts)

PR surface

Source +285, Tests +560, Docs +40, Config 0, Other +7. Total +892 across 29 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 15 377 92 +285
Tests 8 568 8 +560
Docs 4 41 1 +40
Config 1 1 1 0
Generated 0 0 0 0
Other 1 7 0 +7
Total 29 994 102 +892

Review metrics

Metric Value Why it matters
Production versus test growth Production +292 net lines; tests and support +560 net lines. Persistent source evidence and shared restoration explain the production growth; the added tests cover cold recovery, scope ceilings, stale sources, codec rejection, and migration preservation.

Labels

Label changes:

  • add P2: A useful repair for interrupted subagent workflows, with restart-specific impact.
  • add merge-risk: 🚨 compatibility: Schema 25 intentionally prevents older binaries from opening upgraded state; that tradeoff is accepted, while upgrade compatibility evidence remains incomplete.
  • add merge-risk: 🚨 session-state: The blanket operator-source requirement blocks legitimate restored channel work, and transient restoration failures strand requester continuation.
  • add merge-risk: 🚨 security-boundary: Persisted source evidence is converted into fresh execution authority, requiring final-effect proof for revoked grants and replaced requesters.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P2: A useful repair for interrupted subagent workflows, with restart-specific impact.
  • merge-risk: 🚨 compatibility: Schema 25 intentionally prevents older binaries from opening upgraded state; that tradeoff is accepted, while upgrade compatibility evidence remains incomplete.
  • merge-risk: 🚨 session-state: The blanket operator-source requirement blocks legitimate restored channel work, and transient restoration failures strand requester continuation.
  • merge-risk: 🚨 security-boundary: Persisted source evidence is converted into fresh execution authority, requiring final-effect proof for revoked grants and replaced requesters.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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 October 16, 2026, 2:17 AM ET / 06:17 UTC.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call commands Command implementations labels Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 88b29015f147565490795ae492df0ce3c18ae33e
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/operator-run-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/worker-environments/placement-turn-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfc606c061

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete
steipete force-pushed the steipete/perf-micro-subagent-restart-authority-20260919 branch from 0453c45 to 0b257cd Compare October 16, 2026 07:29
@steipete
steipete merged commit 37d210e into main Oct 16, 2026
264 of 275 checks passed
@steipete
steipete deleted the steipete/perf-micro-subagent-restart-authority-20260919 branch October 16, 2026 08:43
@steipete

Copy link
Copy Markdown
Contributor Author

Merged as 37d210e4aaf3811c27d5d7191027cf9f0da08425 under the approved inherited-failure exception, with exact PR head 88b29015f147565490795ae492df0ce3c18ae33e.

CI run 38872939453 completed: 162 passed, 17 skipped, seven failed root jobs and their aggregate. Each remaining root failure reproduces on the exact tested main parent 6ea0cbc94c7ce6f642c49b5c4633becd99a38122, with unchanged relevant source in CI merge 984323177a142515126f13bf7db94be7ec4b0d98:

  • Test types and extension bundle 14: stale import names in session-binding.test.ts; main reproduces the missing fingerprint function error (41 pass, one fail).
  • Extension bundle 6: startup lifetime/retry binding assertions; main reproduces both (2 and 8 passing cases, respectively).
  • Extension bundle 9: eight incognito binding/cleanup failures; main reproduces all eight, with seven passing cases.
  • Extension bundle 33: forbidden registration import chain; main reproduces the same boundary violation (two pass).
  • Extension bundle 30: five Telegram reasoning-delivery failures; main reproduces all five (four pass).
  • Extension bundle 5: migration discovery deadline 630000 ms versus 30000 ms; main reproduces the same assertion.

Baseline commands were serial single-file pnpm test <file> --maxWorkers=1. The PR body records the exact files and evidence. Security review, sensitive-change authority, security-fast, PostgreSQL, iOS, relevant E2E jobs, production types, and lint passed. Independent subagent review is clean (autoreview route unavailable). No failed CI is represented as green, and no CI rerun was requested to chase green.

The native merge command refused before dispatch because its PR review worktree was absent. The explicitly authorized exact-head API fallback merged successfully. No production deployment or restart was performed.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…penclaw#173873)

* fix(subagents): restore requester authority after Gateway restarts

* test(subagents): align restart fixtures with restored operator custody

* fix(subagents): retry overload-deferred authority restoration

* fix(gateway): preserve retention updates across placement changes

* fix(gateway): refresh retention facts before strict dispatch

* fix(gateway): retry stale retention preparation before dispatch
RomneyDa added a commit that referenced this pull request Oct 22, 2026
Same-conversation scheduled agent turns (at + agentTurn + session:<key>)
created from an authenticated operator turn now retain that operator
source privately and re-admit it under current policy at each occurrence.
Explicit one-shot session continuations may call next_check to rearm the
same job.

Release adaptations for 2026.10.6:
- Restore the occurrence-bound operator source in run.ts and pass it to
  run-executor.ts admission (run-prompt-executor.ts does not exist here).
- Extract restoreGatewayOperatorSource from restoreGatewayOperatorRecovery,
  matching only the operator-run-recovery.ts split from #173873.
- Reconcile the source in ops-mutations.ts add/upsert/update (release has
  no job-mutations worker); captureCronCreatorSession stays synchronous.
- Omit the github-publish-tool description change (no inspect/merge on
  this line); adapt cron-tool and docs wording to release text.
- Regression tests observe the restored Gateway operator selection and a
  guarded sessions continuation instead of GitHub inspect/merge; port
  createCronServiceWithStateForTest and the OpenAI Responses model fixture;
  adapt one-shot expectations to release startup staggering and A->B->A
  schedule-edit semantics.
- Regenerate prompt snapshots.

(cherry picked from commit d74a4ae)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: voice-call Channel integration: voice-call commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts security-sensitive-changed size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant