Skip to content

feat(gateway): propagate approvals to ancestor sessions#103921

Merged
steipete merged 1 commit into
codex/durable-approval-registryfrom
codex/approval-ancestor-propagation
Jul 12, 2026
Merged

feat(gateway): propagate approvals to ancestor sessions#103921
steipete merged 1 commit into
codex/durable-approval-registryfrom
codex/approval-ancestor-propagation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sub-agent approvals currently exist only on their source runtime surfaces. Parent and orchestrator operators cannot opt into a sanitized lifecycle stream, and reconnecting clients have no authoritative pending replay.

Related to #103505. Stacked on #103912.

Why This Change Was Made

  • Add an opt-in session.approval projection for exact source and persisted ancestor audience keys.
  • Keep approval routing observational: no transcript rows, sessions.changed events, agent turns, or wakeups.
  • Filter every live event and replay row through the approval record's reviewer authorization.
  • Return a bounded, authoritative pending replay with filtered keyset scanning so hidden records cannot starve visible ones or distort truncated.
  • Reconcile durable expiry through the owning manager and publish one terminal tombstone.
  • Close the replay/live handoff gap by subscribing before the snapshot and restoring the exact prior subscription if replay setup fails.
  • Generate typed Swift session-approval models and status-specific terminal reason enums from the protocol source of truth.

User Impact

Control UI and native clients can subscribe one session stream and observe sanitized pending/terminal approval truth raised by that session or its descendants. A reconnect receives the current pending set, while first-answer-wins resolution and record-level reviewer binding remain enforced by the canonical approval service.

Evidence

  • Blacksmith Testbox full routed matrix: 48 executions, 736 tests passed: https://github.com/openclaw/openclaw/actions/runs/29118285046
  • Focused replay/protocol regression matrix: 20 tests passed across server-chat-state, sessions.messages.subscribe, session approval validators, and native protocol generation guards.
  • pnpm tsgo:core, pnpm tsgo:test:src, and pnpm tsgo:test:packages passed on Blacksmith Testbox.
  • Swift generated protocol models type-checked on the macOS validation host.
  • Swift generator output was byte-identical before and after regeneration on Blacksmith Testbox.
  • Fresh committed-tree autoreview: clean, 0.82 confidence.

No transcript or screenshots attached.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Jul 10, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 10:31 PM ET / July 12, 2026, 02:31 UTC.

Summary
Adds opt-in sanitized approval lifecycle events and authoritative pending replay for exact source and persisted ancestor session audiences, with Gateway wiring, protocol models, docs, and regression coverage.

PR surface: Source +635, Tests +1504, Docs +26, Generated 0, Other +141. Total +2306 across 32 files.

Reproducibility: not applicable. as a reported bug; the feature scenario is source-reproducible, and the exact-head lint failure is directly reproduced by CI.

Review metrics: 2 noteworthy metrics.

  • New Gateway contract: 1 subscribe option, 1 event, 1 replay payload. The additive protocol spans authorization, live lifecycle delivery, and authoritative reconnect state.
  • Changed-code lint: 5 errors in 4 files. The exact reviewed head currently fails the required lint gate on this slice.

Stored data model
Persistent data-model change detected: serialized state: packages/gateway-protocol/src/schema/sessions.ts, serialized state: packages/gateway-protocol/src/session-approval-validators.test.ts, serialized state: src/gateway/server-methods/sessions.messages-subscribe-approvals.test.ts, serialized state: src/gateway/server-methods/sessions.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/approvals.ts, unknown-data-model-change: packages/gateway-protocol/src/schema/protocol-schemas.ts, and 3 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #103505
Summary: This PR is the ancestor-session lifecycle projection candidate for the canonical durable approvals initiative and remains a distinct stacked increment.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix all five changed-code lint errors reported by exact-head CI.
  • Attach redacted live Gateway/client output proving descendant-to-ancestor delivery, reconnect replay, and unauthorized exclusion.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides extensive tests, type checks, generation checks, and CI/Testbox output, but no after-fix real Gateway/client run showing ancestor delivery and reconnect replay; add a redacted terminal or live-output transcript and update the PR body to trigger a fresh review.

