fix(ai-agent): team model selector fallback from registry cache#185
Merged
Conversation
…available When the ACP CLI session hasn't completed its handshake yet (e.g. team members after warmup but before first message), GET /api/conversations/:id/model returned available_models: [] and current_model_label as the raw model ID. The fix uses the AgentRegistry's cached handshake data (maintained by CatalogForwarder) as a fallback source for the model enumeration. This respects the existing three-layer state model: session state remains authoritative once the handshake completes, the registry just fills the gap during the pre-handshake window. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f9bf122 to
620ccca
Compare
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.
Summary
GET /api/conversations/:id/modelreturnsavailable_models: []andcurrent_model_label: nullsend_message, but the frontend queries the model endpoint immediately after agent warmupDesign rationale
Respects the existing three-layer state model (Desired/Observed/Advertised) — no schema changes, no DB migration, no preload semantic changes. Uses the existing CatalogForwarder → Registry data flow as the pre-handshake fallback source. Once the CLI completes its handshake, live data automatically supersedes the fallback.
Changes
crates/aionui-api-types/src/acp.rs: AddDeserializetoModelInfoEntry(enables parsing from registry JSON)crates/aionui-ai-agent/src/service.rs: Add registry fallback logic inget_model+ privatemodel_info_from_registryhelperTest plan
cargo clippy --workspace— 0 warningscargo test --workspace— all passcargo fmt --all -- --check— pass🤖 Generated with Claude Code