Skip to content

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

Merged
code-yeongyu merged 2 commits into
code-yeongyu:devfrom
SpencerJung:fix/issue-4130-connect-agent-registry
Jun 2, 2026
Merged

code-yeongyu merged 2 commits into
code-yeongyu:devfrom
SpencerJung:fix/issue-4130-connect-agent-registry

Conversation

@SpencerJung

@SpencerJung SpencerJung commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown

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

@code-yeongyu
code-yeongyu force-pushed the dev branch 2 times, most recently from eb25d29 to 2bfad49 Compare May 23, 2026 16:00
@code-yeongyu

Copy link
Copy Markdown
Owner

[sisyphus-dev] I confirmed #4130 as a real lifecycle/registry bug and am verifying this PR against current dev in an isolated worktree. If the focused tests still pass and mergeability holds, I will merge it under the bug-sweep policy.

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

2 participants