Risk before merge

  • [P1] Ancestor projection and reconnect replacement can stale or mis-associate approval state if real clients do not reconcile the live and replay contracts as designed.
  • [P1] The feature exposes sanitized approval details across ancestor sessions; scope checks and persisted reviewer binding are security-critical despite no concrete defect found in this review.
  • [P1] The current head fails a required lint gate on five changed-code errors.

Maintainer options:

  1. Clear lint and prove the live flow (recommended)
    Repair the five changed-code lint errors and require a redacted authorized client transcript covering descendant delivery, reconnect replay, terminal reconciliation, and an unauthorized subscriber.
  2. Pause the stacked increment
    Keep the PR open without landing if the exact client reconciliation and authorization behavior cannot be demonstrated safely.

Next step before merge

  • [P1] The lint repair is mechanical, but the contributor must supply real behavior proof and the protected maintainer-labeled security/session boundary needs human review before landing.

Security
Cleared: No concrete security or supply-chain defect was found; approval delivery remains opt-in, scope-gated, exact-session targeted, and filtered by durable reviewer binding.

Review findings

  • [P3] Fix the changed-code lint errors — src/gateway/server-chat-state.ts:333
Review details

Best possible solution:

Keep one Gateway-owned durable approval record and opt-in ancestor projection, mechanically clear the changed-code lint errors, then demonstrate authorized descendant delivery, reconnect replacement, terminal reconciliation, and unauthorized exclusion on the exact head.

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

Not applicable as a reported bug; the feature scenario is source-reproducible, and the exact-head lint failure is directly reproduced by CI.

Is this the best way to solve the issue?

Yes architecturally: an opt-in Gateway projection over one durable approval record is the narrowest maintainable solution and avoids transcript mutation, cloned authority, and channel-owned state; the submitted head still needs lint repair and real behavior proof.

Full review comments:

  • [P3] Fix the changed-code lint errors — src/gateway/server-chat-state.ts:333
    The exact head fails the required lint job with five errors in four files, including this inconsistent-return error and four unnecessary mutable declarations or type arguments. This was also present at the prior reviewed SHA but was missed in that cycle; please clear all five reported errors before merge.
    Confidence: 1
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is correct
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. One authorized ancestor stream for durable child-agent approvals is a compelling orchestration capability that avoids model-visible transcript writes and duplicated approval authority.

Label justifications:

  • P2: This is an opt-in Gateway feature with meaningful session and security sensitivity but bounded rollout and extensive automated coverage.
  • merge-risk: 🚨 session-state: Incorrect live/replay reconciliation could stale or mis-associate pending approval state across source and ancestor sessions.
  • merge-risk: 🚨 security-boundary: The projection crosses session ancestry and must preserve scope checks plus durable per-record reviewer authorization.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. One authorized ancestor stream for durable child-agent approvals is a compelling orchestration capability that avoids model-visible transcript writes and duplicated approval authority.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides extensive tests, type checks, generation checks, and CI/Testbox output, but no after-fix real Gateway/client run showing ancestor delivery and reconnect replay; add a redacted terminal or live-output transcript and update the PR body to trigger a fresh review.
Evidence reviewed

PR surface:

Source +635, Tests +1504, Docs +26, Generated 0, Other +141. Total +2306 across 32 files.

View PR surface stats
Area Files Added Removed Net
Source 18 701 66 +635
Tests 9 1508 4 +1504
Docs 3 47 21 +26
Config 0 0 0 0
Generated 1 2 2 0
Other 1 162 21 +141
Total 32 2420 114 +2306

What I checked:

