Re-emit chat config after plugin resolution#553
Merged
ericdallo merged 2 commits intoJul 23, 2026
Merged
Conversation
…ch the editor Plugin resolution and model sync run as independent startup futures. The model-sync callback notifies the editor's agent list, but when it finishes before plugin resolution (reliably so with providers using fetchModels: false), it advertises the pre-plugin agent list and nothing refreshes it afterward, so plugin-provided agents never appear in the editor. Extract the notification into notify-chat-config-state! and call it again after deliver-plugins-resolved!. notify-fields-changed-only! diffs against the session mirror, so the extra call only emits the newly-resolved agents and is a no-op when plugins won the race.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin-provided agents (and anything from installed plugins) can be missing from
the editor's agent picker, even though the server has loaded them correctly.
Symptom: the editor shows only built-in agents (
code,plan) plus anyproject-local
.eca/agents/*agents, while plugin MCP servers still show up asavailable. Querying the server's
/api/v1/sessionshows the full agent list, sothe agents are loaded — the editor just never gets told about them.
Root cause
At
initialized, two independent futures run:config/updatednotification thatcarries the agent list (
:agents (primary-agent-names …)).reset!splugin-components*, which is what makesplugin agents visible to
config/all.These race. When model sync finishes before plugin resolution, it advertises
the pre-plugin agent list, and nothing re-emits it afterward — so plugin agents
never reach the editor. This is reliably hit with providers configured with
"fetchModels": false, since model sync then returns almost instantly andalways wins the race. (It also explains
selectAgentfalling back tocodewhen the configured
defaultAgentis a plugin agent.)Fix
config/updatedpayload building intonotify-chat-config-state!.config/all).config/deliver-plugins-resolved!in the pluginfuture.
notify-fields-changed-only!diffs against the session-level mirror, so theextra call only emits the newly-resolved agents and is a no-op when plugins won
the race. Either ordering now converges on the full agent list.
Testing
clj-kondoclean (0 errors / 0 warnings).Namespace compiles.
eca.handlers-test(12 tests / 78 assertions) andeca.features.plugins-test+eca.config-test+eca.server-test(32 tests / 260 assertions) pass.
I added a entry in changelog under unreleased section.
This is not an AI slop.