Repository navigation
fix: honor ID member agent policy for new sessions - #199413
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: needs maintainer review before merge. What this changesUse captured operator authority to enforce ID members’ agent restrictions during session creation, missing-session reset, and catalog import. Example: An ID member with agents: [] is linked to a local admin profile and requests agent:main:dashboard:member-agent-denied.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current session-creation permission bypass, follows the documented membership policy, and introduces no identified correctness defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway session handlers pass authenticated operator authority into creation and reset services, which authorize the selected agent before creating session state. flowchart TD
A[Authenticated ID member] --> B[Gateway session handlers]
B --> C[Captured operator authority]
C --> D[Creation and reset services]
D --> E[Agent policy authorization]
E --> F[Session storage or refusal]
Technical reviewBest possible solution: Retain the captured membership authority through the existing creation-policy owner while preserving existing-session access and owner behavior. Do we have a high-confidence way to reproduce the issue? Current-main source shows membership authority being discarded at creation checks; the added handler regressions exercise that path, and the author reports all four failing on the base and passing on the head. Is this the best way to solve the issue? This is a focused repair using the existing authority and policy owners; catalog import needs the added capture because it previously supplied only profile-derived identity. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5fbdf6989130. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +38, Tests +103. Total +141 across 7 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label 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 November 14, 2026, 11:15 PM ET / November 15, 2026, 04:15 UTC. |
What Problem This Solves
Fixes ID members being able to create a session for an agent excluded by their membership role when linked to a local profile with broader permissions. The same creation policy also applies when resetting a session that does not exist yet.
User Impact
New sessions honor the member’s agent policy. Existing-session access, local profile permissions, owner access, and reset’s admin-scope requirement keep their current behavior. No configuration or migration is required.
Why This Change Was Made
Use the operator authority already retained by the session owner for creation checks, including catalog imports, instead of falling back to the linked profile’s role. This adds no new identity channel or state.
Evidence
1a6acc7ed5d2. Supporting role, creation, reset/fork, recovery, and catalog-import tests passed across seven files.pnpm build:runtimepassed.