Skip to content

fix: initialize the web composer with its configured model - #840

Open
knqiufan wants to merge 5 commits into
EverMind-AI:mainfrom
knqiufan:fix/web_model_initialization
Open

knqiufan wants to merge 5 commits into
EverMind-AI:mainfrom
knqiufan:fix/web_model_initialization

Conversation

@knqiufan

@knqiufan knqiufan commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The web composer initially displayed hardcoded minimax-m3 until a full provider catalogue finished loading, even when another model was configured. Read the actual model/provider selection immediately after the gateway handshake, independently of catalogue building and provider probes when the gateway supports it.

  • Add optional model.options.include_providers with its existing full-catalogue behavior as the default. Advertise selection-only support through system.hello.server_capabilities; older strict gateways receive their original parameters and share one full catalogue request.
  • Show loading, empty and retry states. Permit sending once the selection arrives, and keep a known selection usable during background refreshes of the same view. First reads and navigation to another session or a new draft still wait for that view's selection.
  • Allow settings role pickers to use their available rows while the composer's catalogue refreshes. Keep New Task available during selection loading or failure, retain provider-setup redirects, and clear catalogue loading state if a gateway call throws synchronously.
  • Preserve session bindings, forced default providers and staged draft picks. Ignore responses superseded by navigation or a local pick, and prevent slow catalogues from overwriting the selection.
  • Update fixtures, generated web/TUI contracts, bilingual messages and user-facing documentation. Reuse the existing path helper in the CSS gate so the full frontend suite also runs on Windows.

Type

  • Fix
  • Feature
  • Docs
  • CI / tooling
  • Refactor
  • Other

Verification

  • Relevant tests pass locally
  • Relevant lint / type checks pass locally
  • User-facing docs or screenshots are updated when needed

Commands below were run on Windows against the updated branch. Python tests used PYTHONUTF8=1.

At repository root:

  • uv run --no-sync pytest tests/test_rpc_model.py tests/test_rpc_schema_match.py -x -q -n 0: 646 passed.
  • uv run --no-sync pytest tests/test_rpc_system.py -k 'hello or ping or version or dispatcher' -x -q -n 0: 26 passed, 14 deselected.
  • uv run --no-sync python ui-web/build.py: passed both boot snapshots, with 343 stub nodes and 342 live nodes matching the goldens.
  • uv run --no-sync python scripts/check_source_language.py origin/main..HEAD: passed.
  • uv run --no-sync python scripts/check_large_files.py origin/main..HEAD: passed.
  • uv run --no-sync python scripts/check_commit_messages.py HEAD^..HEAD: passed.
  • git diff --check: passed.

In ui-web:

  • npm.cmd test -- --maxWorkers=2 --testTimeout=20000: 3,231 passed across 215 suites. Includes real composer sends during background refreshes on current and strict legacy gateways, navigation/readiness, stale responses, retry, handshake changes, and settings role selection during catalogue loading.
  • npm.cmd run gen:check: 205 methods matched the wire contract.
  • npm.cmd run type-check, npm.cmd run build: passed.
  • npm.cmd run lint: 0 errors, 4 existing React hook warnings.

In ui-tui:

  • npm.cmd run lint:rpc, npm.cmd run lint:i18n: generated files matched their contracts.

Open Code Review also completed a focused re-review of all five selected files with the configured LLM: no critical, high or medium findings, and one optional documentation suggestion.

Risk

  • Security impact considered
  • Backward compatibility considered
  • Rollback path is clear for risky changes

The new read mode is read-only and returns no provider credentials. Existing RPC callers retain full catalogue responses by default; web clients negotiate support before sending the new parameter. A failed selection read still requires retry, while a pending refresh of a known selection allows sending. Settings role pickers and task navigation no longer inherit the composer's loading restriction. Roll back by reverting this change and rebuilding the served web page; no configuration migration is required.

Related Issues

Fixes #819

knqiufan and others added 2 commits October 3, 2026 11:11
Read the current model independently of the provider catalogue and preserve
session bindings and staged picks. Show loading and retry states, and reject
responses superseded by navigation or a local selection.

Add regression coverage for cold starts, delayed catalogues and failed reads.
Use the shared path helper so the CSS regression gate also runs on Windows.

Co-authored-by: Codex <noreply@openai.com>
@LivXue
LivXue requested a review from gloryfromca October 7, 2026 07:30

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: preserve model initialization when the page connects to an older gateway.

I reviewed the full github/main...HEAD diff and the relevant model RPC, boot, composer-send, session-switch, staged-selection, retry, fixture, and schema paths. I also checked AGENTS.md, CONTEXT-MAP.md, the Web UI architecture vocabulary, commit history, backward compatibility, and whether the tests were weakened; I found one blocking compatibility regression inline.

Verification: PYTHONPATH=plugins-dist/everos-memory uv run pytest tests/test_rpc_model.py -x (228 passed); npm test (215 files, 3198 tests passed); npm run type-check and npm run gen:check passed; npm run lint exited successfully with four pre-existing warnings in untouched files.

Comment thread ui-web/src/features/model/source.ts Outdated
return
}
try {
const mo = await readOptions({ ...(target ? { session_id: target } : {}), include_providers: false })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: preserve model initialization when the page connects to an older gateway.

The pre-change gateway validates ModelOptionsParams with extra="forbid", so it rejects include_providers with config_validation_error. This catch then marks the selection failed, while the parallel legacy {session_id} catalogue response no longer calls showModel. The chip therefore remains Model unavailable, beforeSend blocks every message, and clicking retry only repeats the incompatible request. The Web UI explicitly supports older gateways, so this needs a legacy fallback that reads the model from a request the older server accepts (or equivalent capability negotiation).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this. The UI now sends include_providers: false only when the gateway advertises support; older gateways use the original parameters and share the full catalogue request. Regression tests for both paths pass.

knqiufan and others added 3 commits October 7, 2026 19:53
Advertise selection-only model options during the gateway handshake and
use legacy request parameters when the connected gateway lacks support.
Share the catalogue read on older gateways and refresh capabilities on
reconnect.

Cover legacy initialization, retries, navigation, staged picks, and the
composer send path. Keep fixture handshakes and test gateways aligned.

Co-authored-by: Codex <noreply@openai.com>
Keep an already-ready selection usable during refreshes of the same view,
while navigation, initial loads and failed reads retain readiness checks.
Limit the shared catalogue loading guard to composer picker openings.
Separate send readiness from provider setup redirects so loading a model
does not block New Task, and clear catalogue state on synchronous RPC errors.

Cover background sending, navigation, retry and settings role picks on
both modern and strict legacy gateways.

Co-authored-by: Codex <noreply@openai.com>

This branch has not been deployed

No deployments
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.

fix: web chat shows unusable minimax-m3 until configured model loads after a long delay

2 participants