fix(cli): explain trigger auth source on 403#248
Conversation
|
Warning Review limit reached
More reviews will be available in 25 minutes and 54 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces tracking of the authentication source (authSource) as either 'env' or 'cloud-session' when resolving workspace tokens. This source is then utilized to provide more descriptive error hints during manual trigger failures (specifically 403 Forbidden errors). The feedback suggests simplifying the code in list-command.ts by directly accessing auth.authSource instead of using the redundant readAuthSource helper function, as the property is already strongly typed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const authSource = readAuthSource(auth); | ||
| return { | ||
| cloudUrl, | ||
| workspace, | ||
| token: auth.token, | ||
| ...(authSource ? { authSource } : {}) | ||
| }; | ||
| } | ||
|
|
||
| function readAuthSource(value: unknown): 'env' | 'cloud-session' | undefined { | ||
| if (!value || typeof value !== 'object') return undefined; | ||
| const authSource = (value as { authSource?: unknown }).authSource; | ||
| return authSource === 'env' || authSource === 'cloud-session' ? authSource : undefined; | ||
| } |
There was a problem hiding this comment.
Since auth is returned by resolveWorkspaceToken, which is typed to return WorkspaceAuthToken & { workspace?: string }, the authSource property is already strongly typed as 'env' | 'cloud-session' | undefined. We can directly access auth.authSource without needing the helper function readAuthSource and its runtime type checks. This simplifies the code and improves maintainability.
return {
cloudUrl,
workspace,
token: auth.token,
...(auth.authSource ? { authSource: auth.authSource } : {})
};
}
Summary
WORKFORCE_*env credentials or the Agent Relay cloud session.agentworkforce trigger403 errors so operators know whether to unset stale env credentials or refresh cloud login.Validation
pnpm --filter @agentworkforce/cli exec tsc -p tsconfig.json --noEmitpnpm --filter @agentworkforce/cli exec tsc -p tsconfig.json && node --test packages/cli/dist/trigger-command.test.jspnpm --filter @agentworkforce/deploy exec tsc -p tsconfig.json --noEmitcd packages/deploy && pnpm --filter @agentworkforce/deploy exec tsc -p tsconfig.json && node --test dist/login.test.js