Skip to content

refactor(site/src/pages/AgentsPage): require always-passed timeline and tool props - #29891

Merged
DanielleMaywood merged 2 commits into
mainfrom
nullability/conversation-tools
Oct 6, 2026
Merged

DanielleMaywood merged 2 commits into
mainfrom
nullability/conversation-tools

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

ChatPageTimeline is the only production caller of ConversationTimeline. It always passes streamTools, liveStatus, subagentStatusOverrides, subagentVariants, isChatCompleted, hasActiveStream, isAwaitingFirstStreamChunk and showDesktopPreviews. Every hop below it (ChatMessageItem, AssistantOutput, BlockList, Tool, the tool renderers, UserMessageContent and AttachmentBlock) forwards the subagent maps, display modes, streaming flags and preview callbacks unconditionally. The optional types, defaults, ?./?? guards and Boolean() wrappers along that path were dead.

This PR makes those props required and deletes the dead handling. AttachmentBlock.showTextStatus and RemoteTextAttachmentButton.showStatus are removed because every caller passed true. AttachmentPreviewFrame.href drops null. resolveAgentDisplayState no longer accepts an undefined mode, and useDeadlineCountdown no longer accepts an undefined deadline. An invalid deadline still returns 0 through the existing Number.isFinite check. ExecuteTool.errorText keeps its || fallback because production can send "". ToolCall.Root.expanded stays optional because undefined there means uncontrolled.

Stories and tests now pass the values production sends. ConversationTimeline stories use an idle buildLiveStatus() and empty maps. The Tool story metas set isError: false, empty subagent maps and "auto" display modes, so the screenshots do not change. ExecuteTool error stories set errorText to match their error block. The undefined case is removed from displayMode.test.ts. The ReasoningDisclosure hunk in MessageBlocks.tsx is mostly whitespace, because Biome collapsed the destructuring once the defaults were gone.

organizationId, urlTransform and mcpServers are not part of this PR. #29894, now on main, made them required through the timeline and tools.

This PR also carries #29909, which was merged into this branch as its own commit. It deletes four ToolCall props that no caller passes (Root.view, Root.onViewChange, Label.shimmerWhenActive, Header.headerClassName) and drops a redundant ternary in ProcessOutputTool. It also has one behavior change: in GenericToolRenderer, a model intent that is whitespace only used to render a blank label and now falls back to the default tool label. A test in Tool.test.tsx covers this.

Part of the AgentsPage nullability cleanup; see #29888 for the methodology. Dead slots for this cluster: 69 before, 14 after this PR. The 14 are the organizationId/urlTransform/mcpServers chain, which #29894 resolved on main.

Per-finding decisions
Finding Decision
useDeadlineCountdown.deadline Narrowed; !deadline guard removed
ToolCallRootProps.hasContent Required; = true default dropped
ReadFilesTool.expanded / onExpandedChange Required on ReadFilesTool; ToolCall.Root.expanded stays optional
CreateWorkspaceTool.created Required; created === false becomes !created
ExecuteToolProps.errorText / isBackgrounded Required; || fallback kept (empty string is possible)
ProcessOutputToolProps.processRunning Required
getSubagentLabel.showDesktopPreview, SubagentStatusIcon.iconKind / showDesktopPreview, SubagentTool.isTimeout / showDesktopPreview Required; defaults dropped
WorkspaceLifecycleToolProps.noBuild Required
ToolProps.isError / subagentTitles / subagentVariants / shellToolDisplayMode / codeDiffDisplayMode Required
Follow-on: ToolRendererProps maps and display modes, ExecuteTool/ProcessOutputTool.shellToolDisplayMode, WriteFileTool/EditFilesTool.codeDiffDisplayMode, resolveAgentDisplayState.mode Required; ?? "auto" in keys and case undefined removed
PreviewTextAttachment.fileName, InlineTextAttachmentButton.*, RemoteTextAttachmentButton.fileName / mediaType / onPreview, RemoteImageBlock.onImageClick, AttachmentBlock.onImageClick / onTextFileClick, AttachmentPreviewFrame.href Narrowed; guards removed
AttachmentBlock.showTextStatus, RemoteTextAttachmentButton.showStatus Deleted and inlined as true
ReasoningDisclosure.isStreaming / thinkingDisplayMode, BlockListProps.isStreaming / subagentTitles / subagentVariants / onImageClick / onTextFileClick / hasUserResponseAfterAskQuestion, LiveActivitySlot.interrupting Required
deriveMessageDisplayState.isAwaitingFirstStreamChunk Required
UserMessageContent.isEditing / onImageClick / onTextFileClick Required
ChatMessageItem.subagentTitles / subagentVariants Required
ConversationTimelineProps.streamTools / liveStatus / subagentStatusOverrides / subagentVariants / isChatCompleted / showDesktopPreviews / hasActiveStream / isAwaitingFirstStreamChunk Required; liveStatus guards and Boolean() wrappers removed
organizationId, urlTransform, mcpServers chain (14 slots) Not in this PR: made required on main by #29894

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

@DanielleMaywood
DanielleMaywood marked this pull request as ready for review September 25, 2026 10:55
@DanielleMaywood
DanielleMaywood requested a review from a team as a code owner September 25, 2026 10:55
@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-25T10:58:34.399807Z 8fd105a 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.

@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown

CODAGT-1258

@DanielleMaywood
DanielleMaywood force-pushed the nullability/conversation-tools branch 2 times, most recently from b074f1b to 15526c0 Compare October 6, 2026 11:12
DanielleMaywood added a commit that referenced this pull request Oct 6, 2026
… transform in timeline (#29894)

Stacked on #29890, which makes `ChatPageTimelineProps.organizationId`,
`urlTransform` and `mcpServers` required. With that in place, every
production path into the timeline passes these three values, so this PR
narrows them on `ConversationTimeline`, `ChatMessageItem`,
`LifecycleHookNotice`, `BlockList`, `ReasoningDisclosure`,
`ResponseBlock` and `Tool`. `ToolRendererProps` keeps them optional
because renderers are looked up dynamically.

Stories and tests now pass `"organization-id"`, an empty MCP server
list, and streamdown's `defaultUrlTransform`, which is what they
rendered with when the props were omitted.

These are the 14 dead slots that #29891 left behind because they
depended on #29890. This PR clears all 14. Part of the AgentsPage
nullability cleanup; see #29888 for the methodology.

---

_This PR was generated by Coder Agents on behalf of @DanielleMaywood._
…nd tool props

ChatPageTimeline always passes stream tools, live status, subagent
maps and the stream flags to ConversationTimeline, and every hop
below it (ChatMessageItem, AssistantOutput, BlockList, Tool, the tool
renderers and AttachmentBlock) forwards those values unconditionally.
The optional types, defaults and guards along that path were dead.

Narrow them to required, drop the defaults and `?.`/`??`/`Boolean()`
guards, and remove the `showTextStatus`/`showStatus` attachment props
that every caller set to true. `resolveAgentDisplayState` no longer
accepts an undefined mode, and `useDeadlineCountdown` no longer
accepts an undefined deadline.

Stories and tests now pass the values production sends.
@DanielleMaywood
DanielleMaywood force-pushed the nullability/conversation-tools branch from 15526c0 to 8035d49 Compare October 6, 2026 13:28
@DanielleMaywood
DanielleMaywood enabled auto-merge (squash) October 6, 2026 13:33
@DanielleMaywood
DanielleMaywood merged commit 0e81c4b into main Oct 6, 2026
31 checks passed
@DanielleMaywood
DanielleMaywood deleted the nullability/conversation-tools branch October 6, 2026 13: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.

2 participants