Skip to content

fix(claude): preserve model selector provenance - #81

Merged
Germey merged 1 commit into
mainfrom
fix/model-selector-contract
Aug 6, 2026
Merged

fix(claude): preserve model selector provenance#81
Germey merged 1 commit into
mainfrom
fix/model-selector-contract

Conversation

@acedatacloud-dev

Copy link
Copy Markdown
Member

Problem

When a Claude Code transcript is resumed through Coding Bridge, the transcript's resolved model ID (for example claude-opus-5) was reused as the launch selector. Selector-only options such as opus[1m] are not present in the transcript, so cross-device resume silently changed the context profile and triggered compaction near the ordinary context threshold.

Root fix

  • Version the sidecar model contract and persist exact model_selector provenance separately.
  • Expose model_selector, resolved_model, and model_contract=2 as distinct protocol fields.
  • Treat legacy model sidecars as ambiguous instead of guessing a model family or fabricating [1m].
  • Omit an explicit model override when selector provenance is unknown, allowing Claude Code settings to remain authoritative.
  • Log requested selector and provider-resolved model separately at launch/init.

No token thresholds, title/session special cases, or forced 1M selector are used.

Verification

  • python3 -m pytest tests/test_session_meta.py tests/test_session.py tests/test_connection.py tests/test_history.py tests/test_claude_entrypoint.py tests/test_resume_guard.py — 86 passed
  • ruff check ... on all touched Python/test files — passed
  • Full local suite: all affected tests pass; unrelated pre-existing environment failures remain in channel log-capture/portal tests and one live Codex capability assertion.

🤖 对抗评审 (reviewer: codex, 1 round)

  • Reviewer launch was attempted read-only, but the local Codex client hung after its model-catalog endpoint returned an incompatible schema. No findings were produced; focused contract review and cross-repo tests were completed manually.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Germey
Germey force-pushed the fix/model-selector-contract branch from 590da16 to b97aa5a Compare August 6, 2026 00:34
@Germey
Germey merged commit 90b9696 into main Aug 6, 2026
3 checks passed
@Germey
Germey deleted the fix/model-selector-contract branch August 6, 2026 02:40
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.

2 participants