Skip to content

fix(site/src/pages/AgentsPage/components/ChatElements/tools): delete unreachable WaitForExternalAuth tool code - #27684

Merged
DanielleMaywood merged 1 commit into
mainfrom
danielle/remove-wait-for-external-auth
Jul 30, 2026
Merged

fix(site/src/pages/AgentsPage/components/ChatElements/tools): delete unreachable WaitForExternalAuth tool code#27684
DanielleMaywood merged 1 commit into
mainfrom
danielle/remove-wait-for-external-auth

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Contributor

The backend never emits a wait_for_external_auth tool call (no references in any Go source, the chatd tool registry, or anywhere outside the frontend), so the entire frontend rendering path for it was unreachable.

Removes the WaitForExternalAuthTool component, its renderer and toolRenderers entry, the ToolIcon case, and the four Storybook stories, along with the imports that only they used (CheckIcon, LoaderIcon, LogInIcon, and toProviderLabel in Tool.tsx).

Kept the separate, live execute auth-required flow: ExecuteAuthRequiredTool and the toProviderLabel usage in toolVisibility.ts belong to the authenticateURL path, not this dead tool.

Refs #27593

🤖 This pull request was created with Coder Agents.

…unreachable WaitForExternalAuth tool code

The backend never emits a wait_for_external_auth tool call, so the
renderer, component, icon case, and stories could never fire. Remove
them and the now-unused imports.
@DanielleMaywood

Copy link
Copy Markdown
Contributor Author

/coder-agents-review model:kimi-k3 thinking:xhigh

@coder-agents-review

coder-agents-review Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-07-30 13:03 UTC by @DanielleMaywood
Spend: $6.52 / $100.00

Review history
  • R1 (2026-07-30): 7 reviewers, 5 Note, APPROVE. Review

deep-review v0.9.0 | Round 1 | e819dd4..0109850

Last posted: Round 1, 5 findings (5 Note), APPROVE. Review

Finding inventory

Finding inventory, PR #27684

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 Note Open ExecuteTool.tsx Second deletion of same dead code (bb3a363 deleted, 4bf9b9d reintroduced) R1 Netero Yes
CRF-2 Note Open ExecuteTool.tsx:225 Kept ExecuteAuthRequiredTool/auth_required path has no backend emitter; same never-shipped flow R1 Pariston, Zoro Yes
CRF-3 Note Open Tool.tsx:1036 toolRenderers has no invariant tying entries to backend-emittable tools; third residue cleanup R1 Pariston Yes
CRF-4 Note Open Tool.tsx:1036 Unknown tool names fall through to generic renderer; degraded rendering not crash if backend regrows tool R1 Nami Yes
CRF-5 Note Open ExecuteTool.tsx PR/commit messages correctly distinguish dead tool from live ExecuteAuthRequiredTool path R1 Leorio Yes

Round log

Round 1

Panel (13 reviewers): Bisky, Hisoka, Mafu-san, Mafuuu, Pariston, Ging-react, Melody, Nami, Zoro, Knuckle, Komugi, Leorio, Luffy. Netero first pass: no findings. Panel: zero defects (no P0-P4, no Nits). 5 Notes: 1 informational resurrection warning (Netero), 2 convergent notes that the kept auth_required sibling path has no Go emitter (verified by orchestrator: only codersdk.TemplateVersionExternalAuth matches), 2 structural/positive notes. Reviewed against e819dd4..0109850.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Komugi flake/determinism
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean deletion, independently verified by the full panel: the premise holds (zero references to wait_for_external_auth in any Go source or the chatd tool registry at base and HEAD), the removal is complete (component, renderer, registry entry, icon case, stories, and all four orphaned imports), and the look-alike live ExecuteAuthRequiredTool/toProviderLabel flow was correctly identified and preserved. tsc --noEmit, biome, and the tools unit tests (160 passing) all confirm nothing dangles. As Luffy put it: "prove nobody calls it, take the whole costume off, keep the parts with a pulse."

No defects found (0 P0-P4, 0 Nits). Five notes below, all informational; the only one that may warrant action is CRF-2, which suggests the kept auth_required sibling path is dead by the same argument this PR just proved, and is worth a follow-up check against the chatd execute tool.


site/src/pages/AgentsPage/components/ChatElements/tools/ExecuteTool.tsx:224

