Skip to content

chore(release): prepare 0.36.0 - #80

Merged
elkaix merged 11 commits into
mainfrom
release/0.36.0
Jun 6, 2026
Merged

chore(release): prepare 0.36.0#80
elkaix merged 11 commits into
mainfrom
release/0.36.0

Conversation

@elkaix

@elkaix elkaix commented Jun 6, 2026

Copy link
Copy Markdown
Member

Summary

  • harden Alibaba Token Plan login with required dedicated endpoints and fail-closed regional fallback
  • use DashScope thinking controls for Alibaba-routed models and non-streaming DeepSeek V3.2 on workspace endpoints
  • add production bug guardrails to the default agent and review/judge specialists
  • update release documentation and regenerate the docs changelog from CHANGELOG.md

Related Issue

None.

Checklist

  • make check-pythinker-code
  • make test-pythinker-code
  • Focused Alibaba, LLM, shell login, and agent-spec tests
  • Documentation changelog regenerated with npm run sync from docs/

Test Results

  • 4427 passed, 6 skipped, 1 xfailed
  • 52 passed, 4 skipped in wire E2E
  • 122 passed in final focused verification

Summary by CodeRabbit

  • New Features

    • Automatic multi-region endpoint fallback for Alibaba DashScope keys; workspace-scoped keys now prompt for and accept a workspace base URL.
    • DashScope model catalog refreshed (added Qwen3 variants, removed unavailable models; Qwen3.7 max context corrected to 1M tokens).
    • DashScope models get special runtime handling for thinking/streaming behavior.
  • Documentation

    • Updated release notes, changelog, README, installers, and getting-started docs for v0.36.0 and install/upgrade instructions.
  • Tests

    • Expanded tests covering Alibaba login, discovery, workspace-key flows, and updated model catalog expectations.

elkaix added 6 commits June 5, 2026 22:47
…del catalog

- Prompt for workspace endpoint host in TUI when sk-ws- key is entered,
  eliminating the need to pre-set DASHSCOPE_BASE_URL for workspace keys
- Add base_url param to login_alibaba_api_key for caller-supplied endpoint
- Add qwen3.7-plus, qwen3-coder-plus, qwen3-coder-flash to catalog
- Remove kimi-k2.5, glm-5, MiniMax-M2.5 (absent from live endpoint)
- Correct qwen3.7-max context size to 1M (was 262k)
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Version 0.36.0: adds Alibaba DashScope region-aware endpoint handling with China fallback, workspace-scoped key support (sk-ws-) and explicit base_url plumbing for discovery/login, UI prompt for workspace endpoints, DashScope model catalog updates, LLM thinking/streaming adjustments, and aligned docs/tests.

Changes

Pythinker Code 0.36.0 Release and Alibaba DashScope Enhancements

