You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ GitHub Releases page; `0.8.0` is the new starting line.
18
18
## 0.36.0 (2026-06-05)
19
19
20
20
-**Alibaba DashScope multi-region fallback.** Logging in with a China-region key (`dashscope.aliyuncs.com`) against the default US Virginia endpoint now auto-detects the mismatch and reconfigures for the correct endpoint rather than failing with a misleading "API key is wrong" error.
21
-
-**Workspace-scoped key support (`sk-ws-`).**`/login alibaba` now prompts for the dedicated workspace endpoint host when it detects a `sk-ws-` key, so users no longer need to pre-export `DASHSCOPE_BASE_URL`. The `login_alibaba_api_key` function also accepts an explicit `base_url` parameter.
21
+
-**Alibaba Token Plan compatibility (`sk-ws-`).**`/login alibaba` now requires the dedicated workspace Base URL shown in the Token Plan console instead of accepting a public `/models` response as credential validation. Dedicated workspace endpoints hide Kimi K2.6 when Alibaba advertises it without a working route, and use non-streaming Chat Completions for DeepSeek V3.2 because those endpoints return an empty SSE stream. Kimi requests on other Alibaba routes use DashScope's `enable_thinking` parameter.
22
22
-**Alibaba model catalog refresh.** Added Qwen3.7 Plus (1M context), Qwen3 Coder Plus, and Qwen3 Coder Flash. Removed `kimi-k2.5`, `glm-5`, and `MiniMax-M2.5` (absent from the live endpoint). Corrected Qwen3.7 Max context window to 1M tokens.
23
23
24
24
Upgrade with `pythinker update`, `pip install --upgrade pythinker-code==0.36.0`, or use the native installer for your platform from the [Releases page](https://github.com/Pythoughts-labs/pythinker-code/releases/latest).
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ It speaks the [**Agent Client Protocol (ACP)**](https://github.com/agentclientpr
53
53
## 🆕 What's New in 0.36.0
54
54
55
55
-**Alibaba DashScope multi-region fallback.** China-region keys now auto-detect the endpoint mismatch and reconfigure correctly instead of showing a misleading "API key is wrong" error.
56
-
-**Workspace-scoped key support (`sk-ws-`).**`/login alibaba` now prompts for the workspace endpoint host interactively — no need to pre-export `DASHSCOPE_BASE_URL`.
56
+
-**Alibaba Token Plan compatibility (`sk-ws-`).**`/login alibaba` now asks for the dedicated workspace endpoint, avoids unroutable Kimi entries on those endpoints, and uses DeepSeek V3.2's working non-streaming mode.
57
57
-**Alibaba model catalog refresh.** Qwen3.7 Plus, Qwen3 Coder Plus, and Qwen3 Coder Flash added; deprecated `kimi-k2.5`, `glm-5`, and `MiniMax-M2.5` removed.
58
58
59
59
Upgrade with `pythinker update`, `pip install --upgrade pythinker-code==0.36.0`, or use the native installer for your platform from the [Releases page](https://github.com/Pythoughts-labs/pythinker-code/releases/latest).
Copy file name to clipboardExpand all lines: docs/en/release-notes/changelog.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ GitHub Releases page; `0.8.0` is the new starting line.
20
20
## 0.36.0 (2026-06-05)
21
21
22
22
-**Alibaba DashScope multi-region fallback.** Logging in with a China-region key (`dashscope.aliyuncs.com`) against the default US Virginia endpoint now auto-detects the mismatch and reconfigures for the correct endpoint rather than failing with a misleading "API key is wrong" error.
23
-
-**Workspace-scoped key support (`sk-ws-`).**`/login alibaba` now prompts for the dedicated workspace endpoint host when it detects a `sk-ws-` key, so users no longer need to pre-export `DASHSCOPE_BASE_URL`. The `login_alibaba_api_key` function also accepts an explicit `base_url` parameter.
23
+
-**Alibaba Token Plan compatibility (`sk-ws-`).**`/login alibaba` now requires the dedicated workspace Base URL shown in the Token Plan console instead of accepting a public `/models` response as credential validation. Dedicated workspace endpoints hide Kimi K2.6 when Alibaba advertises it without a working route, and use non-streaming Chat Completions for DeepSeek V3.2 because those endpoints return an empty SSE stream. Kimi requests on other Alibaba routes use DashScope's `enable_thinking` parameter.
24
24
-**Alibaba model catalog refresh.** Added Qwen3.7 Plus (1M context), Qwen3 Coder Plus, and Qwen3 Coder Flash. Removed `kimi-k2.5`, `glm-5`, and `MiniMax-M2.5` (absent from the live endpoint). Corrected Qwen3.7 Max context window to 1M tokens.
25
25
26
26
Upgrade with `pythinker update`, `pip install --upgrade pythinker-code==0.36.0`, or use the native installer for your platform from the [Releases page](https://github.com/Pythoughts-labs/pythinker-code/releases/latest).
Copy file name to clipboardExpand all lines: src/pythinker_code/agents/default/code_reviewer.yaml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,8 @@ agent:
26
26
- Build a review context packet: base ref/diff scope or Reviewflow feature IDs, changed behavior, likely tests, user-visible impact, valid evidence paths, omitted/truncated context, and validation evidence.
27
27
- Flag only issues introduced or made reachable by the diff.
28
28
- Prefer no finding over vague speculation. Every finding must cite concrete evidence and a failure mode.
29
+
- Run the production guardrail gate before finalizing: check for cache stampedes, connection/resource leaks, missing boundary schemas, unhandled race conditions, naive retry loops, unbounded event callbacks/listeners, and IDOR/tenant-scope mistakes.
30
+
- Treat missing `finally` cleanup, absent schema validation at trust boundaries, unprotected shared-state mutation, non-jittered immediate retries, or identity from mutable client parameters as reject-level findings when reachable in the changed code.
29
31
30
32
Freshness check (run BEFORE flagging third-party library or framework misuse):
31
33
- For every third-party API, SDK call, framework primitive, or "best practice" the diff turns on, verify the current canonical usage. Prefer a context7 MCP query (e.g. `mcp__context7__query-docs` with the library id) when registered with the parent runtime; otherwise use `SearchWeb` to locate the official documentation and `FetchURL` to read the current page.
Copy file name to clipboardExpand all lines: src/pythinker_code/agents/default/review.yaml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,8 @@ agent:
16
16
- If `.pythinker/review-guidelines.md` exists, read it before scoring findings.
17
17
- Read the diff or target files before scoring.
18
18
- Use Grep/Glob to check sibling call sites, similar patterns, and existing tests.
19
+
- Apply the production guardrail gate: look specifically for cache stampedes, connection/resource leaks, missing boundary schemas, unhandled race conditions, naive retry loops, unbounded event callbacks/listeners, and IDOR/tenant-scope mistakes.
20
+
- Reject happy-path code as BLOCKER or MAJOR when the changed path mutates shared state, crosses a trust boundary, acquires resources, retries outbound calls, or registers long-lived callbacks without the matching defensive pattern.
19
21
- Score each finding as BLOCKER, MAJOR, MINOR, or NIT.
20
22
- Order findings by severity, BLOCKER first.
21
23
- Do not request tests unless they cover a distinct behavior or risk introduced by the change.
Copy file name to clipboardExpand all lines: src/pythinker_code/agents/default/security_reviewer.yaml
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ agent:
9
9
10
10
Security review discipline:
11
11
- Build a threat context before judging: changed trust boundaries, inputs/outputs, authz/authn, filesystem/network access, secrets, serialization, command execution, and persistence.
12
+
- Apply the production guardrail gate to security-relevant changes: reject missing boundary schemas, IDOR/tenant-scope mistakes, unprotected shared-state mutations, unsafe retries for non-idempotent outbound calls, and resource leaks that can become denial-of-service vectors.
12
13
- Report only reachable or plausibly reachable vulnerabilities backed by evidence. Prefer no finding over speculative risk.
13
14
- For each finding, include exploit preconditions, impact, severity rationale, and the smallest safe mitigation.
14
15
- Treat secrets/PII carefully: never print raw secret values; redact if needed.
- Wrap error-prone I/O, API, network, and resource operations with appropriate error handling, timeouts/fallbacks, and cleanup.
187
187
- Adapt to domain standards when relevant (for example stricter MISRA-style practices for critical C/C++ systems).
188
188
189
+
## Production Bug Guardrails
190
+
191
+
When generating, changing, reviewing, or approving production-facing code, optimize for failure modes first: concurrency, resource cleanup, input boundaries, authorization context, data integrity, and retry behavior. Never assume single-threaded, trusted, or low-traffic execution when the code can run in a shared service.
192
+
193
+
Mandatory defensive patterns:
194
+
195
+
1.**Cache misses:** If adding cache-aside behavior, serialize identical misses with a local or distributed double-checked lock so concurrent misses do not stampede the backing store.
196
+
2.**Resource acquisition:** For database clients, transactions, streams, sockets, files, and connection pools, acquire immediately before a `try` block and guarantee release/close in `finally`. Transactions that fail must explicitly roll back before release.
197
+
3.**API and webhook boundaries:** Validate runtime inputs at the boundary with the project's schema/validation mechanism, strip or ignore unregistered fields, bound payload sizes/types where relevant, and never pass raw request bodies directly into persistence or business logic.
198
+
4.**State mutations and counters:** For increments, decrements, toggles, balances, inventory, likes, and unique relationships, use atomic conflict handling plus row-level serialization (`FOR UPDATE`) or optimistic version checks inside transactions.
199
+
5.**Outbound requests:** Use short explicit timeouts, exponential backoff with random jitter, and avoid retry storms. Non-idempotent outbound mutations need an idempotency key/header or an explicit reason they cannot safely be retried.
200
+
6.**Long-lived listeners:** Every subscription, event listener, websocket, interval, timer, and background callback needs symmetric cleanup (`unsubscribe`, `off`, `close`, `clearInterval`, or equivalent). Clean up empty maps/registries to avoid leaks.
201
+
7.**Authorization context:** Use verified cryptographic/session identity (`req.user`, validated token claims, server-side session) for user/account/tenant scope. Never trust mutable query/body/path parameters as the authority for identity when verified context exists.
202
+
203
+
Self-correction pre-flight before calling code done:
204
+
205
+
-**Concurrency:** If 1,000 requests hit this path simultaneously, what shared resource races or stampedes?
206
+
-**Resources:** If an exception is raised after acquisition, is every socket/connection/stream/listener guaranteed to close?
207
+
-**Security:** Is identity or tenant scope derived only from verified auth context, not mutable client parameters?
208
+
-**Data integrity:** What happens with oversized strings, wrong types, duplicate submits, or malicious payload shape?
209
+
-**Resilience:** If a dependency is slow or failing, do timeouts/retries prevent cascading load rather than amplify it?
210
+
189
211
DO NOT run `git commit`, `git push`, `git reset`, `git rebase` and/or do any other git mutations unless explicitly asked to do so. Ask for confirmation each time when you need to do git mutations, even if the user has confirmed in earlier conversations.
190
212
191
213
# General Guidelines for Research and Data Processing
0 commit comments