Repository navigation
feat(tui): Ctrl+S in /model picker selects the swarm model; coordinator identity falls back to config default (closes #981) - #1706
Conversation
|
80fc100 to
e93f4e6
Compare
| picker.filtered = (0..picker.entries.len()).collect(); | ||
| picker.selected = picker | ||
| .entries | ||
| .iter() | ||
| .position(|entry| entry.is_current) | ||
| .unwrap_or(0); |
There was a problem hiding this comment.
When the catalog finishes loading after the two-second wait, retag_picker_for_agent_model_target drops the inherit choice and any saved override missing from the catalog. It also replaces the filtered results with all entries and resets the selection, while leaving the search text visible. Users can no longer clear the override in that picker, and Enter can save a different model from the one they selected.
The delayed-refresh test reproduced this: searching for gpt-5.5 left that search visible, but completion selected claude-fable-5, and Enter saved it as the swarm override. Reuse the full agent-picker setup during refresh, then restore the search and selected choice before merging.
Knowledge Base Used: Terminal user interface
Artifacts
Executed regression runner — swarm-refresh-run.py
- The runner temporarily gates actual catalog construction, executes the scoped cargo test, and restores tracked source files; the actual completion logic remains unchanged.
Passing regression test — swarm-refresh-regression.rs
- The executed Rust test exercises delayed completion with inherit, saved override, and active search scenarios; all three demonstrate incorrect Enter persistence.
Passing head execution — swarm-refresh-02-after.log
- The captured cargo output includes the command, working directory, exit code, terminal rendering, picker state, and saved configuration; all three candidate behaviors are confirmed.
Rendered terminal frames — swarm-refresh-02-after-frames.json
- Actual Ratatui buffer frames and observed state were captured before completion, after completion, and after Enter; they show the disappearing choices and search-selection mismatch.
Earlier search fixture source — swarm-refresh-search-first-test.rs
- This previously executed test used the original search fixture and stopped at a pre-completion assertion; its source is retained for complete execution provenance.
Earlier search fixture output — swarm-refresh-search-first-run.log
- The captured failed run confirms inherit and saved-row loss before its search setup assertion fails; the successful retry supersedes that fixture limitation.
Initial unconfigured-route test — swarm-refresh-unconfigured-first-test.rs
- The initial executed test used unavailable catalog routes; its source explains why that run could not establish override persistence.
Initial unconfigured-route output — swarm-refresh-unconfigured-first-run.log
- The captured output shows inherit disappearing but Enter rejecting an unavailable route; this was a fixture limitation rather than a separate finding.
Executed upload script — swarm-refresh-upload.py
- The executed script uploads every proof file through presigned slots, records HTTP results and hashes, and checks tracked restoration; uploads completed successfully.
Upload receipts and restoration check — swarm-refresh-upload.log
- The captured upload output records successful HTTP responses, exact artifact references, file hashes, and an empty tracked diff; evidence is uploaded and tracked changes are restored.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-tui/src/tui/app/inline_interactive/openers.rs
Line: 348-353
Comment:
**Refresh drops swarm choices**
When the catalog finishes loading after the two-second wait, `retag_picker_for_agent_model_target` drops the `inherit` choice and any saved override missing from the catalog. It also replaces the filtered results with all entries and resets the selection, while leaving the search text visible. Users can no longer clear the override in that picker, and Enter can save a different model from the one they selected.
The delayed-refresh test reproduced this: searching for `gpt-5.5` left that search visible, but completion selected `claude-fable-5`, and Enter saved it as the swarm override. Reuse the full agent-picker setup during refresh, then restore the search and selected choice before merging.
**Knowledge Base Used:** [Terminal user interface](https://app.greptile.com/solo-systems/-/custom-context/knowledge-base/1jehuang/jcode/-/docs/terminal-user-interface.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in ca7c749. Open and the late-refresh retag now share one entry-setup path, so the inherit row and a saved override missing from the catalog always survive the rebuild. The retag also restores the active filter and the selected row after rebuilding, so Enter persists the entry the user actually selected. Regression test covers a saved override with an active search and a moved selection across the refresh landing.
This comment has been minimized.
This comment has been minimized.
a79dcda to
023dc4b
Compare
Ctrl+S inside the /model picker opens the swarm model sub-picker, so the swarm model is discoverable from the main model flow instead of only via agents.swarm_model. With no override saved, spawned agents inherit the current session model. Also fixes the coordinator identity root cause: when the persisted session cannot be loaded and spawn identity has no model, it falls back to the config default model instead of silently resolving to a provider default. A late catalog load rebuilt the ordinary model picker on completion and agent pickers lost their tags, so Enter could switch the session model instead of saving the override; open and retag now share one entry-setup helper and the retag restores the inherit row, saved overrides missing from the catalog, the filter and the selection. Provider-init tests stop discarding the env values they clear, the Ollama restore list gains the three profile vars it was missing, and the model config literal drops a no-op ..Default::default() that clippy flags since every field is already spelled out. The remote-save concern needs server-side config sync to fix properly and stays a follow-up. Closes 1jehuang#981.
023dc4b to
a5cf17e
Compare
Closes #981.
Ctrl+S inside the /model picker opens the swarm model sub-picker, so the swarm model is discoverable from the main model flow instead of only via the
agents.swarm_modelconfig. With no override saved, spawned agents inherit the current session model.Also fixes the coordinator identity root cause from #981: when the persisted session cannot be loaded and
resolve_coordinator_spawn_identityhas no model, spawn identity now falls back to the config default model instead of silently resolving to a provider default.Tests:
comm_session_testscovers the identity fallback (37/37 pass), TUI tests cover Ctrl+S opening the swarm sub-picker from the model picker and not firing outside it, and provider-init tests are isolated from user env vars so they pass on machines with provider profiles configured. Single commit rebased onto current master.