ci: release packages - #15
Closed
pythinker-release-bot[bot] wants to merge 12 commits into
Closed
Conversation
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @pythoughts/pythinker-code@0.6.0 ### Minor Changes - [`d7a2554`](d7a2554) - Maintenance release with internal improvements and dependency updates. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…#7) ## Related Issue No linked issue — problem explained below. ## Problem Connecting a provider from the models.dev catalog in `/login` or `/provider` failed with `Environment variable "X" is not set or is empty.` instead of asking for an API key. The same gate also broke the OpenAI (API key) and Anthropic (API key) login entries, which route through the same path, and `pythinker provider catalog add` had no way to pass a key directly. Separately, the update banner and `/update` implied Homebrew installs auto-update when they deliberately do not, and the native install scripts pointed at nonexistent release assets. ## What changed - Catalog provider login now falls back to the API key input dialog when the provider's environment variable is unset or empty, and stores the entered key in `config.toml` via the existing `api_key` provider field. When the env var is set, behavior is unchanged. - `pythinker provider catalog add` gains `--api-key <key>`, taking precedence over `--api-key-env` and the catalog's declared env var; error messages now mention the flag. - `/update` and the startup update notice state that Homebrew installs do not auto-update and show the native installer command for automatic background updates. - The native install scripts download the correct published release assets. - Site: legacy downloads popup and Python download milestone highlight. Tests: new coverage for the prompt fallback (env set / unset / undeclared / cancelled) in the TUI, and for `--api-key` precedence and Commander wiring in the CLI. Full suite green. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/Pythoughts-labs/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. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Catalog provider setup now accepts API keys interactively or through `--api-key`. - Native installers download verified, architecture-specific release packages on macOS, Linux, and Windows. - Added a dismissible community download milestone popup to the website. - Updated installation guidance, including Homebrew recommendations for automatic updates. - **Bug Fixes** - Provider login no longer fails when the configured API-key environment variable is missing or empty. - **Documentation** - Updated architecture imagery and installation messaging. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Related Issue No linked issue — problem explained below. ## Problem On Windows, `pythinker` installed via npm fails immediately: ``` Failed to start Pythinker Code: The feature process.execve is unavailable on the current platform, which is being used to run Node.js ``` Windows Node defines `process.execve` as a function that throws `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when called. The launcher's existence check (`process.execve !== undefined`) therefore routed Windows into the execve path and crashed before the existing spawn fallback could run. ## What changed The launcher checks the platform first: win32 always uses the spawn fallback; the execve path (which preserves pid, process group, and controlling terminal) remains for POSIX. Added a regression test that fakes win32 with a throwing `execve` and asserts the fallback child completes — verified it fails against the previous launcher. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/Pythoughts-labs/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. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @pythoughts/pythinker-code@0.6.1 ### Patch Changes - [#7](#7) [`d396320`](d396320) - Prompt for an API key when connecting a catalog provider whose environment variable is not set, instead of failing with "Environment variable is not set or is empty". Applies to `/login`, `/provider`, and `pythinker provider catalog add`, which now also accepts `--api-key <key>`. - [#7](#7) [`d396320`](d396320) - Explain in `/update` and the startup update notice that Homebrew installs do not auto-update, and point to the native installer for automatic background updates. - [#7](#7) [`d396320`](d396320) - Point the native install scripts at the published release assets. - [#7](#7) [`d396320`](d396320) - Show a clear requirement message with the native-installer alternative when the CLI is launched on Node.js older than 26.4, instead of failing with a cryptic flag error. - [#8](#8) [`9b1b195`](9b1b195) - Fix the CLI failing to start on Windows with "process.execve is unavailable" by using the spawn fallback instead of calling execve there. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Related Issue No linked issue — problem explained below. ## Problem The install scripts' animated intro draws the logo grid and progress bar at fixed screen rows (5-9 and 17). When the terminal already has output (e.g. after an apt run), the animation interleaves with the existing text and renders garbled. ## What changed Both `install.sh` and `install.ps1` clear the screen and home the cursor when the animated intro starts. The non-animated path (`CI`, `NO_COLOR`, redirected output) is unchanged, so logs and pipes are unaffected. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/Pythoughts-labs/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. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Redesigned browser OAuth confirmation pages with a lighter, grid-based layout, improved spacing, typography, and responsive animations. - Added animated success and error indicators with clearer status messaging. - **Bug Fixes** - Installation scripts now clear the terminal and reset the cursor before displaying their animated introductions. - Updated installation instructions and commands to use the current code hosting URLs across supported platforms. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @pythoughts/pythinker-code@0.6.2 ### Patch Changes - [#10](#10) [`ad2391b`](ad2391b) - Clear the terminal before the install script's animated intro so earlier shell output no longer interleaves with the logo animation. - [#10](#10) [`ad2391b`](ad2391b) - Restyle the browser OAuth sign-in confirmation pages for all providers to match the website's light design. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Related Issue No issue filed — problem explained directly. ## Problem Context compaction fails with a provider 400 whenever the model alias has no `maxOutputSize` configured: ``` Compaction cancelled Error: [compaction.failed] APIStatusError: 400 Error from provider (Console Go): Upstream request failed: [invalid_request_error] Invalid max_tokens value, the valid range of max_tokens is [1, 393216] ``` The compaction request resolved its completion budget without `maxOutputSize`, so the cap fell back to the model's full context window and was sent as `max_tokens`. Providers that enforce `input + max_tokens <= context window` (Moonshot/Console gateways, DeepSeek, Groq, and also Anthropic/OpenAI/Google under the same conditions) reject the request outright. The class of bug is provider-agnostic; compaction just hits it first because its prompt is the largest. ## What changed Port of the two upstream fixes for this (kimi-code `794db5553` and `76c643bcb`), adapted to pythinker: - Compaction now resolves its budget with `maxOutputSize ?? min(contextWindow, 128k)` instead of falling through to the context window (`packages/agent-core/src/agent/compaction/full.ts`). - `withMaxCompletionTokens` gained optional context: OpenAI-legacy and Pythinker chat-completions providers clamp the cap to the remaining context window (`maxContextTokens - usedContextTokens`), and OpenAI-legacy additionally to a 128k ceiling (`packages/kosong`). - Normal turns pass the live context token count through `KosongLLM` so per-request caps shrink as the context fills. Also includes a second commit: restart Homebrew-managed installs after `/update` (helper + activation step, doctor/preflight updates, docs). Both changes carry their own changeset; happy to split into a separate PR if preferred. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/Pythoughts-labs/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. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Automatic updates can download and verify in the background, then install on the next launch. * Added clearer update status, failure details, pending versions, and installer logs to diagnostics. * **Bug Fixes** * Improved context compaction to prevent excessive completion sizes and provider overflows. * Workflow progress now advances smoothly, displays a Finalizing state, and aligns correctly on narrow screens. * **Documentation** * Updated upgrade, configuration, environment-variable, and data-location guidance for the revised update behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @pythoughts/pythinker-code@0.7.0 ### Minor Changes - [#12](#12) [`02f7f8d`](02f7f8d) - Prepare verified Homebrew updates in the background and install them automatically on the next interactive launch. ### Patch Changes - [#12](#12) [`02f7f8d`](02f7f8d) - Fix context compaction failing with provider "Invalid max_tokens" errors by capping requested completion tokens to the remaining context window and a safe output ceiling instead of the full context window size. - [#12](#12) [`02f7f8d`](02f7f8d) - Fix Dynamic Workflow progress sticking at 90% during long streaming, show a Finalizing state once all delegated agents finish, and fix member row alignment at narrow widths. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
## Related Issue
No existing issue — the problem is described below. This is a
reproducible bug fix with a focused diff.
## Problem
Every request to a Kimi / Moonshot model fails before the model runs:
```
400 tools.function.parameters is not a valid moonshot flavored json schema,
details: <At path 'root': when using anyOf, type should be defined in anyOf items
instead of the parent schema>
```
The wire validator refuses a tool schema that uses `anyOf` as a
*refinement* of the
node it sits on. Two rules are involved:
- `type` may not appear next to `anyOf` on the same node.
- No validation keyword (`properties`, `items`, `additionalProperties`,
…) may
appear on both a node and one of its `anyOf` branches.
Both are legal standard JSON Schema, so schemas that work on every other
provider
are rejected here. `TaskStop` trips them: it adds a hand-written
`anyOf: [{ required: ['task_id'] }, { required: ['shell_id'] }]` on top
of an
object schema that already declares `type` and `properties`. Because
tool
definitions are sent with every request, a single offending tool takes
down the
whole session.
`normalizePythinkerToolSchema` already existed for exactly this class of
provider-compatibility repair, but it only visited *nested* property
schemas and
deliberately skipped the root, so it never saw the offending node.
## What changed
The repair lives in the provider's schema normalizer rather than in
`TaskStop`, so
MCP- and plugin-contributed schemas are covered by the same pass — this
shape is
common enough that several other clients have hit it independently.
**Nested nodes — distribute.** A node's own constraints are pushed down
into each
`anyOf` branch, and branches that already declare a keyword keep their
own
(narrower) value. This is lossless: `P ∧ (B₁ ∨ B₂)` and `(P ∧ B₁) ∨ (P ∧
B₂)`
accept exactly the same instances. Sibling combinators (`allOf` /
`oneOf` / `not` /
`if`) are left in place — the validator does not read them, so moving
them would
only churn the schema.
**Root — fold away.** The root cannot use the branch form, because a
tool's
parameters must be a plain object: the wire separately requires
`parameters.type == "object"`, which cannot coexist with a root `anyOf`.
The two
constraints are jointly unsatisfiable, so the root's `anyOf` is dropped.
That only
ever widens what is accepted, and a root `anyOf` is in practice a "one
of these
fields is required" hint that the tool re-checks at run time (`TaskStop`
already
returns `Missing required parameter: task_id`). Branch properties are
merged into
the root first, so a schema that kept its arguments inside the branches
does not
silently lose them.
## Verification
Rather than asserting against an assumed reading of the spec, every
schema was
replayed through the provider's own validator:
- Reproduced the original 400 against the live endpoint, then confirmed
it is gone.
- Replayed **all 36 built-in tool schemas and all 70 tool schemas from
five
connected MCP servers** through the normalizer and into the provider's
validator:
106 accepted, 0 rejected. Before the change, `TaskStop` was the single
failure.
- Full `kosong` suite passes (1185 tests); `typecheck` clean.
- Each of the two new code paths was individually disabled to confirm
the new tests
actually fail without it.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/Pythoughts-labs/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.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update — no
user-facing behavior or CLI surface changes.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved compatibility with Kimi and Moonshot models when tools use
combined schema types.
* Fixed invalid tool schema errors involving `anyOf`, `oneOf`, and
`allOf` combinations.
* Improved normalization of nested and object-based tool schemas while
preserving metadata, constraints, references, and definitions.
* Reduced duplicate schema alternatives and improved handling of
required fields.
* **Tests**
* Added comprehensive coverage for root and nested schema normalization,
cyclic definitions, and combinators.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Contributor
Author
|
@coderabbitai review |
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@pythoughts/pythinker-code@0.7.1
Patch Changes
0631ca4- Fix Kimi and Moonshot models rejecting every request with an invalid tool schema error when a tool declaresanyOfalongside its own type or properties.