Likely related people:

  • steipete: Authored the durable approvals initiative, merged the current durable registry and cross-surface authorization foundation, and authored this ancestor projection slice. (role: feature owner; confidence: high; commits: 7a456e362d0b, 4eb1f5225c5f, 93ba8c4b0966; files: src/gateway/operator-approval-store.ts, src/gateway/operator-approval-authorization.ts, src/gateway/operator-approval-session-events.ts)
  • ramin-shirali: Authored the merged two-phase approval registration, wait-decision, timeout, and resolved-entry lifecycle that this durable projection extends. (role: introduced approval registration behavior; confidence: high; commits: 1af0edf7ff22; files: src/gateway/exec-approval-manager.ts, src/gateway/server-methods/exec-approval.ts)
  • gumadeiras: Authored the existing pending-approval replay path, making them relevant to reconnect and authoritative pending-state semantics. (role: introduced reconnect recovery behavior; confidence: high; commits: 6484b41eb9e4; files: ui/src/app/exec-approval.ts, src/gateway/server-methods/approval-shared.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (4 earlier review cycles)
  • reviewed 2026-07-10T20:14:30.331Z sha 0077d9e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-11T14:51:18.973Z sha be22413 :: needs real behavior proof before merge. :: [P2] Cover the new event in native protocol consumers | [P2] Refresh the native i18n inventory | [P3] Fix the changed-code lint failures
  • reviewed 2026-07-12T01:01:55.593Z sha 9e904ef :: needs real behavior proof before merge. :: [P2] Preserve source identity in pending replay
  • reviewed 2026-07-12T01:31:39.451Z sha 678f238 :: needs real behavior proof before merge. :: [P2] Preserve source identity in pending replay

@steipete
steipete force-pushed the codex/approval-native-clients branch from f73c56e to 2ed37ce Compare July 11, 2026 14:24
@steipete
steipete force-pushed the codex/approval-ancestor-propagation branch from 0077d9e to 1ec7715 Compare July 11, 2026 14:24
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Jul 11, 2026
@steipete
steipete force-pushed the codex/approval-native-clients branch from 2ed37ce to 77a798b Compare July 11, 2026 14:31
@steipete
steipete force-pushed the codex/approval-ancestor-propagation branch from 1ec7715 to 593e3ab Compare July 11, 2026 14:31
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready update: rebased through the reconciled stack; the slice went through four structured-review passes until clean.

Fixes since the last head: published sourceSessionKey now always carries the canonical audience stream key (the walk's seeded first entry) so parents can correlate events for any source alias; unscoped source aliases scope to the raising agent before store resolution (multi-agent audiences no longer route to the default agent); the lineage-failure fallback shares the same config canonicalization (agent scope, configured main-key aliases, global sentinel) with a pure-string last resort; the cross-file 64-cap invariant is commented and derived; the per-subscribe approval opt-in downgrade is documented in the protocol docs.

Validation: audience/events/manager suites green locally and on Testbox (tbx_01kx8r0r4g46agd58kdt2rqbfg); final slice review (Codex, vs the native-clients base): clean, no actionable findings.

@steipete
steipete force-pushed the codex/approval-native-clients branch from 77a798b to 7d82c13 Compare July 11, 2026 14:34
@steipete
steipete force-pushed the codex/approval-ancestor-propagation branch from 593e3ab to be22413 Compare July 11, 2026 14:34
@steipete
steipete marked this pull request as ready for review July 11, 2026 14:38
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. labels Jul 11, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 11, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 12, 2026
@steipete
steipete force-pushed the codex/approval-native-clients branch from 2a60619 to 6f0c386 Compare July 12, 2026 01:23
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
@steipete
steipete force-pushed the codex/approval-ancestor-propagation branch from 9e904ef to 678f238 Compare July 12, 2026 01:23
@steipete
steipete force-pushed the codex/approval-native-clients branch from 6f0c386 to 784a585 Compare July 12, 2026 02:08
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
@steipete
steipete force-pushed the codex/approval-ancestor-propagation branch from 678f238 to 72842e5 Compare July 12, 2026 02:08
@steipete
steipete force-pushed the codex/approval-native-clients branch from 784a585 to cbf294e Compare July 12, 2026 02:16
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
@steipete
steipete force-pushed the codex/approval-ancestor-propagation branch from 72842e5 to be74c25 Compare July 12, 2026 02:16
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
@steipete
steipete force-pushed the codex/approval-native-clients branch from cbf294e to 175b049 Compare July 12, 2026 02:18
@steipete
steipete force-pushed the codex/approval-ancestor-propagation branch from be74c25 to 93ba8c4 Compare July 12, 2026 02:18
@clawsweeper clawsweeper Bot added the feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. label Jul 12, 2026
Base automatically changed from codex/approval-native-clients to codex/durable-approval-registry July 12, 2026 02:35
@steipete
steipete merged commit 93ba8c4 into codex/durable-approval-registry Jul 12, 2026
90 of 92 checks passed
@steipete
steipete deleted the codex/approval-ancestor-propagation branch July 12, 2026 02:35
w3evolutions pushed a commit to W3EvolutionsLLC/openclaw that referenced this pull request Jul 12, 2026
Squash-rebased openclaw#103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
steipete added a commit that referenced this pull request Jul 12, 2026
… gates

Squash of the remaining stack (#103912 native clients, #103921 ancestor
propagation, #103932 fail-closed gates — merged into this branch) plus the
main-gate repairs (hermetic model discovery via the provider-runtime
boundary, usage-cost settle-budget contract assertion, control-ui raw-copy
baseline, docs map, native i18n inventory, session.approval protocol
coverage allowlist, plugin-sdk DTS budget for approval wire types, Android
createdAtMs capture for canonical approval readback).
steipete added a commit that referenced this pull request Jul 12, 2026
… gates

Squash of the remaining stack (#103912 native clients, #103921 ancestor
propagation, #103932 fail-closed gates — merged into this branch) plus the
main-gate repairs (hermetic model discovery via the provider-runtime
boundary, usage-cost settle-budget contract assertion, control-ui raw-copy
baseline, docs map, native i18n inventory, session.approval protocol
coverage allowlist, plugin-sdk DTS budget for approval wire types, Android
createdAtMs capture for canonical approval readback).
steipete added a commit that referenced this pull request Jul 12, 2026
… gates

Squash of the remaining stack (#103912 native clients, #103921 ancestor
propagation, #103932 fail-closed gates — merged into this branch) plus the
main-gate repairs (hermetic model discovery via the provider-runtime
boundary, usage-cost settle-budget contract assertion, control-ui raw-copy
baseline, docs map, native i18n inventory, session.approval protocol
coverage allowlist, plugin-sdk DTS budget for approval wire types, Android
createdAtMs capture for canonical approval readback).
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
(cherry picked from commit 8f23761)
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
(cherry picked from commit 8f23761)
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
(cherry picked from commit 8f23761)
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
(cherry picked from commit 8f23761)
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
(cherry picked from commit 8f23761)
steipete added a commit that referenced this pull request Jul 12, 2026
Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
(cherry picked from commit 8f23761)
steipete added a commit that referenced this pull request Jul 12, 2026
… gates (#104837)

* feat(gateway): propagate approvals to ancestor sessions with replay

Squash-rebased #103921 segment onto the native-clients tip on current main.
Session-scoped approval events publish sanitized pending/terminal
transitions to opted-in session audiences, with authoritative pending
replay on stream subscribe and durable-expiry reconciliation through the
owning manager. SessionApprovalEvent/Replay wire types export from the
approvals owner module; Swift models regenerated.

(cherry picked from commit 2d1dcf9747044710111d0c730fc46ba6013a165c)
(cherry picked from commit ccf88efd56b513d07599ffcee997bf0cddaf9adc)
(cherry picked from commit 8eb33f59f00ec9ee4625259b76bd7ae60d2cd480)
(cherry picked from commit c297cbc93c8401e9c79c20f242245a194f5dd236)
(cherry picked from commit 93d68f28601ff37d863da4db009504993a22533a)
(cherry picked from commit d285ccd8b2f212bb57e814107e7709c896e96b7d)
(cherry picked from commit 5c536982231402b1b58d1683794ea9948b32d077)
(cherry picked from commit 1646e5b6dc4dd20de54e10f110a5909be18d7d50)
(cherry picked from commit 35cf1b705b247fb282f4d56ffe74bd2fb238221f)
(cherry picked from commit 4f8ef36)
(cherry picked from commit 74fbdcc99d5fff062d67760a51dba4ee9e84479b)
(cherry picked from commit 222b285502681d2be14b1819798e9ee5555f431e)
(cherry picked from commit b9e744951f676b600e7c5322bfd04b0e99797c07)
(cherry picked from commit 9e904ef)
(cherry picked from commit 678f238)
(cherry picked from commit 72842e5)
(cherry picked from commit be74c25)
(cherry picked from commit 93ba8c4)
(cherry picked from commit 8f23761)

* feat(gateway): fail-closed plugin and tool approval gates

Squash-rebased #103932 segment onto the ancestor-propagation tip on
current main. Plugin node.invoke approvals claim a one-shot allow-once
decision before handing execution authority to the policy, so observation
or retry cannot replay a consumed approval; sibling tool gates bind
approval ids to their originating reviewer identity.

(cherry picked from commit 122df0d75281f572c012b6484ed5daf085d1d577)
(cherry picked from commit f23d8ac240a8dcf2a42c4daaae962263975a0ae8)
(cherry picked from commit 8632fb6436a224dac7a9a9ef0216884530de2c24)
(cherry picked from commit d9fe2dd5c53665e5732f5f3da5ed1907a686ade8)
(cherry picked from commit bb139f2c8aa36ddad70413e1ef79ff491a6f2ecd)
(cherry picked from commit 9b3e056b68ea515c7d4baef269289b6670570480)
(cherry picked from commit b11e66b59a7af1f3b08712de06864aed64d349e4)
(cherry picked from commit a12916ee592d03dfa35e86a2aaede4476a5d4e5d)
(cherry picked from commit d699de840fc8346892b9ae244fe3c3e8c4413032)
(cherry picked from commit 9b7e5a9)
(cherry picked from commit 4b507593f1b2f10b4496984c84a2803b853e5c5e)
(cherry picked from commit 56408a186733c4eeb5aa76bd5907cde7b0cd3d5b)
(cherry picked from commit a4051d6d8353d39d6fa0b5d69c36e06c3cd3e796)
(cherry picked from commit 7682980)
(cherry picked from commit a8b493f)
(cherry picked from commit aceb990)
(cherry picked from commit a29b0e7)
(cherry picked from commit 2e3be08)
(cherry picked from commit c9ae3d7)

* fix: main-gate repairs for the durable-approvals stack

- android: capture createdAtMs on the pending exec-approval write at
  registration; canonical readback after a refresh that already replaced
  the visible rows was dropping the approval instead of surfacing the
  still-pending reconciliation message (#104913 merged without this)
- android: generous CI timeout ceilings in GatewayExecApprovalRuntimeTest
- agents: hermetic model-discovery test via the plugins/provider-runtime
  boundary (lazy plugin-runtime resolution hangs vitest workers since #104770)
- cli: usage-cost settle-budget test asserts the budget bound on every call
  instead of pinning the poll count (fast hosts fit a second poll in 50ms)
- protocol coverage: allowlist session.approval for ios/android (native
  review rides exec.approval push/nudge delivery)
- docs map, native i18n inventory, plugin-sdk api baseline regenerated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

1 participant