Skip to content

Box sign-in fixes: wait for the proxy, Cursor's check reason, OpenCode Go - #2529

Merged
amaudruz merged 9 commits into
mainfrom
fix/box-sign-in-consolidated
Dec 4, 2026
Merged

amaudruz merged 9 commits into
mainfrom
fix/box-sign-in-consolidated

Conversation

@amaudruz

@amaudruz amaudruz commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Puts Raul's remaining sign-in PRs into one branch on top of main, which already has #2519:

Conflicts resolved:

Not included: #2508 (Console browser sign-in on remote machines). #2491 on main already ships the same feature ("Sign in with browser" first when giving a machine a login), and #2508 now conflicts with it in each file it touches. It looks superseded.

Supersedes #2523, #2483 and #2520. I didn't run tests here, as asked. CI will run.

🤖 Generated with Claude Code

raullopez-sandbox and others added 9 commits December 3, 2026 15:05
The check read every failed `agent about` as "Could not verify
authentication. Check provider setup and try again." `agent about` waits
on Cursor's servers with no time limit of its own, so a run that cannot
get through is ended at 15 seconds and prints nothing, and the status
said "could not be checked" with no reason. It now says the check was
ended for taking too long, or how the command failed (its exit code and
last error line). An answer the command printed before it failed is
still read as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenCode takes an OpenCode Go API key, on Switch Cloud and on machines of
your own. On Switch Cloud it replaces the ChatGPT browser sign-in for
OpenCode (core, box and chat-ui agree); own machines keep it.

- Box: the key is checked with opencode.ai (GET /inference/go/v1/usage):
  401 says the key is wrong, 403 that the account has no OpenCode Go
  subscription. The provider gateway holds the key and gives OpenCode only
  its base URL and an opaque token (OPENCODE_CONFIG_CONTENT and
  OPENCODE_AUTH_CONTENT). It maps each SDK suffix to its path under
  /inference/go, puts the real key in that route's header, passes on
  x-opencode-* and anthropic-* headers, and refuses other paths.
- Own machines: the key is written as the opencode-go entry of OpenCode's
  auth.json.
- Egress: opencode.ai on the controller's side of the box lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…HOO-4637)

A new box's squid learns its login only when its password file is next
read, so a sign-in started right after the box comes up got 407 from the
proxy. The controller now asks the proxy for a tunnel to the provider's
sign-in host first and waits out a 407 for up to 2 minutes, reporting
that the network is still getting ready. The dashboard shows that
progress message while the sign-in starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… fix/box-sign-in-consolidated

# Conflicts:
#	console/packages/agent-controller/src/box/BOX-MODE.md
#	console/packages/agent-controller/src/box/controller-box.ts
#	console/packages/agent-controller/src/browser-login.test.ts
…ign-in-consolidated

# Conflicts:
#	console/packages/agent-controller/src/box/BOX-MODE.md
@amaudruz
amaudruz merged commit 6472c29 into main Dec 4, 2026
22 of 23 checks passed
await once(server, 'close');
const failure = await tunnelAnswer(new URL('https://auth.provider.test/'), 2_000, {
env: () => ({}),
gatewayProxy: () => `http://box-user:pw-test-only@127.0.0.1:${port}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low severity issue identified in your code:

Hardcoded sensitive data leaked

Semgrep has detected a leak of sensitive data in this code. This secret data could be used by internal or external malicious actors. We highly recommend you change, reset, or rotate the sensitive data.

A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. It is recommended to rotate the secret and retrieve them from a secure secret vault or Hardware Security Module (HSM), alternatively environment variables can be used if allowed by your company policy.

💬 To ignore this, reply with:
• /fp <comment> for false positive
• /ar <comment> for acceptable risk
• /other <comment> for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by generic_uri_string_localhost.

expect(
await tunnelAnswer(url, 2_000, {
env: () => ({}),
gatewayProxy: () => `http://box-user:pw-test-only@127.0.0.1:${open.port}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Low severity issue identified in your code:

Hardcoded sensitive data leaked

Semgrep has detected a leak of sensitive data in this code. This secret data could be used by internal or external malicious actors. We highly recommend you change, reset, or rotate the sensitive data.

A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. It is recommended to rotate the secret and retrieve them from a secure secret vault or Hardware Security Module (HSM), alternatively environment variables can be used if allowed by your company policy.

💬 To ignore this, reply with:
• /fp <comment> for false positive
• /ar <comment> for acceptable risk
• /other <comment> for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by generic_uri_string_localhost.

expect(sent).toEqual([
{
url: 'https://opencode.ai/inference/go/v1/usage',
headers: { authorization: 'Bearer oc_sk_test-key-0001', accept: 'application/json' },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium severity issue identified in your code:

Hardcoded sensitive data leaked

Semgrep has detected a leak of sensitive data in this code. This secret data could be used by internal or external malicious actors. We highly recommend you change, reset, or rotate the sensitive data.

A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. It is recommended to rotate the secret and retrieve them from a secure secret vault or Hardware Security Module (HSM), alternatively environment variables can be used if allowed by your company policy.

💬 To ignore this, reply with:
• /fp <comment> for false positive
• /ar <comment> for acceptable risk
• /other <comment> for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by generic_bearer_auth_header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants