Registry Mirror
Skip to content

Conversation

@saphid

@saphid saphid commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

When t3 connect login waits ten minutes without receiving a loopback OAuth callback, the CLI reports a generic authorization failure and relegates the timeout to a nested cause.

Deterministic repro on origin/main (42dbf4debc8947d47181098969f50ea622fa409d): Apply only the regression test and run vp test run apps/server/src/cloud/CliTokenManager.test.ts -t 'preserves the loopback authorization timeout'. The test uses the file's synthetic TEST_ENV, an empty credential store, and a terminal with no input. It runs the real loopback listener, sends nothing to /callback, and advances TestClock by 11 minutes once terminal input is ready. In the CLI, running t3 connect login from a local TTY with no stored credential or SSH flags reaches authorizeCli → CloudCliTokenManager.get; the error propagates to the CLI runtime logger.

Observed: CloudCliAuthorizationError: Could not authorize the T3 Connect CLI. Expected: CloudCliAuthorizationTimeoutError: Timed out waiting for T3 Connect authorization.

Change

Preserve typed CloudCliTokenManagerError values and terminal quit errors in get; continue wrapping other failures. This covers the shared interactive authorization path used by t3 connect login, t3 connect link, and t3 connect (t3 up --connect) without changing the device-code flow or the timeout duration.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • The focused regression failed on base with expected 'CloudCliAuthorizationError' to equal 'CloudCliAuthorizationTimeoutError' and passed on head.
  • vp run check:changed exited 0; 10 affected tests passed across 2 files.
  • Before/after CLI transcript: the actual CLI in an isolated pseudo-terminal reported the generic error on base and the timeout on head. Both exited 1.
  • Not shown: A full real-time ten-minute wait (the transcript accelerates the callback timer), successful OAuth sign-in, or interactive link/up runs.

Authored by GPT-6.2 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 2, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 9034235

Macroscope's review found this PR approvable — This preserves specific CLI authorization errors, including timeouts, rather than replacing them with a generic error. Authorization behavior, credential storage, and product defaults remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The token manager now preserves recognized token-manager errors and terminal quit errors instead of wrapping them. The CLI uses the token manager’s error predicate. A new test checks that authorization times out when terminal input does not complete.

Changes: Cloud CLI authorization errors

Layer / File(s) Summary
Preserve token-manager errors and test timeout behavior
apps/server/src/cloud/CliTokenManager.ts, apps/server/src/cli/connect.ts, apps/server/src/cloud/CliTokenManager.test.ts
The token manager exports an error predicate and preserves recognized token-manager errors and terminal quit errors. The CLI uses the predicate when mapping authorization failures. A regression test checks the loopback authorization timeout when readLine never completes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 90342

The change makes the loopback authorization timeout report its specific error instead of a generic authorization failure. It is covered by a focused regression test. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the actual change: CloudCliTokenManager.get now keeps CloudCliAuthorizationTimeoutError instead of wrapping it in a generic CloudCliAuthorizationError. It follows the conventional comm…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections, and it includes a reproduction, a stated expected behavior, a scope justification for having no issue, a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the actual change: CloudCliTokenManager.get now keeps CloudCliAuthorizationTimeoutError instead of wrapping it in a generic CloudCliAuthorizationError. It follows the conventional commit format and is specific enough for a teammate to scan history. The title is 85 characters, which is long but still readable.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections, and it includes a reproduction, a stated expected behavior, a scope justification for having no issue, and focused test results. It also notes what was not checked, which the template asks for. The template's closing request to name the model and harness is handled by the author attribution line, which names GPT-6.2 Sol (Codex) and Gemini 4 Neon (Antigravity), so that item is covered. The Verification section cites a gist transcript and does not embed it, which is acceptable because the template allows linking for evidence.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c2a5953 and 9034235.

Files selected for processing: 2

  • apps/server/src/cli/connect.ts
  • apps/server/src/cloud/CliTokenManager.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 2, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review December 2, 2026 22:54

Dismissing prior approval to re-evaluate 9034235

@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Ran the real CLI on Linux in an interactive 160×40 PTY with a fresh empty data directory on each commit and test-stage T3 Connect configuration. Ran t3 connect login --base-dir <fresh-directory> without headless mode or SSH variables, confirmed the loopback listener on 127.0.0.1:34338, then sent no keys or callback for the full ten minutes. No browser URL was opened. Both exited 1.

Before After
cb0bdcc00b 9034235ff6
Before: generic authorization error After: typed timeout preserved
CloudCliAuthorizationError: Could not authorize the T3 Connect CLI. Timeout only in nested cause. CloudCliAuthorizationTimeoutError: Timed out waiting for T3 Connect authorization.
PTY recording · Transcript PTY recording · Transcript

Recordings replay actual timestamped PTY output at 30× speed; execution used the unchanged real ten-minute timeout. Authorization URLs and local paths are redacted. Total process times including startup: 601.423s before and 608.896s after. Prompt-to-error times: 23:06:03–23:16:03 UTC before, 23:16:18–23:26:18 UTC after.

Same PTY driver for both runs · Recording renderer

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 2, 2026
@juliusmarminge
juliusmarminge merged commit 0a9eee8 into pingdotgg:main Dec 2, 2026
42 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants