Skip to content

fix(models): keep ordinary chat selections session-scoped - #139232

Merged
obviyus merged 2 commits into
mainfrom
codex/chat-model-selection-scope
Sep 5, 2026
Merged

obviyus merged 2 commits into
mainfrom
codex/chat-model-selection-scope

Conversation

@obviyus

@obviyus obviyus commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Changing the model in one administrator chat could also change the default inherited by unrelated and new chats.

Why This Change Was Made

The shared selection policy now treats omitted scope as session-only. Gateway, chat commands, and scope descriptions use the same policy. Explicit agent/global scopes and configured scope settings retain their existing permission checks.

User Impact

Ordinary model changes stay in the current chat. To change defaults, use existing default controls or explicit scope flags. This intentionally changes implicit administrator behavior when no scope is configured.

Evidence

Real Gateway checks reproduced the unwanted default write and verified session isolation, inherited/new sessions, reset, history, reconnect, and the next selected-model reply. All 293 focused policy, Gateway, command, and plugin-interface tests passed. An immediate-turn race after an explicit default update also reproduced on the baseline and remains unfixed. Browser clicks and live channel accounts were not tested.

Consumers: unscoped Gateway and chat model selections now target the current session.

Related: #136257.

Default ordinary model choices to the current session instead of promoting administrator selections into agent or global defaults. Preserve explicit scope choices and resolve the shipped SDK persistence opt-in inside the current config mutation.
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 5, 2026
@obviyus obviyus self-assigned this Sep 5, 2026
@obviyus
obviyus marked this pull request as ready for review September 5, 2026 17:12
@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Ready to land at 17eb47ce60f405ac5111bcba3143b9ca4cf80fda.

  • Root cause: the shared model-selection policy promoted an omitted scope into a configured-default write for administrators. Ordinary choices now remain session-local; explicit agent/global controls and the shipped SDK opt-in are preserved.
  • Real built-Gateway red/green covers both agents, inherited and fresh chats, independent pins, reset/reconnect, and continued selected-model messages through the bundled Anthropic transport fixture. No browser-click or live external-account claim.
  • 293 focused cases pass. Fresh final-head code review and ClawSweeper are clear through P2 / tier B, with no remaining findings or rank-up moves.
  • Exact-head CI run 33981131801 is green. Generated docs and unused exports are corrected; no failure bypass or rebase was needed.
  • Production is net −29 lines. The unrelated explicit-default reload race is reproduced on main and documented in the PR body as a follow-up.

Representative exact checks:

OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/agents/sticky-model-selection.test.ts src/model-picker/apply-session-model-selection.test.ts
node --import ./scripts/tsx.mjs scripts/generate-config-doc-baseline.ts --check
node --import ./scripts/tsx.mjs scripts/check-deadcode-exports.mts

The final cleanup changes docs and unused export visibility only; it reuses the unchanged built-runtime proof rather than claiming a rebuilt artifact. The source draft #136257 remains untouched.

@obviyus
obviyus merged commit 402f514 into main Sep 5, 2026
178 of 180 checks passed
@obviyus
obviyus deleted the codex/chat-model-selection-scope branch September 5, 2026 17:39
@obviyus

obviyus commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 402f514.

Before: an administrator's ordinary model choice could also rewrite the default inherited by unrelated chats.

After: ordinary choices stay in the selected session. Explicit agent/global controls remain available, and the SDK persistence opt-in resolves its target inside the current config transaction.

Proof: actual built-Gateway red/green with bundled-provider transport, independent session-isolation/continuation checks, 293 passing focused cases, clean exact-head ClawSweeper review, and green CI 33981131801. Production is net −29 lines; no rebase or CI exception was needed.

The existing explicit-default reload race remains documented as a separate follow-up. Draft #136257 stays open and unchanged for the remaining extractions.

vincentkoc added a commit to aniruddhaadak80/openclaw that referenced this pull request Sep 5, 2026
* commit '3e4becea5e2ce38ede69e8ecf5302805ecbfc09c':
  refactor: simplify outbound message execution context (openclaw#139107)
  fix(models): keep ordinary chat selections session-scoped (openclaw#139232)
  docs: slim root agent instructions and clarify testing scope (openclaw#139236)
  test(agents): give the sibling-drain completion wait a tolerance on slow runners (openclaw#139176)
  refactor(workboard): use canonical queries for card-tree writes (openclaw#139106)
  fix(canvas): recognize versioned macOS nodes (openclaw#138958)
  fix: load GitHub connections without a default agent (openclaw#139222)
  fix(memory): explain unsafe legacy host-event path recovery (openclaw#139195)
  refactor(talk): centralize typed voice session queries (openclaw#139103)
  fix(cli): preserve command dispatch and structured errors (openclaw#139067)
  refactor(agents): consolidate reply failure summaries (openclaw#139175)
  fix(auth): keep an unset default model unchanged during login (openclaw#139218)
  perf(media): reuse validated attachment read handles (openclaw#139168)
  refactor(channels): simplify account configuration updates (openclaw#139096)
  refactor(android): remove unused updater export root (openclaw#139198)
  fix(gateway): stop admitting post-ready producers during close (openclaw#139092)
  fix(gateway): expose agent hook completion outcomes (openclaw#139155)
  fix(config): return the saved configuration after plugin install commits (openclaw#139203)
  fix(android): reduce repeated retries to unreachable gateways (openclaw#138732)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
…39232)

Keep ordinary model choices in their session, including administrator choices. Preserve explicit agent/global scope and the shipped SDK persistence opt-in, resolving its write target inside the current config transaction.

Real Gateway red/green, selected-model chat continuation through the bundled provider, focused regression coverage, independent review and exact-head CI cover the extraction from openclaw#136257.

Co-authored-by: Ayaan Zaidi <[email protected]>
obviyus added a commit that referenced this pull request Sep 8, 2026
…41927)

## What Problem This Solves

Operators can see a stored credential with `static` health while `models status --check` exits 1 because route readiness is unknown. The reference currently omits that result. The FAQ also recommends unscoped status immediately after agent-specific login guidance, which can inspect a different model selection.

## Why This Change Was Made

The model CLI reference now distinguishes inventory, credential sources, profile health, model-route issues, and runtime availability. It documents check exit codes and command-resolution failures, and links chat-session inspection to the existing `/model status` guidance. The FAQ uses an explicit agent and links to this canonical explanation.

Hosted refresh now has its own section, preserving the distinction between downloading metadata and activating it after a Gateway restart. The FAQ's obsolete numeric picker was already corrected by #139232 and remains unchanged.

## User Impact

Operators can inspect the intended agent, understand an indeterminate result without treating it as rejected credentials, and distinguish a catalog download from authentication or live activation. No product behavior, model-selection policy, auth policy, or configuration changes.

## Evidence

- Source audit at `8e47d6998abdd916d66f5245c3d3f31f02c682b6` covers CLI registration, status output and exit-code selection, credential-source/health owners, and hosted refresh.
- Reused the actual isolated `models status --agent work --json --check` observation at `4e402dda9e0ee8c8a5b01e39d7ccd61ccf6d40ad`: stored exec reference retained, profile `static`, route `indeterminate`, exit 1, and no execution of the stored reference. The relevant status/health/overview/config-loading source is unchanged at the documentation baseline.
- Reused the completed hosted refresh proof from #141885: a separate CLI download produces a Gateway restart notice without activating rows or prices. No new runtime, provider request, or credential access was needed for this docs-only change.
- `pnpm docs:list`, changed-file `oxfmt --check`, `node scripts/check-docs-mdx.mjs docs/cli/models.md docs/help/faq-models.md`, the glossary check against the pinned baseline, and `git diff --check` pass.
- Full link/anchor audits check 9,427 candidate links and 9,424 baseline links. Both report the same 39 pre-existing missing ClawHub mirror links; all three new links pass. The local external documentation mirror is unavailable. No product build or typecheck ran locally.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
…enclaw#141927)

## What Problem This Solves

Operators can see a stored credential with `static` health while `models status --check` exits 1 because route readiness is unknown. The reference currently omits that result. The FAQ also recommends unscoped status immediately after agent-specific login guidance, which can inspect a different model selection.

## Why This Change Was Made

The model CLI reference now distinguishes inventory, credential sources, profile health, model-route issues, and runtime availability. It documents check exit codes and command-resolution failures, and links chat-session inspection to the existing `/model status` guidance. The FAQ uses an explicit agent and links to this canonical explanation.

Hosted refresh now has its own section, preserving the distinction between downloading metadata and activating it after a Gateway restart. The FAQ's obsolete numeric picker was already corrected by openclaw#139232 and remains unchanged.

## User Impact

Operators can inspect the intended agent, understand an indeterminate result without treating it as rejected credentials, and distinguish a catalog download from authentication or live activation. No product behavior, model-selection policy, auth policy, or configuration changes.

## Evidence

- Source audit at `968f4df72cfee029db29d5d21962bb835fb212be` covers CLI registration, status output and exit-code selection, credential-source/health owners, and hosted refresh.
- Reused the actual isolated `models status --agent work --json --check` observation at `4e402dda9e0ee8c8a5b01e39d7ccd61ccf6d40ad`: stored exec reference retained, profile `static`, route `indeterminate`, exit 1, and no execution of the stored reference. The relevant status/health/overview/config-loading source is unchanged at the documentation baseline.
- Reused the completed hosted refresh proof from openclaw#141885: a separate CLI download produces a Gateway restart notice without activating rows or prices. No new runtime, provider request, or credential access was needed for this docs-only change.
- `pnpm docs:list`, changed-file `oxfmt --check`, `node scripts/check-docs-mdx.mjs docs/cli/models.md docs/help/faq-models.md`, the glossary check against the pinned baseline, and `git diff --check` pass.
- Full link/anchor audits check 9,427 candidate links and 9,424 baseline links. Both report the same 39 pre-existing missing ClawHub mirror links; all three new links pass. The local external documentation mirror is unavailable. No product build or typecheck ran locally.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant