Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions app/chat/components/agent-tools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ export function AgentTools({ tools, className }: AgentToolsProps) {
<CompanyProfileCard
key={`${id}-${toolName}-${toolState}-${groupIdx}`}
toolCallId={id}
input={latest.input as any}
output={latest.output as any}
input={latest.input as PolygonStockQuotesUITool['input']}
output={latest.output as PolygonStockQuotesUITool['output']}
errorText={errorText}
/>
)
Expand All @@ -294,8 +294,8 @@ export function AgentTools({ tools, className }: AgentToolsProps) {
<CommitHistoryList
key={`${id}-${toolName}-${toolState}-${groupIdx}`}
toolCallId={id}
input={latest.input as any}
output={latest.output as any}
input={latest.input as ListCommitsUITool['input']}
output={latest.output as ListCommitsUITool['output']}
errorText={errorText}
/>
)
Expand All @@ -309,59 +309,59 @@ export function AgentTools({ tools, className }: AgentToolsProps) {
>
<WeatherCard
toolCallId={id}
input={latest.input as { location: string }}
input={latest.input as WeatherUITool['input']}
output={latest.output as any}
errorText={errorText}
/>
<ForecastView
toolCallId={id}
input={latest.input as { location: string }}
input={latest.input as WeatherUITool['input']}
output={latest.output as any}
errorText={errorText}
/>
</div>
)
}

if (
Copy link

Choose a reason for hiding this comment

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

question (bug_risk): Commenting out the SerpAPI/Finnhub news and search UI branches changes UX and may be an unintentional regression.

NewsCarousel and SearchResultList handling for serpapi-news-trends, finnhub-company-news, and serpapi-search is now entirely commented out, so those tool calls will use the generic renderer instead, changing the UI. If this is intentional, consider a feature flag or explicit runtime check rather than commenting out code; if not, it’s likely an accidental regression to revert or adjust.

(toolName === 'serpapi-news-trends' ||
toolName === 'finnhub-company-news') &&
hasOutput
) {
return (
<NewsCarousel
key={`${id}-${toolName}-${toolState}-${groupIdx}`}
toolCallId={id}
input={latest.input as any}
output={latest.output as any}
errorText={errorText}
/>
)
}
// if (
// (toolName === 'serpapi-news-trends' ||
// toolName === 'finnhub-company-news') &&
// hasOutput
// ) {
// return (
// <NewsCarousel
// key={`${id}-${toolName}-${toolState}-${groupIdx}`}
// toolCallId={id}
// input={latest.input as any}
// output={latest.output as any}
// errorText={errorText}
// />
// )
// }
Comment on lines +326 to +340
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Remove commented-out code.

Per coding guidelines: "Never comment out code; remove it instead and use version control history if needed." These commented blocks for NewsCarousel and SearchResultList should be deleted.

♻️ Proposed fix - remove commented code
-              //  if (
-               //     (toolName === 'serpapi-news-trends' ||
-              //          toolName === 'finnhub-company-news') &&
-              //      hasOutput
-             //   ) {
-              //      return (
-              //          <NewsCarousel
-              //              key={`${id}-${toolName}-${toolState}-${groupIdx}`}
-              //              toolCallId={id}
-              //              input={latest.input as any}
-              //              output={latest.output as any}
-              //              errorText={errorText}
-              //          />
-              //      )
-              //  }
...
-               // if (toolName === 'serpapi-search' && hasOutput) {
-                //    return (
-                //        <SearchResultList
-                //            key={`${id}-${toolName}-${toolState}-${groupIdx}`}
-                 //           toolCallId={id}
-                 //           input={latest.input as any}
-                 //           output={latest.output as any}
-                //            errorText={errorText}
-                //        />
-                //    )
-             //   }

Also applies to: 354-364

🤖 Prompt for AI Agents
In `@app/chat/components/agent-tools.tsx` around lines 326 - 340, Remove the
commented-out UI blocks for NewsCarousel and SearchResultList in the
agent-tools.tsx component: delete the commented code that references
NewsCarousel (the block containing key
`${id}-${toolName}-${toolState}-${groupIdx}`, toolCallId, input, output,
errorText) and the similar commented SearchResultList block (the other commented
range noted); keep the surrounding logic intact and rely on git history if
restoration is needed.


if (toolName === 'arxiv-search' && hasOutput) {
return (
<ArxivPaperCard
key={`${id}-${toolName}-${toolState}-${groupIdx}`}
toolCallId={id}
input={latest.input as any}
output={latest.output as any}
input={latest.input as ArxivUITool['input']}
output={latest.output as ArxivUITool['output']}
errorText={errorText}
/>
)
}

if (toolName === 'serpapi-search' && hasOutput) {
return (
<SearchResultList
key={`${id}-${toolName}-${toolState}-${groupIdx}`}
toolCallId={id}
input={latest.input as any}
output={latest.output as any}
errorText={errorText}
/>
)
}
// if (toolName === 'serpapi-search' && hasOutput) {
// return (
// <SearchResultList
// key={`${id}-${toolName}-${toolState}-${groupIdx}`}
// toolCallId={id}
// input={latest.input as any}
// output={latest.output as any}
// errorText={errorText}
// />
// )
// }

// Default rendering for other tools
return (
Expand Down
2 changes: 2 additions & 0 deletions app/chat/components/chat-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export function ChatInput() {
messages,
usage,
createCheckpoint,

} = useChatContext()

const [input, setInput] = useState('')
Expand Down Expand Up @@ -124,6 +125,7 @@ export function ChatInput() {
<span className="flex items-center gap-1.5">
<BotIcon className="size-3" />
{agentConfig?.name ?? selectedAgent}

</span>
<span className="flex items-center gap-1.5">
<CpuIcon className="size-3" />
Expand Down
Loading
Loading