Skip to content

fix: handle missing agent config in conversation tabs#1920

Open
janburzinski wants to merge 1 commit intogeneralaction:mainfrom
janburzinski:emdash/no-logo-error-h6hbd
Open

fix: handle missing agent config in conversation tabs#1920
janburzinski wants to merge 1 commit intogeneralaction:mainfrom
janburzinski:emdash/no-logo-error-h6hbd

Conversation

@janburzinski
Copy link
Copy Markdown
Collaborator

summary

if agentConfig has no entry for conversations provider ew just dont read the logo

this fixes the unexpected "Something went wrong Cannot read properties of undefined (reading 'logo')"

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 7, 2026

Greptile Summary

This PR adds a one-line null guard in renderTabPrefix inside ConversationsTabs so that if a conversation's providerId has no matching entry in agentConfig, the function returns null instead of crashing with a property-read error on undefined.

  • Adds if (!config) return null; before any property access on the agentConfig lookup result, directly fixing the reported crash.
  • No other logic is changed; the fix is narrowly scoped to the tab-prefix rendering path.

Confidence Score: 5/5

Safe to merge — a minimal, targeted guard that prevents a runtime crash without altering any other behavior.

The change is a single defensive check in a UI rendering callback. When a providerId stored in the database has no entry in agentConfig (e.g., a newly registered or removed provider), the tab simply renders without a logo prefix rather than crashing. There are no logic changes, no state mutations, and no side effects introduced.

No files require special attention.

Important Files Changed

Filename Overview
src/renderer/features/tasks/conversations/conversation-tabs.tsx Adds a null guard before accessing config.logo in renderTabPrefix to prevent crashes when a conversation's providerId has no matching entry in agentConfig.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["renderTabPrefix(s)"] --> B["config = agentConfig[s.data.providerId]"]
    B --> C{config exists?}
    C -- No --> D["return null (no logo rendered)"]
    C -- Yes --> E["Render AgentLogo with config.logo, alt, isSvg, invertInDark"]
    E --> F["Tab prefix displayed"]
Loading

Reviews (1): Last reviewed commit: "fix: handle missing agent config in conv..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant