Repository navigation
fix: allow session-scoped shared publication reads - #162984
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. Reviewed October 1, 2026, 4:41 PM ET / 20:41 UTC. ClawSweeper reviewWhat this changesAllow session-scoped callers to discover shared GitHub publication options and read receipts for visible sessions while preserving personal-account restrictions and validating repository ownership. Merge readiness✅ Ready for maintainer review Keep open: current main still blocks the documented session-scoped shared-publication reads, and this branch provides a focused backend repair. No concrete introduced correctness or security defect was found; the separate UI repair remains necessary. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway receives publication discovery and status requests from chat clients. It checks current caller authority, session visibility, and repository ownership before returning shared publisher options or publication receipts. flowchart TD
A[Chat client request] --> B[Gateway scope admission]
B --> C[Current identity and session visibility]
C --> D[Shared publication receipts]
C --> E[Registered repository target]
C --> F[Personal account permission]
D --> G[Revalidated response]
E --> G
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +135, Tests +484, Docs +11. Total +630 across 13 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use the existing session-read authorization owner for shared discovery and receipts, and complete the complementary UI action repair without widening personal or publication-mutation authority. Do we have a high-confidence way to reproduce the issue? Yes, from source: a verified session-only caller reaches both a broad-read admission barrier and a broad-read preparation check on current main. The PR reports failing baseline router regressions; this review did not execute them. Is this the best way to solve the issue? Yes, this is a focused backend repair using the existing session authorization and repository ownership boundaries. It preserves stronger personal-account checks and leaves the complementary UI change separately scoped. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a6ee7e12d29c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Fixed: session-scoped guests can read shared GitHub publication options and status without general read access. |
* origin/main: fix(gateway): report approved-but-narrowed scope upgrades truthfully (#162951) fix: allow session-scoped shared publication reads (#162984) refactor(sessions): share session creation orchestration (#161336) perf(gateway): show the first chat sooner after a Gateway start (#162936) refactor(scripts): share npm verification command execution (#162978) fix(browser): clear MCP runtime cache after profile tests (#162982) fix(test): checkout fixture tests fail healthy runs on loaded macOS hosts (#162888) ci: bound PR extension lint to direct owners and smoke packages fix(ci): await native declaration discovery teardown feat(qa): drive forwarded text+photo bursts in Telegram userbot scenarios (#162906) build(macos): pin the app runtime to OpenClaw Bun 17c9ecf9eb (#162570) fix(test): frozen admission test fails with spawn ETXTBSY when a sibling test forks during the native parser copy (#162969) fix(ci): give direct published-driver callers the CI cell envelope (#162837) test(gateway): remove low-value tests (batch d136) (#162921)
Allow verified session-scoped callers to read shared GitHub publication options and receipts while preserving current authority, visibility, and personal account boundaries. Refs openclaw#162916.
Refs #162916.
What Problem This Solves
Fixes shared GitHub publication options and status reads for people with session-scoped access. Ordinary shared publication already accepts
operator.sessions.write, but its discovery and receipt methods independently required general read permission. This prevented the surrounding chat flow from using an otherwise supported capability.User Impact
Verified session-scoped readers can inspect shared publication data for sessions they may view. Hidden sessions and personal account data remain protected. A narrow caller receives a shared publisher option only for a current managed worktree or repository workspace with a supported GitHub remote; an unavailable target does not remove existing shared receipts. Broad readers and trusted internal callers retain their existing account-discovery behavior.
This is the backend contribution. The separate UI contribution enables the corresponding shared Publish action. Personal publication, confirmation, workflow changes, foreign-session mutations, and administrator permissions retain their existing requirements.
Why This Change Was Made
The read methods use the existing session-scope admission mechanism and retain current request, profile, role, grant, connection, and session visibility checks across awaited work. Personal discovery and receipt preparation remain separate from shared reads. The existing response shape is unchanged.
Target discovery reuses registered workspace ownership and repository identity checks without preparing a publication or calling the GitHub repository API. It preserves the managed fingerprint/rebind boundary. The repository reader now distinguishes a missing origin from an actual Git read failure, so an unexpected failure is not presented as an unavailable target.
Evidence
The registered-router regression rejects six permitted reads on the original production code at b66471a with
missing scope: operator.read. The corrected guest, target, and Git-owner cases pass, alongside existing broad/personal-reader controls. These use isolated profile/session state, real local Git repository facts, and synthetic GitHub service responses; no live publication is claimed.Remote validation passed on the exact committed tree: full formatting, lint and structural checks; production, test and consumer TypeScript checks; package-boundary compile and canary checks; generated plugin assets; runtime and UI builds; and the native CI affected-test selection. The affected run selected 194 files: 191 passed and 3 were already skipped, with 2,985 passing tests and 13 existing skips. It includes 7 E2E files with 9 passing tests.
The five directly affected test files also passed individually, totaling 69 cases. This includes the final trusted-internal-caller compatibility check. Measured wall time on the retained Linux runner for
pnpm test <file> --maxWorkers=1:src/gateway/server-methods/sessions-github-read.test.tssrc/gateway/server-methods/sessions-github-read.guest.test.tssrc/gateway/server-methods/sessions-github-read.target.test.tssrc/gateway/server-methods/github-personal-authorization.test.tssrc/agents/worktrees/service.canonical-paths.test.tsThese wall times include runner startup and transforms. The registered-router and real Git cases protect admission, current authority, visibility, and target ownership across asynchronous work; mocked helper-only coverage would miss those boundaries. CI test-case time is the sum of the reported passing case durations, excluding startup and transforms, from CI run 36922860783. Exact-head CI passed, and ClawSweeper rated the patch Platinum with no findings. No live GitHub publication or deployment is claimed.