Repository navigation
Commit a0c2705
authored
feat: workspace file editor, VS Code API-key fix, and English-only docs (#145)
## Related Issue
No filed issue. Three problems drove this branch:
1. Every turn on a Codex-signed-in model failed with `Service
temporarily unavailable — 400 status code (no body)`.
2. The workspace file editor (added on this branch) never opened, and
its reload/save paths were broken.
3. VS Code walled API-key-only users behind a sign-in screen they could
not satisfy.
## Problem
**Codex turns always failed.** The gateway answers
`{"detail":"Unsupported parameter: max_output_tokens"}`. The OpenAI SDK
discards that body because it is not an `{"error":{...}}` envelope, so
the message degrades to the literal `400 status code (no body)` and
nothing in our code ever sees the reason. The completion-budget resolver
always produces a value, so the parameter was on every request. The same
catalog also advertises an `ultra` reasoning level that `/responses`
rejects outright.
**The file editor could not open.** Monaco validates every theme color
against `/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/` and *throws* `Illegal
value for token color`. Several design tokens (`--color-text-muted`,
`--p-selection`) are declared as `rgba()`, so `setTheme` rejected on
boot in both light and dark. Behind that: `loadBuffer` disposed the
model it then reused (a reload re-enters with the same URI), a reused
model never received the re-read text, a save superseded by a reload
latched the saving flag true and disabled Save for the session, and save
resolved the session at call time so switching sessions wrote the buffer
into the wrong workspace.
**VS Code sign-in.** The init router reported `not-logged-in` whenever
the login check was false even with models configured — and that check
is true only for a Pythinker account or a provider OAuth token. A plain
API key gives neither, and Skip was component state, so the wall
returned on every reload.
**Gates could not have caught the editor bugs.**
`apps/pythinker-code/dist-web` is generated from `apps/pythinker-web`
and read by no typecheck, lint, or test; the check that guarded it only
asserted the bundle existed, and nothing invoked it.
## What changed
**Provider**
- Drop `max_output_tokens` for the Codex gateway, applied once after the
request kwargs are assembled so both a configured value and a per-turn
budget are covered.
- Stop writing the unusable `ultra` reasoning level into the config.
**Web UI**
- Normalize design tokens to hex before Monaco sees them; a test asserts
every palette token in `style.css` matches Monaco's own regex.
- Create the editor model once per URI, write pending content into a
reused model, attach the change listener after the value is applied so a
reload does not land dirty.
- Clear the saving flag unconditionally; write back to the session the
buffer was opened from.
- Stop a settled thinking step animating in the activity header for the
rest of the run.
**Gateway / desktop / VS Code**
- Route-scoped `bodyLimit` on the fs action route (a 10 MiB write is
~13.4 MiB base64-encoded, past Fastify's 1 MiB default), so
`FS_TOO_LARGE` is reachable instead of a transport rejection.
- Redact the Host bearer token from captured output — it reached both
stderr and the pre-readiness failure `Error`.
- A configured model now decides `ready` on its own; apply only the
newest provider refresh, and invalidate a superseded selection rollback.
- Opt-in seeded config profile for the dev extension host.
**Build gate**
- `copy-web-assets` records a fingerprint of every web build input;
`check-web-assets` recomputes it and fails on a stale bundle. Wired into
pre-push, the CLI `build`, and `prepack`. `pnpm run build:web` rebuilds
and restages in one step.
**Docs**
- Point the doc skills at paths that exist, drop a bilingual parity
check left over from the removed second locale, and remove the Chinese
docs tree.
## Checklist
- [x] `pnpm test` — 20309 passed, 0 failed (1220 files)
- [x] `pnpm run typecheck` — 0 errors (plus both `apps/vscode` configs)
- [x] `pnpm run lint` — 0 errors
- [x] `node scripts/upstream-sync/check-managed.mjs`, `pnpm run sherif`,
`nix build .#pythinker-code`
- [x] Every fix mutation-tested: reverting it turns its test red
- [x] Changesets added
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added browser-based workspace file editing with conflict-safe saving
and file previews.
* Expanded web session management, transcript search, subagent details,
and execution inspection.
* Added automatic model-list refreshes and improved provider/settings
management.
* Refreshed mobile, desktop, terminal, sidebar, composer, and bundled
web interface styling.
* **Bug Fixes**
* Fixed stale session status, archived-session visibility, thinking
animations, failed-turn continuation, editor reloads, and narrow-window
layout issues.
* Improved Codex compatibility and Windows Git Bash path handling.
* **Documentation**
* Consolidated documentation in English and updated API and
customization guidance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent cbf7c87 commit a0c2705
452 files changed
Lines changed: 74128 additions & 14389 deletions
File tree
- .agents/skills
- agent-core-dev
- gen-docs
- pre-changelog
- sync-changelog
- translate-docs
- write-tui
- .changeset
- .github
- apps
- desktop
- scripts
- src
- tests
- pythinker-code
- dist-web
- assets
- scripts
- src/tui
- banner
- theme
- utils
- test/tui
- pythinker-web
- src
- api
- daemon
- components
- chat
- editor
- settings
- ui
- composables
- client
- i18n/locales
- en
- icons/pythinker
- lib
- views
- test
- vscode
- .vscode
- scripts
- test
- webview-ui/src
- hooks
- stores
- docs
- en/customization
- reference
- zh
- configuration
- customization
- guides
- reference
- release-notes
- packages
- acp-adapter
- src
- agent-core-v2
- docs
- scripts
- src
- kosong/provider/bases/openai
- workspace/workspaceFs
- internal
- test
- agent/llmRequester
- kosong/provider
- session/sessionTitle
- workspace/workspaceFs
- agent-core/src
- services
- approval
- coreProcess
- event
- question
- skill/builtin
- agent-gateway
- src
- protocol
- routes
- test
- minidb
- node-sdk
- src
- v2
- test
- oauth
- src
- test
- tree-sitter-bash
- test
- fixtures/differential
- plugins
- official
- pythinker-datasource
- pythinker-webbridge/skills/pythinker-webbridge
- references
- scripts
- upstream-sync
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
5 | 12 | | |
6 | 13 | | |
7 | 14 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | | - | |
| 55 | + | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| |||
160 | 167 | | |
161 | 168 | | |
162 | 169 | | |
163 | | - | |
| 170 | + | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
| |||
0 commit comments