Skip to content

feat(web): move Capture Auth button to terminal page#322

Closed
ptone wants to merge 2 commits into
mainfrom
scion/capture-auth-terminal
Closed

feat(web): move Capture Auth button to terminal page#322
ptone wants to merge 2 commits into
mainfrom
scion/capture-auth-terminal

Conversation

@ptone

@ptone ptone commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Moved the "Capture Auth" button from the agent detail page header to the terminal page toolbar
  • Button only appears for running no-auth agents with a resolved harness
  • More actionable placement since users interact with no-auth agents directly in the terminal

Test plan

  • Verify Capture Auth button no longer appears on agent detail page
  • Verify Capture Auth button appears on terminal page for no-auth running agents
  • Verify button is hidden for agents with auth configured
  • Verify TypeScript compiles cleanly (npm run typecheck)

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment on lines +775 to +781
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;
}

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

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.

Suggested change
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;
}

Comment on lines +804 to +806
if (result.exitCode === 0) {
alert(`Credentials captured successfully.\n\n${result.output}`);
} else if (result.exitCode === 2) {

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

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.
@ptone ptone closed this Jun 28, 2026
@ptone ptone deleted the scion/capture-auth-terminal branch June 28, 2026 12:11
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.

1 participant