AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

fix(frontend): ensure all agents with graph_id appear in activity dropdown

Open yashwantbezawada opened this issue 3 weeks ago β€’ 6 comments

Summary

Fixes issue where agents appear as "Unknown Agent" in the agent activity dropdown.

Root Cause

The buildAgentInfoMap function was only adding agents to the map if they had BOTH graph_id AND id fields populated. Since graph_id is used as the lookup key, agents missing the id field would not be added to the map, causing them to appear as "Unknown Agent".

Changes

Changed the condition in buildAgentInfoMap from:

if (a.graph_id && a.id) {

To:

if (a.graph_id) {

This ensures any agent with a graph_id (the lookup key) will be added to the map. The library_agent_id field remains optional.

Impact

  • All agents with valid graph_id will now appear consistently in the activity dropdown
  • Resolves the "Unknown Agent" issue mentioned in the bug report
  • No breaking changes - library_agent_id is still populated when available

Testing

Manual testing recommended: Verify agents with missing id fields now appear with their proper names instead of "Unknown Agent".

Fixes #11229

yashwantbezawada avatar Nov 08 '25 11:11 yashwantbezawada

Deploy Preview for auto-gpt-docs-dev canceled.

Name Link
Latest commit 5b1ab57433f12b4e6e7d6af9a1e670fffa2140c1
Latest deploy log https://app.netlify.com/projects/auto-gpt-docs-dev/deploys/690f25a42dfa5d000831df40

netlify[bot] avatar Nov 08 '25 11:11 netlify[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 08 '25 11:11 CLAassistant

Deploy Preview for auto-gpt-docs canceled.

Name Link
Latest commit 5b1ab57433f12b4e6e7d6af9a1e670fffa2140c1
Latest deploy log https://app.netlify.com/projects/auto-gpt-docs/deploys/690f25a4cdf3570008572360

netlify[bot] avatar Nov 08 '25 11:11 netlify[bot]

[!IMPORTANT]

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
πŸ§ͺ Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Nov 08 '25 11:11 coderabbitai[bot]

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 πŸ”΅βšͺβšͺβšͺβšͺ
πŸ§ͺΒ No relevant tests
πŸ”’Β No security concerns identified
⚑ Recommended focus areas for review

Data Consistency

Confirm that downstream consumers of the agent map do not rely on the presence of the removed 'id' field and that entries with only 'graph_id' are handled correctly throughout the UI (e.g., selection, deduping, and display logic).

if (a.graph_id) {
  map.set(a.graph_id, {
    name:
      a.name || (a.graph_id ? `Agent ${a.graph_id.slice(0, 8)}` : "Agent"),
    description: a.description || "",
Fallback Name Logic

Validate that the fallback naming using graph_id.slice(0, 8) renders as intended for all graph_id formats (e.g., non-hex or short strings) and does not regress localization or formatting expectations.

name:
  a.name || (a.graph_id ? `Agent ${a.graph_id.slice(0, 8)}` : "Agent"),

qodo-code-review[bot] avatar Nov 08 '25 11:11 qodo-code-review[bot]

Here's the code health analysis summary for commits 8058b94..5b1ab57. View details on DeepSourceΒ β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource JavaScript LogoJavaScriptβœ…Β SuccessView CheckΒ β†—
DeepSource Python LogoPythonβœ…Β SuccessView CheckΒ β†—

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.

deepsource-io[bot] avatar Nov 08 '25 11:11 deepsource-io[bot]

Thanks for the explanation! That makes sense - I misdiagnosed the root cause. The LibraryAgent type does require both fields, so the real issue is executions referencing graphs that aren't in the library (sub-agents, deleted agents, etc).

Closing this one. The Sentry logging idea you mentioned could help track how often this happens.

yashwantbezawada avatar Dec 02 '25 23:12 yashwantbezawada