Skip to content

feat(chat): per-conversation model selection, plus provider and skills fixes#115

Merged
su-fen merged 7 commits into
mainfrom
features
Jul 16, 2026
Merged

feat(chat): per-conversation model selection, plus provider and skills fixes#115
su-fen merged 7 commits into
mainfrom
features

Conversation

@su-fen

@su-fen su-fen commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Per-conversation model selection (b21ebbf, d42cffc): replaces the global model choice with per-conversation state so parallel tasks no longer clobber each other's model. chatHistory gains selected_model_json (schema v2) with a targeted chat_history_set_model command; ConversationSummary carries the selection (proto field 13) through history-sync, sidebar, and web wire types. Desktop resolves via a single derivation (gateway override > conversation selection > default); web keeps unsent picks in a per-conversation override map and converges on the history-sync echo. Also preserves model changes made during active runs.
  • Hidden file visibility toggle in the file tree (023272d).
  • Reliable ClawHub skill installs (666503c): resolves publisher-scoped downloads (ownerHandle for duplicate slugs), preserves source identity metadata, normalizes legacy skill names, and shows install preparation progress immediately in GUI and WebUI.
  • Restore adaptive thinking for decorated anthropic model ids (53e3507): normalized catalog lookup (strip date suffix/@version/case) plus family heuristics write compat.forceAdaptiveThinking back onto the model object, fixing 400s and "always Medium" thinking on date-suffixed/relay-renamed ids; mirrored into web settings.
  • Omit tool_choice on openai-completions requests without tools (3a8d64e): strict OpenAI-compatible endpoints reject tool_choice with no tools; text-only calls (compaction, title generation) no longer send it.

Test plan

  • New wire-level regression tests for anthropic thinking payload per level and openai-completions tool_choice gating (stream-by-api-tool-choice.test.mjs)
  • New ClawHub contract and skills-store install feedback tests
  • Existing GUI and web test suites pass locally

🤖 Generated with Claude Code

su-fen and others added 7 commits July 16, 2026 10:00
…ut tools

Strict OpenAI-compatible endpoints (xAI-style gateways/relays) reject
requests that set tool_choice without a tools array ("A tool_choice was
set on the request but no tools were specified"). Text-only calls such
as compaction summaries and title generation carry no tools but always
sent tool_choice: "none", so compaction on gpt-5.6 via chat-completions
relays failed with 400.

Gate tool_choice at the openai-completions dispatch point: only forward
it when the request actually carries tools, matching the existing guard
in agentRunner. tool_choice is meaningless without tools, so behavior
is unchanged on lenient endpoints.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…el ids

Since ee8dba1 anthropic adaptive-thinking dispatch relies solely on the
catalog's compat.forceAdaptiveThinking, so any model id that misses the
exact catalog match (date suffixes, case variants, relay renames like
claude-4.6-sonnet) degraded to budget mode: requests carried the removed
budget_tokens field with no output_config.effort, which 4.7+/Fable-class
endpoints reject with 400 and relays silently strip — the user's thinking
level selection had no effect ("always Medium" reports).

Fix in modelFactory with two fallbacks, both written onto the model object
because pi-ai's raw stream() dispatches adaptive-vs-budget from
model.compat as well:

- Normalized catalog lookup (lowercase, strip @Version, strip -YYYYMMDD)
  inherits full catalog metadata while keeping the user-configured id in
  the request body.
- For ids the catalog still misses, restore the pre-refactor family
  heuristics (plus reversed naming like claude-4.6-sonnet/claude-5-sonnet,
  with a lookbehind so claude-3-5-sonnet stays budget) to set
  compat.forceAdaptiveThinking and the xhigh/max thinkingLevelMap tiers.

Mirror the same resolution into the web settings module so the WebUI level
dropdown matches what the desktop actually sends. Add wire-level regression
tests capturing the real pi-ai anthropic payload per level.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolve publisher-scoped ClawHub downloads and preserve source identity metadata.

Normalize compatible legacy skill names and show install preparation progress immediately in GUI and WebUI.
Replace the global model choice with per-conversation state so parallel
tasks no longer clobber each other's model:

- chatHistory gains selected_model_json (schema v2; idempotent ensure
  re-run migrates existing DBs), with a targeted chat_history_set_model
  command mirroring set_pinned (no updated_at bump) and COALESCE-guarded
  upserts so null inputs never clobber a stored choice.
- ConversationSummary carries the selection (proto field 13) through
  history-sync, the mirrored sidebar layer, and the web wire types.
- Desktop resolves via a single derivation (gateway override >
  conversation selection > default); the visible entry's selection is
  React state so runtime-cache rebuilds can't drop it; records seed the
  entry on open/hydrate/bridge-ready, and sends pin the effective model.
- Web keeps unsent picks in a per-conversation override map, sends them
  with each chat command, and converges on the history-sync echo.
- settings.selectedModel narrows to "default for new conversations"
  (last picked anywhere); ChatHeader on both ends now takes
  onSelectModel instead of setSettings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@su-fen su-fen merged commit 4a00821 into main Jul 16, 2026
7 checks passed
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.

1 participant