Repository navigation
fix(repository): accept GitHub's spelling of the repository in draft PR replies - #3278
Conversation
…PR replies The repository registry lowercases registered names, so the OpenShell Git route delivers OCE_OPENSHELL_GIT_REPOSITORY=acme/widgets for a repository GitHub spells Acme/Widgets. GitHub creates the draft (201) and answers with its own spelling in html_url and head/base full_name. The oce-github client compared those case-sensitively, so a created draft was reported as "Draft not confirmed" and the Agent never got its URL or number. Compare the repository part of the URL and both full names without case, as GitHub does and as token issuance already does. Another repository is still refused.
|
🦞👀 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. |
Internal review nit: a reply whose URL has another host of the same length, or another pull number, must still be reported as not confirmed.
|
Codex review: needs maintainer review before merge. What this changesThis PR accepts case differences in GitHub repository names when confirming an OpenShell draft pull request. Example: The registered repository is acme/widgets and GitHub returns https://github.com/Acme/Widgets/pull/8.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it narrowly fixes a current-main response-validation bug, and no introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe repository CLI sends an admitted draft-create request through OpenShell, validates GitHub’s response, and returns the confirmed draft URL to the Agent. flowchart LR
Registry[Repository registry] --> Sandbox[Sandbox repository binding]
Sandbox --> CLI[oce-github CLI]
CLI --> OpenShell[OpenShell mediation]
OpenShell --> GitHub[GitHub API]
GitHub --> Validation[Draft response validation]
Validation --> Agent[Agent receives URL]
Technical reviewBest possible solution: Keep the correction in the existing OpenShell response validator and retain the focused CLI regression cases. Do we have a high-confidence way to reproduce the issue? Main’s lowercase registry value necessarily fails its exact comparisons against a mixed-case GitHub response; the PR reports a failing-base/passing-head CLI regression, but no tests were run during this read-only review. Is this the best way to solve the issue? The patch is a small, complete correction for the stated OpenShell confirmation bug and follows existing case-insensitive repository matching without changing authorization or the separate native receipt path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7297355a48bd. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
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 23, 2026, 2:29 AM ET / 06:29 UTC. |
Problem
The repository registry stores registered names in lowercase (
registry.ts:.toLowerCase()), so the OpenShell Git route gives the SandboxOCE_OPENSHELL_GIT_REPOSITORY=acme/widgetsfor a repository that GitHub spellsAcme/Widgets.oce-github pr-create --draftposts to/repos/acme/widgets/pulls. GitHub ignores case, creates the draft and answers 201 with its own spelling:html_url: https://github.com/Acme/Widgets/pull/Nandhead.repo.full_name: Acme/Widgets. The client compared both case-sensitively. The created draft was therefore reported as "Draft not confirmed ... do not submit another create", and the Agent never got the URL or number. Every OpenShell-mode draft create in a registered repository with a capital letter in the owner or name hit this. (Board finding 2232.)Change
client/draft-pr.ts(OpenShell mode): compare the repository part ofhtml_urland bothfull_namefields without case. Everything else in the reply check is unchanged: status 201,open,draft, number, the/pull/<number>suffix, head ref and base ref. Token issuance already compares names the same way (acquisition-response.ts).repository-credentials-draft-pr-cli.test.mjs: a reply in GitHub's own spelling is confirmed and printed with GitHub's URL. A reply naming another repository in the URL, the head or the base, another host or another pull number is still reported as not confirmed.Verification
full_namecheck; drop the basefull_namecheck; compare case-sensitively.node --test tests/integration/repository-credentials-draft-pr-cli.test.mjs: 20/20 at 2 CPUs.tsc --build, eslint and prettier are clean on the touched files.Risks
prepared-draft-pull.tsvalidateDraftProjection, and the broker reply check indraft-pr.ts); it is tracked separately (finding 2236), because the fix there must keep stored projections valid.