Repository navigation
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
🟡 Changes recommended
Windows shell instructions, proxy guidance, and doctor remediation contain misleading documentation.
3 open findings
What changed in this PR
Distinguishes inaccessible credential stores from missing credentials and provides sandbox-appropriate remediation.
Changes:
- Classifies permission-denied credential stores and propagates errors through authentication checks.
- Adds regression tests for refused and empty stores.
- Documents sandbox authentication alternatives and doctor guidance.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
internal/auth/auth.go |
Classifies refused credential-store access and supplies a token-oriented hint. |
internal/auth/keyring_test.go |
Tests refused-store and genuinely empty-store behavior. |
README.md |
Documents authentication options for sandboxed agents. |
skills/basecamp-doctor/SKILL.md |
Adds refused-store remediation guidance. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Review summary as of ece5e73:
|
Inside an AI agent's sandbox the OS can refuse the keyring outright: Codex's Windows sandbox answers Credential Manager with "Access is denied." The store then falls back to an empty credentials.json, and the miss surfaced as auth_required with "Run: basecamp auth login" -- a login the person already has, and one the sandbox would refuse in turn. A store error that wraps fs.ErrPermission (ERROR_ACCESS_DENIED on Windows, EACCES/EPERM on Unix) is now reported as a refusal, ahead of the no-credential case it also matches, with a hint naming BASECAMP_TOKEN and the personal access token page. CheckAuthenticated returns that error rather than "nothing stored", so gates stop offering a login. An empty store with no refusal behind it still says to log in.
Covers BASECAMP_TOKEN with a personal access token, a login made outside the sandbox (file storage only), Basecamp's hosted MCP server, and the egress proxy settings sandboxes tend to need. Also documents BASECAMP_NO_KEYRING, which #800 asks for.
Personal access tokens are not issued to every account, so the refused-store hint, the sandbox README section and the doctor skill must not send people to mint one. The hint now names running outside the sandbox, a file-stored login in a directory the sandbox can write (BASECAMP_NO_KEYRING=1 plus XDG_CONFIG_HOME), and Basecamp's hosted MCP server, with BASECAMP_TOKEN only for a token the person already holds. The Personal access tokens section says the same about availability.
…Shell form The refused-store classifier also covers a credentials file the OS will not let the CLI read, where there may be no login at all, so the doctor skill and the hint's comment no longer assert one exists. The file-storage login gains its PowerShell form, since the motivating case is Windows.
ece5e73 to
208f665
Compare
|
🤖 Rebased onto main to pick up the change-aware CI from #882; no code changes. |
…ct reads - A save or delete that moves to the keyring after a probe timeout removes the key's plaintext copy, which reads after a timeout still serve first; a delete of a key only the file held succeeds. - A direct-read miss of a held credential is asked again after the grace wait, as a store read is. - A refusal on the direct read or the patient probe is an answer (#866): reported as itself, with no backoff and no retryable outage. - One direct read at a time; others are refused at once. A caller that stops waiting is not held for the 60s bound. - The connector's first credential read honors a signal delivered as its wait ends.

Problem
A customer runs the CLI from Codex on Windows. Codex's default Windows sandbox (MXC) refuses access to Windows Credential Manager. The CLI's keyring probe gets
Access is denied., falls back to an emptycredentials.json, and reports the miss asauth_requiredwith the hintRun: basecamp auth login.That remedy is wrong. The person is already logged in, and the login sits in the vault the sandbox won't open. A new login inside the sandbox would be refused the same way, or stored somewhere the next sandboxed run can't read either. The same wall shows up for
ghinside Codex on Windows (openai/codex#21821).Change
Classify a refused store.
storeRefusedmatches any store error that wrapsfs.ErrPermission. That covers a keyring probe refused with a permission error, which credstore carries in the fallback miss, and a credentials file that can't be read for lack of permission.syscall.ErrnomapsERROR_ACCESS_DENIEDtofs.ErrPermission.EACCESandEPERMmap to it.unreadablechecks this first. A refused probe also reads asErrNoCredential, so the order matters. The error staysauth_required, and its message now says "the system credential store refused access" alongside the OS's own error. The hint isCredentialStoreRefusedHint, which lists only remedies any account can use:It doesn't send anyone to create a personal access token. A test pins that.
CheckAuthenticatedreturns that error for a refused store. Before, it returnedfalse, nil, so the wizard,people,mcpand completion gates read a refused store as "nothing stored" and offered a login.README: a new "AI agent sandboxes" section under Authentication. It covers:
BASECAMP_NO_KEYRING=1plusXDG_CONFIG_HOME). It warns that the directory must be writable, because a refresh that can't save its rotated token loses the login, and that it must stay out of git;BASECAMP_TOKENonly for a token the person already has;BASECAMP_OAUTH_USE_PROXY=1(exactly1),SSL_CERT_FILE, and OAuth login and token refresh refused when DNS returns fake-IP addresses (198.18.0.0/15), with no supported way to trust them #849.It also links auth login/status/doctor hang forever (no timeout) when keyring's D-Bus handshake stalls; BASECAMP_NO_KEYRING=1 works but is undocumented #800, which asks for
BASECAMP_NO_KEYRINGto be documented.README, existing "Personal access tokens" section: it presented personal access tokens as available to anyone, which is misleading for customers. The token page isn't open to every account yet, which I checked in bc3's
My::AccessTokensController. I fixed this here because it's a one-sentence change on the same topic: the section now says tokens aren't available on every account and points to the OAuth login otherwise.basecamp-doctor skill: one remediation bullet for the refused-store error. It tells an agent to relay the error's hint instead of looping on
auth login, and never to send the user off to create a personal access token.Deliberately not done: a silent plain-file fallback
One tempting fix is to also keep a plaintext copy of every keyring login, so a sandbox that refuses the keyring can still read it. That isn't in this PR:
Choosing file storage stays explicit (
BASECAMP_NO_KEYRING=1), and the new README section explains when to choose it and what it costs.Not covered
auth statusanddoctorstill useIsAuthenticated(a bool) and report a refused store as "not logged in". That could be a follow-up.syscall.Errno.Ismapping ofERROR_ACCESS_DENIED, and on go-keyring/wincred returning thatErrnounwrapped fromCredWrite. I checked both in source (go-keyring v0.2.8, wincred v1.2.3), andGOOS=windows go vetand a test build pass.Verification
main:TestAccessTokenWhenTheKeyringRefusesAccessNamesTheRefusal: the message lacked "refused access", and the hint wasRun: basecamp auth login.TestCredentialStoreRefusedHintNamesRemediesAnyoneCanTake: failed against this PR's first hint, which pointed to the personal-access-token page.TestCheckAuthenticatedReportsARefusedStore: returnedfalse, nil.TestAccessTokenWithNothingStoredStillSaysLogin, the control, passes both before and after. That pins the classification to refusals only.DBUS_SESSION_BUS_ADDRESSat a socket in a mode-000 directory, so the probe getsconnect: permission denied.auth_required, hintRun: basecamp auth login.auth_required, message "…the system credential store refused access: …permission denied…", and the hint above.XDG_CONFIG_HOMEpointing at a directory holding a file-stored login, the CLI reads the file and sends the request. This worked both with and withoutBASECAMP_NO_KEYRING=1on the agent's side.bin/cipasses locally.