fix(site/src/pages/AgentsPage/components/ChatElements/tools): delete dead execute auth_required flow - #27687
Conversation
…dead execute auth_required flow The chatd execute tool's ExecuteResult has no auth_required, authenticate_url, or provider_* fields, so the execute tool cannot emit the payload this path parsed. Per bb3a363, that payload was written and removed on an unmerged branch before #22290 squash merged, so no server version ever emitted it. Remove ExecuteAuthRequiredTool and its ExecuteRenderer branch, the authenticateURL/providerLabel chain in getExecuteRenderData, the ExecuteAuthRequired story, the now-dead toProviderLabel helper and its test block, and the auth_required visibility test case.
|
/coder-agents-review model:kimi-k3 thinking:xhigh |
|
Chat: Review posted | View chat Review historydeep-review v0.9.0 | Round 2 | Last posted: Round 2, 5 findings (1 P3, 1 P4, 3 Note), COMMENT. Review Finding inventoryFinding inventory: PR #27687Findings
Contested and acknowledgedCRF-3 (Note, Tool.stories.tsx) - ExecuteAuthRequired stories on unmerged branch 28381f5
Round logRound 1Panel (14 reviewers). Netero: no findings. Panel: 1 P3, 2 Notes. Reviewed against 0109850..c8f0999. Round 2Churn guard: PROCEED (CRF-1, CRF-2 author fixed in a6b6001; CRF-3 acknowledged). Reviewed against 0109850..a6b6001. Round 2 panelNetero: no findings. Panel (Bisky, Komugi, Gon, Mafuuu, Kite): 1 P4 (downgraded from Gon P2: doc comment untouched by diff, pre-existing text), 1 Note new. All prior findings verified fixed or acknowledged. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
Clean deletion. The premise was verified against the producer (ExecuteResult in coderd/x/chatd/chattool/execute.go has no auth_required, authenticate_url, or provider_* fields), the merge history (bb3a363ed4 documents the payload lived and died on an unmerged branch before #22290 squash-merged), and a repo-wide grep (zero remaining emitters or consumers). Every removed piece went with its pair: component with registry branch, helper with its only caller and test, story with its spyOn import, visibility disjunct with the field it read. tsc --noEmit and the 142 tests in the touched files pass. The failing Pixel / Review check is the expected snapshot-baseline removal for the deleted story.
Findings: 1 P3, 2 Notes.
The P3 is the one loose thread: this PR proves the same premise as the commit it cites, but re-creates the shouldRenderExecuteTool wrapper that commit deleted. As Leorio put it: "This PR proves the same premise (no auth_required payload can arrive) and then re-creates the wrapper it just finished amputating."
In reply to IC_kwDOGkVX1s8AAAABMeCwQw:
Note [CRF-3] Tool.stories.tsx - An unmerged branch (28381f5de2, "mark chat tool calls a lifecycle hook rewrote", on origin/mike/chat-hooks-uat/*) still adds two ExecuteAuthRequiredRewrittenByHook/ExecuteAuthRequiredNotRewrittenByHook stories on top of the component this PR deletes. (Pariston)
Why it matters: whoever merges that branch after this one gets a textual conflict and, worse, stories referencing a component and payload that no longer exist. The dead fixture already attracted one dependent. Worth a heads-up to that branch's author so the stories are dropped there rather than resurrected through a careless conflict resolution. Not a defect in this PR; flagging so the collision is visible before it lands.
🤖
🤖 This review was automatically generated with Coder Agents.
…the execute visibility check Review feedback: bb3a363 already deleted the shouldRenderExecuteTool wrapper and inlined the command check at its single call site. Inline it again rather than re-create a one-line named predicate, and collapse the blank line left where the auth branch was removed.
|
Thanks. Both in-scope items addressed in a6b6001. P3 (CRF-1): Fair catch, and slightly embarrassing. I cited Note (CRF-2): Collapsed the leftover blank line in Note (CRF-3): Out of my control from here, but worth surfacing. The unmerged 🤖 This comment was generated with Coder Agents. |
|
/coder-agents-review model:kimi-k3 thinking:xhigh |
There was a problem hiding this comment.
Round 2. Both in-scope items from round 1 verified fixed in a6b60011f6: CRF-1's shouldRenderExecuteTool wrapper is gone with the check inlined at the single call site (matching the end state bb3a363ed4 established), and CRF-2's stray blank line is collapsed. CRF-3 (stories on the unmerged mike/chat-hooks-uat/* branch) is correctly out of this PR's hands; the author's flag to the branch owner is the only available action.
Findings this round: 1 P4, 1 Note, both from Gon on naming/comment tightening. Kite's summary of the R2 amend: "the PR does exactly one thing (delete the dead execute auth_required flow) across its 7 files; the R2 amend commit only removes the wrapper and blank line the panel flagged."
tsc --noEmit, Biome, and the 142 touched unit tests all pass at head.
🤖 This review was automatically generated with Coder Agents.
Stacked on #27684. Addresses review note CRF-2 from that PR: the kept
auth_requiredexecute path is dead by the same premise that PR proved forwait_for_external_auth.The chatd execute tool's
ExecuteResultstruct (coderd/x/chatd/chattool/execute.go:79-88) has noauth_required,authenticate_url, orprovider_*fields, so the execute tool cannot emit the payload this path parsed. Theauthenticate_urlmatches elsewhere in Go are the unrelated workspace-creation external-auth flow (codersdk.TemplateVersionExternalAuth). Perbb3a363ed4, theauth_requiredexecute payload was written and removed on an unmerged branch before #22290 squash merged, so no server version ever emitted it.Removes:
ExecuteAuthRequiredTooland itsExecuteRendererbranchauthenticateURL/providerLabelchain ingetExecuteRenderData, and theBoolean(data.authenticateURL)disjunct inshouldRenderExecuteToolExecuteAuthRequiredStorybook storytoProviderLabelhelper and its test blockauth_requiredvisibility test caseThe
providerLabelidentifiers elsewhere undersite/src(ModelSelector, ModelRow, AISettings) belong to the unrelated AI model/provider selector and are untouched.🤖 This pull request was created with Coder Agents.