Skip to content

fix(agents): retain original agent keys in remapAgentKeysToDisplayNames to prevent crash#2142

Merged
code-yeongyu merged 1 commit intodevfrom
fix/issue-1922-retain-agent-keys
Feb 26, 2026
Merged

fix(agents): retain original agent keys in remapAgentKeysToDisplayNames to prevent crash#2142
code-yeongyu merged 1 commit intodevfrom
fix/issue-1922-retain-agent-keys

Conversation

@code-yeongyu
Copy link
Owner

@code-yeongyu code-yeongyu commented Feb 26, 2026

Problem

remapAgentKeysToDisplayNames drops original agent keys, causing crashes when agents are accessed by original keys.

Root Cause

The function replaces original keys with display names but doesn't retain the original key mappings.

Fix

Keep both original key and display name key in the agents map.

Validation

  • bun test src/shared/ --timeout 30000
  • bun run typecheck
  • bun run build

Closes #1922


Summary by cubic

Retain original agent keys when remapping to display names to prevent crashes when agents are accessed by their original keys. Resolves Linear #1922.

  • Bug Fixes
    • Keep both original and display name keys in the agents map.
    • Update tests to confirm original keys remain and reference the same agent as the display name.

Written for commit df02c73. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: The change is purely additive, ensuring original keys remain accessible alongside display names. Tests confirm correct behavior and no regressions in existing lookups.

@code-yeongyu code-yeongyu merged commit 86fcade into dev Feb 26, 2026
8 checks passed
@code-yeongyu code-yeongyu deleted the fix/issue-1922-retain-agent-keys branch February 26, 2026 12:04
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.

remapAgentKeysToDisplayNames drops original agent keys, causing Agent.get() to return undefined

1 participant