Skip to content

refactor(site/src/pages/AgentsPage): drop dead chat page null checks - #29907

Merged
DanielleMaywood merged 1 commit into
nullability/chat-inputfrom
nullability/chat-page-cleanups
Oct 6, 2026
Merged

DanielleMaywood merged 1 commit into
nullability/chat-inputfrom
nullability/chat-page-cleanups

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #29890.

Removes three null checks in the chat page that production can never hit. No behavior or DOM change.

  • ChatPageInput (ChatPageContent.tsx): chat is a required TypesGen.Chat, so chat.id is always a string. Dropped both chatId ?? "" fallbacks and the chatId ? handler : undefined ternary around the refresh-context handler. The story and test render with id: "" so that the queries stay disabled. The refresh button only shows when the context has changed or errored, so they still render the same.
  • AgentChatPageView.tsx: workspace ? getAgentBrowserApp(workspaceAgent) : undefined becomes getAgentBrowserApp(workspaceAgent). AgentChatPage derives workspaceAgent with getWorkspaceAgent(workspace, id), which returns undefined when there is no workspace. getAgentBrowserApp(undefined) also returns undefined, so the result is the same.
  • AgentChatInput.tsx: inside showAgentSetupNotice &&, the check (aiGatewayDisabled || (providerCount !== undefined && modelCount !== undefined)) && canConfigureAgentSetup becomes canConfigureAgentSetup. When canConfigureAgentSetup is true, showAgentSetupNotice already requires either aiGatewayDisabled or both counts defined.

Part of the AgentsPage nullability cleanup; see #29888 for the methodology.

Verified: pnpm lint:types, check, lint:oxlint, lint:compiler, lint:knip, and test:storybook on the ChatPageContent, AgentChatPageView, and AgentChatInput stories all pass. pnpm test src/pages/AgentsPage: everything passed except a timeout in ChatSharingPopover.test.tsx (untouched here) while the machine was under load. It passes when run on its own.

Plan excerpt

8. Top-down pass proposals

Analysed on a local, unpushed merge of all cleanup branches; ranking script topdown.cjs. After the bottom-up PRs only 43 dead slots remain, so what's left is nullability that is real at its origin. Two read-only agents reviewed the top origins in code. Guard counts from the tool overstate the win: many "guards" are real branches (loading, no workspace, first/last row).

# Change Guards removed Size Risk
T7 Trivial cleanups: dead chatId ??/ternary in ChatPageInput; 4 never-passed ToolCall props; redundant workspace ? at AgentChatPageView.tsx:459; redundant ternary in ProcessOutputTool; redundant count check at AgentChatInput.tsx:1142 ~12 ~5 files / ~30 lines None, except Tool.tsx:1017 || fallback changes whitespace-only intents to show the default label (a fix)

The ToolCall, ProcessOutputTool, and Tool.tsx parts of T7 are in #29909, stacked on #29891.


This PR was generated by Coder Agents on behalf of @DanielleMaywood.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T14:15:42.912821Z 1f038d4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DanielleMaywood
DanielleMaywood force-pushed the nullability/chat-page-cleanups branch from 1f038d4 to 7dca451 Compare September 29, 2026 14:54
@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown

CODAGT-1258

@DanielleMaywood
DanielleMaywood merged commit d8a8364 into nullability/chat-input Oct 6, 2026
27 checks passed
@DanielleMaywood
DanielleMaywood deleted the nullability/chat-page-cleanups branch October 6, 2026 07:37
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 6, 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.

3 participants