feat(web): move Capture Auth button to terminal page#322
Conversation
The Capture Auth button is more actionable on the terminal page where users interact with no-auth agents directly. Shown only for running no-auth agents with a resolved harness.
There was a problem hiding this comment.
Code Review
This pull request moves the "Capture Auth" functionality from the agent detail page to the terminal page. The feedback identifies two key improvements: first, using the reactive this.agentPhase instead of the static agent.phase to ensure the button's visibility updates correctly with SSE; second, refreshing the agent state from the backend upon successful credential capture to prevent the button from remaining visible due to stale local state.
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.
| private get showCaptureAuth(): boolean { | ||
| const agent = this.agent; | ||
| if (!agent) return false; | ||
| if (agent.phase !== 'running') return false; | ||
| const isNoAuth = agent.appliedConfig?.noAuth === true || agent.harnessAuth === 'none'; | ||
| return isNoAuth && !!agent.resolvedHarness; | ||
| } |
There was a problem hiding this comment.
The showCaptureAuth getter checks agent.phase !== 'running'. However, this.agent is a static object fetched at load time and is not updated by SSE. Instead, this.agentPhase is reactive and kept in sync with SSE updates. We should use this.agentPhase to ensure the button visibility is correctly updated when the agent's phase changes.
| private get showCaptureAuth(): boolean { | |
| const agent = this.agent; | |
| if (!agent) return false; | |
| if (agent.phase !== 'running') return false; | |
| const isNoAuth = agent.appliedConfig?.noAuth === true || agent.harnessAuth === 'none'; | |
| return isNoAuth && !!agent.resolvedHarness; | |
| } | |
| private get showCaptureAuth(): boolean { | |
| const agent = this.agent; | |
| if (!agent) return false; | |
| if (this.agentPhase !== 'running') return false; | |
| const isNoAuth = agent.appliedConfig?.noAuth === true || agent.harnessAuth === 'none'; | |
| return isNoAuth && !!agent.resolvedHarness; | |
| } |
| if (result.exitCode === 0) { | ||
| alert(`Credentials captured successfully.\n\n${result.output}`); | ||
| } else if (result.exitCode === 2) { |
There was a problem hiding this comment.
When credentials are successfully captured (result.exitCode === 0), we should refresh the agent state from the backend. Otherwise, the local this.agent object remains stale, and the "Capture Auth" button will continue to be displayed even though auth has been successfully captured.
if (result.exitCode === 0) {
alert(`Credentials captured successfully.\n\n${result.output}`);
try {
const agentRes = await apiFetch(`/api/v1/agents/${this.agent.id}`);
if (agentRes.ok) {
const updatedAgent = await agentRes.json() as Agent;
this.agent = updatedAgent;
this.agentName = updatedAgent.name;
this.agentPhase = updatedAgent.phase;
this.agentActivity = updatedAgent.activity ?? '';
}
} catch (err) {
console.warn('Failed to refresh agent info after capturing auth:', err);
}
}…l page After capturing credentials, reload the agent object so the UI reflects the updated auth state — the Capture Auth button hides once the agent is no longer in no-auth mode.
Summary
Test plan
npm run typecheck)