Skip to content

fix: keep the live thinking effort when switching models - #69

Closed
elkaix wants to merge 1 commit into
fix/persist-effort-cyclingfrom
fix/model-picker-effort-default
Closed

fix: keep the live thinking effort when switching models#69
elkaix wants to merge 1 commit into
fix/persist-effort-cyclingfrom
fix/model-picker-effort-default

Conversation

@elkaix

@elkaix elkaix commented Aug 14, 2026

Copy link
Copy Markdown
Member

Related Issue

No issue — the problem is explained below.

Problem

Two more paths lose the user's saved thinking effort across restarts (follow-up to #67):

  1. The model picker drafts any non-current model at its first non-off effort level (low for models without effort metadata). Confirming the picker persists that draft as the startup default, silently overwriting the effort the user had saved. A real config was found holding effort = "low" this way.
  2. Saving an effort writes only thinking.effort; the config deep merge preserves a stale thinking.mode = "off", which forces thinking off on the next startup even when an effort is saved.

What changed

  • The picker's effort draft for a non-current model now keeps the live effort, coerced to what that model supports, instead of resetting to its first level.
  • Persisting an effort also writes the matching thinking.mode (on/off), so a stale mode = "off" cannot poison restarts.
  • Updated picker tests to the new contract and added a regression test for the switch-keeps-effort behavior.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ae9fa91-f33e-4d04-bc6d-5455b493c888

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 14, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@pythoughts/pythinker-code@5d80356
npx https://pkg.pr.new/@pythoughts/pythinker-code@5d80356

commit: 5d80356

@elkaix
elkaix deleted the branch fix/persist-effort-cycling August 14, 2026 02:36
@elkaix elkaix closed this Aug 14, 2026
elkaix added a commit that referenced this pull request Aug 14, 2026
## Related Issue

No issue — follow-up to #66 (GitHub org migration). This PR moves the
npm side to the new org.

## Problem

The GitHub org moved to `PyModel` (#66), but every workspace package
still carries the `@pythoughts` npm scope, and releases still publish to
`@pythoughts/pythinker-code`. Newer versions must publish under the
`pymodel` npm org.

## What changed

- Renamed all 18 workspace packages from `@pythoughts/*` to
`@pymodel/*`: package names, workspace dependencies, imports, and every
tooling reference (changesets config, `flake.nix` workspace names, CI
workflows, release/native/brew/CDN scripts, docs, README badges).
- Fixed escaped-scope references a plain replace misses: the
api-extractor specifier-rewrite regex in the SDK dts build,
vitest/tsdown `alwaysBundle` regexes, and the Windows path marker in the
postinstall reach script.
- Regenerated `pnpm-lock.yaml`; the `flake.nix` `pnpmDeps` hash is
unchanged (verified by rebuilding — workspace names do not affect the
fetched dependency set).
- Added a `minor` changeset so the next release publishes
`@pymodel/pythinker-code`.

Out of scope: the VS Code Marketplace publisher
(`pythoughts.pythinker-code`), `api.pythoughts.com` platform URLs, and
the `ai.pythoughts.pythinker-server` LaunchAgent label — these are
separate identities, not npm scope.

## Merge order

Merge #67, #68, #69 first — their changesets name
`@pythoughts/pythinker-code` and would break `changeset version` if this
PR lands before them.

## Before the first publish (npm side, manual)

1. On npmjs.com, add a Trusted Publishing (OIDC) connection for
`@pymodel/pythinker-code`: repository `PyModel/pythinker-code`, workflow
`release.yml`.
2. After the first successful `@pymodel` release: `npm deprecate
@pythoughts/pythinker-code "Moved to @pymodel/pythinker-code"`.

## Checklist

- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [x] I have linked a related issue, or explained the problem above.
- [x] I have added tests that prove my feature works. (Mechanical
rename; existing suites cover it.)
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update. (Docs
updated in the sweep.)

## Additional commits

- The sweep also caught encoded-scope references a plain replace misses:
api-extractor/tsdown/vitest regexes (`@pythoughts\/`), release-tag
parsing in `produce-manifest.mjs` and `install.sh`, `%40…%2F`
release-download URLs in the CDN build, and split specifiers in tests.
- One drive-along test-infra fix: `skill-session.test.ts` temp-dir
cleanup now retries, because a late journal flush races the recursive
delete under full-suite load and threw ENOTEMPTY twice while gating this
push.
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