Note [CRF-1] This is the second deletion of the same dead code. Commit bb3a363 ("delete the never-shipped external auth flow") already removed WaitForExternalAuthTool once; commit 4bf9b9d (#27430) reintroduced it, consistent with resurrection from a stale pre-cleanup branch during merge or rebase. Nothing to fix in this PR, but if wait_for_external_auth code reappears a third time, the source is long-lived branches forked before bb3a363. (Netero)

🤖

site/src/pages/AgentsPage/components/ChatElements/tools/ExecuteTool.tsx:224

Note [CRF-2] The kept ExecuteAuthRequiredTool and the toProviderLabel chain in toolVisibility.ts parse an auth_required execute-result payload that history says was removed from the backend on the same unmerged branch as wait_for_external_auth. I verified: grep -rn "auth_required" over all Go sources at HEAD returns zero matches, and authenticate_url exists only on the unrelated codersdk.TemplateVersionExternalAuth type. (Pariston, Zoro)

Orchestrator judgment: the verification holds up; the PR's own premise (no server emitter, frontend-only leftovers) applies with equal force to the path it keeps. The PR's stated scope is the wait_for_external_auth tool and the kept code is unchanged behavior, not a regression, so this is a note, not a defect. But it should not silently persist: this needs a human decision. Either confirm against the chatd execute tool's result construction and file a ticket for the sibling deletion (the ExecuteAuthRequiredTool component, the authenticateURL branch in getExecuteRenderData, the ExecuteAuthRequired story, and then-dead toProviderLabel plus its test block), or cite the backend emitter that keeps this path live.

🤖

🤖 This review was automatically generated with Coder Agents.

Comment thread site/src/pages/AgentsPage/components/ChatElements/tools/Tool.tsx
Comment thread site/src/pages/AgentsPage/components/ChatElements/tools/Tool.tsx

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review. I verified both notes independently before responding.

CRF-1 (resurrection): Confirmed. This is the second deletion of the same code. bb3a363ed4 removed WaitForExternalAuthTool and the auth_required flow together; 4bf9b9d1e6 (#27430) brought the wait_for_external_auth half back, consistent with a stale pre-cleanup branch. Agreed the fix is process-side: watch for long-lived branches forked before bb3a363ed4.

CRF-2 (kept auth_required path): Confirmed dead by the same premise. The chatd ExecuteResult struct (coderd/x/chatd/chattool/execute.go:79-88) has no auth_required, authenticate_url, or provider_* fields, so the execute tool cannot emit the payload ExecuteAuthRequiredTool / getExecuteRenderData parse. The authenticate_url matches elsewhere in Go are the unrelated workspace-creation external-auth flow (codersdk.TemplateVersionExternalAuth), not this tool. Per bb3a363ed4's own message, the auth_required execute payload was written and removed on an unmerged branch before #22290 squash merged, so no server version ever emitted it.

I deliberately scoped this PR to wait_for_external_auth only, since that is what was asked. The sibling deletion (ExecuteAuthRequiredTool, the authenticateURL branch in getExecuteRenderData, the ExecuteAuthRequired story, then-dead toProviderLabel and its test block, plus the auth_required cases in toolVisibility.test.ts) is a clean follow-up. Happy to take it as a separate PR to keep this one reviewable; let me know if you'd rather I fold it in here.

🤖 This comment was generated with Coder Agents.

@DanielleMaywood
DanielleMaywood merged commit 4003f00 into main Jul 30, 2026
53 of 54 checks passed
@DanielleMaywood
DanielleMaywood deleted the danielle/remove-wait-for-external-auth branch July 30, 2026 15:20
DanielleMaywood added a commit that referenced this pull request Jul 30, 2026
…dead execute auth_required flow (#27687)

Stacked on #27684. Addresses review note CRF-2 from that PR: the kept
`auth_required` execute path is dead by the same premise that PR proved
for `wait_for_external_auth`.

The chatd execute tool's `ExecuteResult` struct
(`coderd/x/chatd/chattool/execute.go:79-88`) has no `auth_required`,
`authenticate_url`, or `provider_*` fields, so the execute tool cannot
emit the payload this path parsed. The `authenticate_url` matches
elsewhere in Go are the unrelated workspace-creation external-auth flow
(`codersdk.TemplateVersionExternalAuth`). Per `bb3a363ed4`, the
`auth_required` execute payload was written and removed on an unmerged
branch before #22290 squash merged, so no server version ever emitted
it.

Removes:
- `ExecuteAuthRequiredTool` and its `ExecuteRenderer` branch
- the `authenticateURL`/`providerLabel` chain in `getExecuteRenderData`,
and the `Boolean(data.authenticateURL)` disjunct in
`shouldRenderExecuteTool`
- the `ExecuteAuthRequired` Storybook story
- the now-dead `toProviderLabel` helper and its test block
- the `auth_required` visibility test case

The `providerLabel` identifiers elsewhere under `site/src`
(ModelSelector, ModelRow, AISettings) belong to the unrelated AI
model/provider selector and are untouched.

🤖 This pull request was created with Coder Agents.
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants