Skip to content

fix(ui): avoid resending stale session agent/model selections #416#442

Open
fastknifes wants to merge 2 commits into
NeuralNomadsAI:devfrom
fastknifes:fix/session-agent-model-overrides
Open

fix(ui): avoid resending stale session agent/model selections #416#442
fastknifes wants to merge 2 commits into
NeuralNomadsAI:devfrom
fastknifes:fix/session-agent-model-overrides

Conversation

@fastknifes
Copy link
Copy Markdown

Summary

Fixes #416

CodeNomad may persist and resend stale session.agent / session.model, causing invalid subagent model selection

Problem

Previously, prompt and command requests reused session.agent and session.model directly. Those fields represent the latest known server/display state, not necessarily the user's current intent.

After subagent/session activity changed the authoritative server state, the client could keep sending outdated agent/model values with later requests, causing model lookup failures such as "Model not found".

Changes

  • Added a focused session-overrides store for explicit agent/model selections.
  • Updated prompt, command, and shell execution flows to send only explicit overrides.
  • Cleared overrides after successful consumption or authoritative message reloads.
  • Seeded initial overrides for newly created sessions so the first prompt still uses the selected agent/model.
  • Preserved the existing session existence guard for shell execution.

Validation

  • LSP diagnostics passed for modified files.
  • rtk npm build:ui completed successfully.
  • Manually verified prompt_async request payloads include structured agent/model only when explicitly selected.

Notes

The existing Vite warning from virtua/lib/solid/index.jsx is unrelated to this change and remains a third-party dependency warning.

fastknifes and others added 2 commits May 14, 2026 12:36
Track explicit session agent/model selections separately from server-observed session display state so prompts can distinguish user intent from cached metadata.

This prepares the UI to avoid resending stale session agent/model values after subagent activity changes the server-side session state.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Use the override state when sending prompts, commands, and shell requests so cached session metadata is not resent as user intent after the server changes session agent/model state.

Seed overrides for newly created sessions, clear them after successful consumption or authoritative message reloads, and keep the existing session guard for shell execution.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@fastknifes fastknifes force-pushed the fix/session-agent-model-overrides branch from 69239e5 to a560a83 Compare May 14, 2026 04:37
@fastknifes fastknifes marked this pull request as draft May 14, 2026 05:47
@fastknifes fastknifes marked this pull request as ready for review May 14, 2026 05:48
@fastknifes
Copy link
Copy Markdown
Author

@shantur

Hi, the main PR build appears to have passed, but the PR is still blocked by a failed Comment PR Artifacts / comment (pull_request_target) job.

The failure is:
PR Build Validation run 25844207807 did not complete in time.

Could you please re-run the failed workflow/job on PR #442?

@fastknifes fastknifes marked this pull request as draft May 14, 2026 09:07
@fastknifes fastknifes marked this pull request as ready for review May 14, 2026 09:08
@shantur
Copy link
Copy Markdown
Collaborator

shantur commented May 14, 2026

@fastknifes - I don't think this is the correct behavior.

Can you check how the OpenCode TUI manages the models. AFAIK, the user selected model is sent every time a prompt is sent to the server.

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.

CodeNomad may persist and resend stale session.agent / session.model, causing invalid subagent model selection

2 participants