Repository navigation
fix(activity): stop recap calls after operator policy revocation - #184279
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 735ddb5345
ℹ️ 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".
|
Codex review: needs real behavior proof before merge. What this changesThis PR binds Activity recap generation to the session owner's operator model policy and observes committed policy revocation. Example: A session owner's role removes test/utility while recap preparation is pending.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep open: this maintainer-approved policy change has clear value, but merged-profile sessions introduce a concrete recap regression. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Gateway recap service consumes committed session ownership and transcript excerpts, invokes the utility completion owner, and persists a bounded recap. flowchart LR
A[Session ownership receipts] --> B[Gateway recap service]
C[Profile catalog and role policy] --> D[Operator authority]
B --> D
D --> E[Utility completion]
E --> F[Provider request]
E --> G[Persisted recap]
Technical reviewBest possible solution: Resolve historical profile IDs through the existing alias-aware catalog before binding canonical authority, while retaining ownership and revocation checks. Do we have a high-confidence way to reproduce the issue? Current main explicitly permits service-owned recaps after operator revocation, and the PR reports a matching baseline replay; no reproduction was executed during this read-only review. Is this the best way to solve the issue? Reusing profile-backed operator authority and the existing utility completion boundary is appropriate, but historical profile aliases must resolve before canonical authority is captured. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 15915bf1367a. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +104, Tests +100, Docs +3. Total +207 across 9 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 26, 2026, 2:31 AM ET / 06:31 UTC. |
Bind recap utility calls to the committed session owner policy and retain live authority through preparation, fallback, completion, and cleanup. Preserve cached text and record denied work. Explicit service-owned recaps keep service authority. Release-note context: Activity recaps now stop making model calls when their owning operator is denied or revoked, including requested refreshes.
735ddb5 to
51475bc
Compare
Final built-Gateway revocation traceFinal candidate: Built This is an allowlisted export of the actual synthetic mock-provider arrival log and Gateway RPC acknowledgments. It contains every provider request from the ten final replay iterations; full prompts, transcript bodies, credentials, profile IDs, host details, addresses and private artifact paths are omitted. The identified operator role allowed both Final result: 10/10 iterations; 20 primary requests and 10 allowed Activity recaps. Zero provider requests from revoke invocation through acknowledgment, and zero after acknowledgment through the settled observation boundary. All ten allowed recaps persisted nonempty text. All ten revoked recap skips recorded the operator-policy error with no retry scheduled.
Complete provider request timelineAll timestamps are request arrival at the mock HTTP handler, before reading its body. No request is excluded by model, purpose, or arrival phase. The
Saved result and recorded denialA read-only query of the isolated synthetic session store after shutdown found nonempty recap text on all ten The Gateway recorded ten info-level {
"agentId": "main",
"error": "Your operator role cannot use this model. Choose an allowed model or ask a gateway administrator to update your role's model policy.",
"retryScheduled": false
}Final cleanup completed at For contrast, the initial current-main replay at |
|
The merged-profile finding is fixed on The complete provider-arrival trace shows all ten allowed recaps persisted and zero requests from revocation invocation through the post-ACK quiet windows. The PR body now contains the completed canonical eight-arm, ten-minute-per-arm load comparison, with matched recap counts, server-handler latency, host load, allocation, GC, sample counts, and maxima. No declared adverse threshold was met; mixed-sign metrics remain inconclusive. Landing under the standing inherited-CI exception: exact-head CI run 40281550861, attempt 1 fails only @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…nclaw#184279) * fix(activity): honor operator model policy for recaps Bind recap utility calls to the committed session owner policy and retain live authority through preparation, fallback, completion, and cleanup. Preserve cached text and record denied work. Explicit service-owned recaps keep service authority. Release-note context: Activity recaps now stop making model calls when their owning operator is denied or revoked, including requested refreshes. * fix(activity): resolve recap owners through profile aliases
What Problem This Solves
Activity recaps could call the utility provider after the session owner's operator model policy was revoked. The service-authority contract documented in #183897 deliberately allowed this; this change implements the approved decision to honor the owner's committed policy.
User Impact
Recaps follow the assigned human owner, otherwise the authenticated profile creator, independently of the viewer requesting a refresh. Assignment to an agent or the system preserves the creator's restriction. Historical owner aliases resolve to the current canonical profile after a profile merge. Denied or revoked work keeps the cached recap and records a reason.
Ordinary sessions without an assigned human owner or authenticated profile creator retain service authority. Cron, subagent, incognito, and isolated-heartbeat sessions remain excluded from recap generation.
Why This Change Was Made
The recap owner carries committed ownership facts, retains a profile-catalog lease, and binds the existing operator authority only when a model call is needed. It revalidates after awaited work and expires retained callbacks when work settles. Utility completion owns the final provider checks, retries, and fallbacks. The shared policy reader also observes committed config-publication revisions, including publication of the same config object, using the prepared model-policy cache from #183793.
Production delta: +110 lines; tests +116; docs +4, across nine files. The growth implements the newly required authority boundary. There is no new policy cache, schema, or configuration option. The old service-authority exemption is removed, and ownership selection reuses the canonical session helper.
Evidence
Complete sanitized provider trace: final head
51475bc5e62c70ebc0267795b4d0fb5dc025f241passed ten isolated built-Gateway revocation iterations. All 30 HTTP provider arrivals are listed: 20 primary turns + 10 allowed recaps, zero requests from revoke invocation through ACK, and zero after ACK. Each observation window included at least ten seconds of provider quiet. All ten allowed sessions saved nonempty recap text; ten denied recap attempts logged the policy error with no retry scheduled. No late or cross-iteration requests occurred, and teardown passed.The initial current-main baseline
d15362ab1797087b3dac04074a1ad38919f45a70made 40 requests, including seven revoked recap calls between config write and ACK and three after ACK. Its recap owner is byte-identical to the final comparison baseline99501d269444e6b7be7789bc1cd91a67833103ff.The two regression cases exercise real session/profile writers and utility policy admission: merged owner aliases still allow recaps; revocation during awaited preparation blocks further calls and preserves cached text; retained authority expires; a human creator's denial survives nonhuman assignment; true service recaps still complete. Both original regressions failed on baseline, and the alias/creator refinements failed on the initial PR head. The corrected recap file passed 22/22; freshness/retry and operator-authority siblings passed 51/51; eager-import and PR-wrapper closure guards passed 22/22. Changed-file format/lint, export-name collision checks, and the targeted gateway-root test-types leaf passed.
Both final revisions passed the supported
pnpm build sourcePerformanceruntime build on Node 26.12.1 and were frozen with source/build hashes before replay or load. The unchanged dependency and native-protocol inputs were verified before reusing the install. Earlier full builds also passed. Independent subagent review (autoreview route unavailable) found no actionable P0–P2 issue; the latest GitHub code review is clean on the final head. The merged-profile finding is fixed and its review conversation resolved.CI
Final-head CI run 40281550861, attempt 1 has one non-aggregate failure:
checks-node-changed-3, insrc/cron/isolated-agent/run.operator-continuation.test.ts. Four assertions expect the GitHub tool schema not to containinspect: legacy attribution, foreign target, queued manager rename, and owner capture races manager payload.The identical focused command,
node scripts/run-vitest.mjs src/cron/isolated-agent/run.operator-continuation.test.ts --maxWorkers=1, produced the same four failures and 16 passes on base99501d269444(162.96 s) and head51475bc5e62c(194.20 s). The CI gate failure is downstream of that inherited shard. All other CI-workflow jobs passed or were skipped. The initial-head fixture type error was fixed; the final test-types job passes. No CI rerun was requested.Load comparison
The canonical harness is from baseline
99501d269444, which contains the requireded32fdcdtooling revision. It uses two already-built revisions, synthetic state, isolated loopback Gateways, mock providers, and native subagents. No production Gateway was load-tested. The initial interrupted campaign completed no arms and is superseded; it contributes no result.All eight arms completed at least 600 measured seconds, with zero RPC errors. Every arm completed 40 foreground turns, 40 tool calls/results, and 173 utility requests including 80 actual recaps. Shutdown verified that no owned processes remained.
Assessment: no declared adverse threshold was met. This is an authority correctness change, not a speedup claim. Untraced paired means show CPU +0.495 percentage points (+5.29%), GC +40.22 ms/min (below the 50 ms/min absolute gate), and loop p99 +0.598 ms. Both maximum-pause comparisons remain below
max(50 ms, 2 × baseline maximum). Major-GC counts are below 50 per arm. Allocation is effectively flat at +0.16%, with opposite-sign pairs. Client/handler tails and heap also have mixed-sign pairs under differing host load, so they are inconclusive rather than evidence of an attributed improvement or regression. RSS was lower in both timing pairs. No A/A controls were run; no adverse conclusion is asserted.Sampled allocation measures JavaScript allocations, not external/native allocation or retained-heap growth. Per-arm values, sample counts, server-handler boundaries, host load, GC maxima, and achieved work follow.
Frozen baseline
99501d269444e6b7be7789bc1cd91a67833103ff; candidate51475bc5e62c70ebc0267795b4d0fb5dc025f241. Controller/runtime pinned to v26.12.1.10,800 synthetic sessions, 40 plugins, 65 identified operator WebSocket clients, concurrent mock-provider turns with tools/native subagents, sidebar/list/search/history churn. Timing AB/BA and separate allocation AB/BA; ten measured minutes plus one-minute warmup per arm.
RSS is process-wide and heap is the main isolate; both are end-window values. Handler p99 is interpolated from Prometheus histogram deltas and is distinct from client round-trip latency. Host load is the mean and range of sampled one-minute load averages. Allocation-pass CPU/GC/latency are diagnostic. No partial/superseded arm contributes to this report.
Untraced GC cells below show count / total milliseconds / p95 / p99 / maximum pause milliseconds. Every tail retains its sample count; major-GC tails below 50 collections and p99 below 1,000 samples are context. No pause or maintenance window was excluded.
Paired signed mean deltas from the canonical report: