Repository navigation
Enable Git and GitHub API access to an Agent’s assigned repositories on OpenShell - #4098
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 changesThis PR enables Git and GitHub API access to an Agent’s explicitly selected repositories through OpenShell. Example: An Agent selects repositories A and B with Repository collaborator access.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for landing: it delivers a maintainer-approved capability, and the published merge preserves restore compatibility without a blocking introduced defect found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherRepository policy resolves operator-approved selections; OCC records admission and live sessions, Token Service prepares scoped credentials, and the OpenShell sender checks current authority before credential injection and GitHub I/O. flowchart LR
Operator[Operator repository selection] --> OCC[OCC admission and sessions]
OCC --> Tokens[Token Service]
Tokens --> Sender[OpenShell sender]
Agent[Agent Git and GitHub CLI] --> Sender
Sender --> Authority[Current authority check]
Authority --> OCC
Sender --> GitHub[GitHub repositories]
Technical reviewBest possible solution: Land the selected-repository path with its mandatory request binding, live session checks, preserved narrow grants, and verified restore fingerprints. Do we have a high-confidence way to reproduce the issue? Pinned main explicitly refuses the bundled repository Git sender and lacks selected-set delivery; the supplied installed demonstration establishes the requested workflow after the change. Is this the best way to solve the issue? The implementation extends the existing policy, credential, session, and sender owners while keeping installation-wide access separate and preserving explicit historical grants. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5f8ba60705bd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
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 HistoryReview history (6 earlier review cycles)
Reviewed October 30, 2026, 4:29 PM ET / 20:29 UTC (Revision 7). |
git push with newest OpenShell
git push with newest OpenShell|
@clawsweeper re-review Please review All 78 focused tests and the PostgreSQL standing Git transfer file passed locally with zero skips. The body preserves the real GitHub demonstration on its recorded commit. Recorded test PR · Current native image checks |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review |
|
🦞👀 Re-review progress:
|
Resolve the migrations/meta/_canonical-history.json conflict with #4244: keep main's list-valued logicalRestoreCatalogs (including the restored 51-receipt catalog and the upgraded-restore spelling of the 64-receipt schema, now preSelectedRepositorySet) and bind the new completed catalog to its restored spelling plus the spelling left by upgrading a restored 51-receipt backup through 0065_selected_repository_set (measured on PostgreSQL 18.6 by the logical restore test's canonical51 lineage). A restored 64-receipt backup upgraded through 0065 yields the existing restored spelling, so it needs no extra alias.
|
Merged main (incl. #4244) to resolve the migration manifest conflict in How it was resolved:
Checks on the merge commit (on a remote test VM): typecheck; Static Checks + Suite Audit, PostgreSQL Migrations (188/188 tests passed, including the logical restore test and |
|
@clawsweeper re-review Please review the published merge |
|
🦞👀 Re-review progress:
|
… held probe (#4246) Test-only follow-up to #4098: asserts a selected-repository sender cannot read the installation-wide token, asserts the use check denies a request naming an unselected repository, and retries the held hook probe across reconciliation passes as production enrollment does (findings 3008, 3009, 3011).
An Agent with Repository collaborator access can push a branch and open a pull request in any repository its operator selects. OCE gives stock OpenShell a GitHub App credential scoped to those repository IDs. GitHub enforces the App permissions and branch protections. OCE refuses deploy-key creation. Stock OpenShell 0.1.6 limits each complete Git push request to 4 MiB, including framing. Selected-repository REST JSON is limited to 1 MiB and GraphQL JSON to 64 KiB.
Watch the Agent open a pull request
oce-agent-pr-redacted-v2.mp4
The operator created an Agent on k3d with OCE
c9ab6cf6and stock OpenShell 0.1.6, then sent one message in a new conversation. The Agent committed, rangit pushandgh pr create, and replied with the PR link. An independentgh pr viewshowed the PR open againstmainat the same commit,501543d8687f. The operator then closed it without merging and deleted the branch. Test PR #4150Waits and navigation are trimmed. The model and private runtime selector are masked.
What failed and what now covers it
Fresh deployments refused repository-scoped Git writes at admission. Released OpenShell 0.1.6 provides the hook OCE uses to check the current grant before attaching a credential. Required CI now exercises two selected repositories and a third outside the grant. On
209549c1, GitHub accepted the push, then the firstgh pr createGraphQL request returned 403. Replaying the bundled CLI’s captured requests reproduced the old hook’s refusal of its metadata headers. The required suite now exercises those requests.An earlier stock OpenShell run on OCE
ffcbf545used controlled Git and API origins. A and B accepted writes. C’s Git refs stayed unchanged. The sender denied REST for C, and the provider denied GraphQL for C. After B was removed, the same Agent received a denial on its existing connection. The origin’s HTTP request count stayed at 40 through that response. The next request retired the credential.Installed denial trace (UTC, OCE ffcbf54)
Required CI and First Agent Smoke · AMD64 and ARM64 image verification