Skip to content

fix(agent-config): refresh agent registry on config apply#4294

Open
SpencerJung wants to merge 2 commits into
code-yeongyu:devfrom
SpencerJung:fix/issue-4130-connect-agent-registry
Open

fix(agent-config): refresh agent registry on config apply#4294
SpencerJung wants to merge 2 commits into
code-yeongyu:devfrom
SpencerJung:fix/issue-4130-connect-agent-registry

Conversation

@SpencerJung
Copy link
Copy Markdown
Contributor

@SpencerJung SpencerJung commented May 22, 2026

Summary

  • Reset the registered agent-name lookup before each config-agent registration pass.
  • Re-register the freshly rebuilt agent config so /connect config re-entry cannot leave stale selector aliases behind.
  • Add regression coverage for clearing aliases and for config re-application keeping OMO agents registered.

Fixes #4130

Verification

  • lsp_diagnostics on src/features/claude-code-session-state/state.ts
  • lsp_diagnostics on src/plugin-handlers/agent-config-handler.ts
  • lsp_diagnostics on src/features/claude-code-session-state/state.test.ts
  • lsp_diagnostics on src/plugin-handlers/agent-config-handler.test.ts
  • bun test src/features/claude-code-session-state/state.test.ts src/plugin-handlers/agent-config-handler.test.ts
  • bun run typecheck
  • bun run build
  • git diff --check

Summary by cubic

Refreshes the agent registry on each config apply so /connect can’t leave stale agent aliases behind. Keeps the registry aligned with the freshly rebuilt config and adds regression tests.

  • Bug Fixes
    • Clear registered agent names and aliases before re-registering from the current config.
    • Ensure current/builtin agents are re-registered; stale names are removed.
    • Add tests that verify alias clearing without losing session ownership and that re-applying config replaces stale registrations.

Written for commit 66fefc3. Summary will update on new commits. Review in cubic

SpencerJung and others added 2 commits May 22, 2026 16:57
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Copy link
Copy Markdown

@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 4 files

Confidence score: 5/5

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

Auto-approved: The PR addresses a specific bug by clearing stale agent aliases before re-registering from fresh config, with targeted changes that have no apparent side effects and are covered by regression tests.

Re-trigger cubic

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.

[Bug] OMO agents disappear from selector after /connect command in OpenCode 1.15.x

1 participant