Layer / File(s) Summary
Release documentation and version updates
CHANGELOG.md, README.md, docs/en/guides/getting-started.md, docs/en/release-notes/breaking-changes.md, docs/en/release-notes/changelog.md, packages/linux-installer/README.md, pyproject.toml
Changelog, release notes, README, installer docs, guides, and pyproject.toml bumped to announce 0.36.0 and reference 0.36.0 artifacts.
Agent prompts: production guardrails & tests
src/pythinker_code/agents/default/*.yaml, src/pythinker_code/agents/default/system.md, tests/core/test_agent_spec.py, tests/core/test_default_agent.py
Adds “Production Bug Guardrails” checklist items to agent prompts and tests asserting the guardrail text in default agent specs.
Alibaba model catalog and constants
src/pythinker_code/auth/alibaba.py
Adds ALIBABA_CHINA_BASE_URL, updates ALIBABA_MODELS (Qwen3 variants, qwen3-coder-*, GLM-5.1), and replaces prior URL normalizer with coding-plan-aware _normalize_alibaba_base_url and _apply_alibaba_config(base_url).
Model discovery refactor
src/pythinker_code/auth/alibaba.py
Adds _is_workspace_endpoint(base_url) and refactors _discover_alibaba_models(api_key, base_url) to query {base_url}/models.
Region-aware login flow with endpoint fallback
src/pythinker_code/auth/alibaba.py
login_alibaba_api_key(..., base_url=None) now resolves primary endpoint (provided/env/default), enforces workspace endpoint for sk-ws- keys, attempts model discovery, probes China fallback on auth failures for eligible keys, and applies the resolved provider base_url.
Workspace-scoped key UI prompting
src/pythinker_code/ui/shell/oauth.py
Adds _prompt_text and updates /login alibaba to detect sk-ws- keys, prompt for a workspace endpoint host, and pass it as base_url to login_alibaba_api_key.
LLM provider DashScope thinking & streaming changes
src/pythinker_code/llm.py
Adds _is_dashscope_endpoint(base_url); DashScope legacy endpoints bypass generic with_thinking and receive enable_thinking via extra_body; workspace deepseek-v3.2 disables streaming and forwards stream to OpenAILegacy.
Tests: Alibaba discovery/login, llm, and UI login
tests/auth/test_alibaba_auth.py, tests/core/test_create_llm.py, tests/ui_and_conv/test_openai_shell_login.py
Updates model-catalog expectations and adds tests validating discovery base_url usage, China fallback/error handling, workspace-key prompting/behavior, and DashScope thinking/streaming behavior.

Sequence Diagram

sequenceDiagram
  participant UI as UI (/login alibaba)
  participant Auth as login_alibaba_api_key
  participant Discovery as _discover_alibaba_models
  participant DashScope as DashScope API
  UI->>Auth: submit api_key (sk-*/sk-ws-) [+ optional base_url]
  Auth->>Discovery: GET {primary_base_url}/models with api_key
  Discovery->>DashScope: request models (primary)
  DashScope-->>Discovery: 200 models / 401/403 / network error
  alt 401/403 for non-workspace key and primary != China
    Auth->>Discovery: probe {ALIBABA_CHINA_BASE_URL}/models
    Discovery->>DashScope: request models (china)
    DashScope-->>Discovery: 200 / error
    Discovery-->>Auth: models or error
  end
  Auth-->>UI: apply config (provider base_url resolved) or emit workspace-key error
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement, dependencies

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.67% which is insufficient. The required threshold is 70.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title follows the conventional commits format with 'chore(release)' type and scope, clearly summarizing the main change as preparing version 0.36.0.
Description check ✅ Passed The pull request description covers key implementation details, related issue status, verification steps, and test results, though it lacks explicit references to the provided template sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/0.36.0

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/en/release-notes/changelog.md`:
- Around line 20-27: Revert the manual edits to
docs/en/release-notes/changelog.md (the autogenerated release notes) and
regenerate the file from the canonical source: update the root CHANGELOG.md with
the desired entry and then run the docs sync command (npm run sync from the
docs/ directory) so the generated changelog is rebuilt; do not directly edit
docs/en/release-notes/changelog.md to avoid future drift.

In `@src/pythinker_code/auth/alibaba.py`:
- Around line 271-341: When handling aiohttp.ClientResponseError for 401/403 in
the Alibaba auth flow, restrict the China-region probe so it only runs when the
primary_url is the default US endpoint (don’t probe when the user supplied a
custom base_url); call _discover_alibaba_models(resolved_key,
ALIBABA_CHINA_BASE_URL) only in that case, and if the China probe fails for any
non-auth reason (aiohttp.ClientError, TimeoutError, ValueError) or times out,
yield an OAuthEvent "error" and return instead of setting active_url = china_url
or falling through to _apply_alibaba_config; only set active_url = china_url and
assign models when _discover_alibaba_models succeeds (and keep the existing
behavior for explicit auth failures from the China probe where you yield an
error and return).

In `@tests/auth/test_alibaba_auth.py`:
- Around line 428-454: Update the test to exercise the explicit base_url
argument path: when calling login_alibaba_api_key in the test (function
login_alibaba_api_key is referenced), pass
base_url="ws-kopy0du82ky7144q.ap-southeast-1.maas.aliyuncs.com" (or add a second
test that does this) so the call verifies that the explicit base_url argument
takes precedence over DASHSCOPE_BASE_URL; keep the same fake_request monkeypatch
and assertions but ensure provider.base_url contains the workspace host returned
when base_url is passed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d0bdac17-f317-423d-9d54-2cd2b4c73a86

📥 Commits

Reviewing files that changed from the base of the PR and between 4856060 and b8783a8.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • CHANGELOG.md
  • README.md
  • docs/en/guides/getting-started.md
  • docs/en/release-notes/breaking-changes.md
  • docs/en/release-notes/changelog.md
  • packages/linux-installer/README.md
  • pyproject.toml
  • src/pythinker_code/auth/alibaba.py
  • src/pythinker_code/ui/shell/oauth.py
  • tests/auth/test_alibaba_auth.py

Comment thread docs/en/release-notes/changelog.md
Comment thread src/pythinker_code/auth/alibaba.py
Comment thread tests/auth/test_alibaba_auth.py
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.04124% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pythinker_code/auth/alibaba.py 71.62% 14 Missing and 7 partials ⚠️
src/pythinker_code/ui/shell/oauth.py 28.57% 8 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

elkaix added 3 commits June 5, 2026 23:28
DashScope's OpenAI-compatible API uses extra_body={"enable_thinking": true/false}
for Qwen thinking models. Sending reasoning_effort triggers RouteError: Service
route not found (HTTP 500). Treat Qwen like Kimi K2/GLM: skip with_thinking()
and send the provider-specific toggle instead.
Extend the Qwen-only fix to cover all models accessed via DashScope
endpoints (kimi-k2.6, GLM, DeepSeek, etc.) using URL-based detection.
kimi-k2.6 uses {"thinking": {"type": ...}} on all providers including
DashScope workspace; enable_thinking is Qwen-only. Remove the DashScope
exclusion from is_kimi_openai_legacy/is_glm_openai_legacy so the correct
Moonshot body format is applied regardless of endpoint.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pythinker_code/llm.py`:
- Around line 389-390: The comment and code handling for DashScope-proxied
models is inconsistent: either update the comment to state that DeepSeek uses
enable_thinking like Qwen, or add explicit handling so DeepSeek gets the correct
request body. Locate the block that treats Qwen thinking models (references to
enable_thinking) in llm.py and either (A) change the comment to include DeepSeek
if it should receive enable_thinking, or (B) implement a new model-detection
helper (_is_deepseek_model) and add a branch that constructs the
DeepSeek-specific body (or sets enable_thinking) alongside the existing Qwen
handling so DeepSeek requests are formatted correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e78d817d-cc2c-44f1-96cf-28bdf5a0f49a

📥 Commits

Reviewing files that changed from the base of the PR and between 350b3ce and a6b83f5.

📒 Files selected for processing (1)
  • src/pythinker_code/llm.py

Comment thread src/pythinker_code/llm.py Outdated
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