feat: add conversational display mode types#578
Conversation
| /** | ||
| * Display mode for tool calls | ||
| */ | ||
| export type ConversationalDisplayMode = 'FullTrace' | 'InputsAndOutputs' | 'ToolNameOnly'; |
There was a problem hiding this comment.
Per the conventions in agent_docs/conventions.md: "Use enums for fixed value sets — NEVER leave raw strings/numbers. Raw values lose type safety and autocomplete."
This should be an enum, not a string union:
| export type ConversationalDisplayMode = 'FullTrace' | 'InputsAndOutputs' | 'ToolNameOnly'; | |
| export enum ConversationalDisplayMode { | |
| FullTrace = 'FullTrace', | |
| InputsAndOutputs = 'InputsAndOutputs', | |
| ToolNameOnly = 'ToolNameOnly', | |
| } |
| /** Starting prompts for users to choose from */ | ||
| startingPrompts?: AgentStartingPrompt[]; | ||
| /** Display mode for tool calls */ | ||
| displayMode: ConversationalDisplayMode; |
There was a problem hiding this comment.
All other fields in AgentAppearance are optional (welcomeTitle?, welcomeDescription?, startingPrompts?), and appearance itself is optional on RawAgentGetByIdResponse. If the API can return appearance without displayMode (e.g., for agents created before this field was introduced), marking it required causes runtime undefined access.
Per conventions: "Mark optional fields as optional in type interfaces — over-requiring causes runtime undefined access on fields the API didn't return."
Unless the API guarantees displayMode is always present whenever appearance is returned, this should be:
| displayMode: ConversationalDisplayMode; | |
| displayMode?: ConversationalDisplayMode; |
Review findingsTwo issues in
|
No description provided.