Skip to content

fix: honor ID member agent policy for new sessions - #199413

Merged
joshavant merged 1 commit into
mainfrom
fix/id-member-session-agent-policy
Nov 15, 2026
Merged

joshavant merged 1 commit into
mainfrom
fix/id-member-session-agent-policy

Conversation

@joshavant

@joshavant joshavant commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • All four new create/reset regressions failed on the base and pass on 1a6acc7ed5d2. Supporting role, creation, reset/fork, recovery, and catalog-import tests passed across seven files.
  • Final commit: core and both affected test TypeScript checks, type-aware lint/format for all seven files, and pnpm build:runtime passed.
  • Isolated compiled-Gateway replay passed using a real local issuer, Discovery, and native iroh transport. Write-only creation and separately admin-scoped reset both reject excluded agents without persisting a row; explicit agent grants, linked local-admin operations, existing-session operations, and owner operations succeed. Write-only reset remains refused by its existing scope gate. This is isolated source-checkout qualification, not deployed-service validation.
  • Local ClawSweeper was unavailable. Codex API autoreview covered the complete seven-file repair snapshot through P3 with no actionable findings; independent source review also covered the final type-only correction. Exact-head CI passed, and hosted ClawSweeper review found no actionable findings or before-merge items. The hosted reviewer could inspect source and CI; the native runtime trace remains in the private validation evidence.

@clawsweeper

clawsweeper Bot commented Nov 15, 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.

@joshavant
joshavant marked this pull request as ready for review November 15, 2026 03:58
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S labels Nov 15, 2026
@github-actions

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: 1a6acc7ed5d272f80f1680575b9f692a955b89fe
  • Maintainer: @joshavant
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/operator-role-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 15, 2026
@clawsweeper

clawsweeper Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Use 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.

  • Before: Creation can use the linked admin profile’s unrestricted agent policy.
  • After: Creation returns FORBIDDEN without persisting a session row.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-supported repair with meaningful handler regressions and green reported checks; direct runtime evidence is limited to the author’s replay report.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the contributor proof gate; its body reports compiled-Gateway create/reset checks through a local issuer, Discovery, and native iroh transport, but supplies no inspectable runtime trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An ID member linked to a broader local profile can create sessions for agents excluded by their membership role.
Reason: The maintainer-authored repair restores documented membership precedence without adding options, storage, or another authorization owner.

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
Reviewed head: 1a6acc7ed5d272f80f1680575b9f692a955b89fe

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway 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]
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +38, Tests +103. Total +141 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 59 21 +38
Tests 2 105 2 +103
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 164 23 +141

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Repairs a concrete creation-policy bypass in optional, off-by-default ID functionality when membership restrictions differ from a linked profile’s permissions.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 November 14, 2026, 11:15 PM ET / November 15, 2026, 04:15 UTC.

@joshavant
joshavant merged commit b2f5706 into main Nov 15, 2026
214 checks passed
@joshavant
joshavant deleted the fix/id-member-session-agent-policy branch November 15, 2026 10:57
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant