fix(cli): avoid Agent Relay lookup for saved token workspace - #397
fix(cli): avoid Agent Relay lookup for saved token workspace#397khaliqgant wants to merge 1 commit into
Conversation
loadDelegatedCredentialsForRequest invoked the real agent-relay CLI for credential discovery before checking whether a saved token workspace already had usable delegated credentials, blocking in exec.Cmd.Wait. When a token-derived workspace value is empty and legacy delegated credentials already satisfy the requested scopes, use them directly instead of shelling out. Fixes #389. Verified independently: - go test ./cmd/relayfile-cli/... -run TestReadUsesTokenWorkspaceWhenWorkspaceArgOmitted -v -count=1 (0.04s, was ~6s before) - go test ./cmd/relayfile-cli/... -count=1
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Relayfile Eval ReviewRun: Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0 Human Review CasesNo reviewable human-review cases captured Relayfile output. |
Fixes #389.
`loadDelegatedCredentialsForRequest` invoked the real `agent-relay` CLI for credential discovery before checking whether a saved token workspace already had usable delegated credentials, blocking in `exec.Cmd.Wait` — this is what caused `TestReadUsesTokenWorkspace`-family tests to hang. When a token-derived workspace value is empty and legacy delegated credentials already satisfy the requested scopes, use them directly instead of shelling out.
Test plan