Repository navigation
Commit 9e30eed
authored
fix: reconcile engine, TUI, Tower and Remote Control fixes (#377)
## Requirement or Bug
A set of fixes and features across the engine, TUI, gateway, Tower,
Remote Control and the VS Code extension.
## Bug Reproduction Steps
Each fix has a regression test. The main ones:
- Re-import a provider registry with `pythinker provider` → the default
model and provider are cleared.
- Cancel a background agent → the TUI does not show it as stopped.
- Resume a session that used image or video tools → the media tools are
gone.
- Fork a subagent → its request prefix differs from the parent, so the
prompt cache misses.
- Press Ctrl+C while shutdown hooks run → no progress, no forced exit.
- Remote Control response over 10 MiB → rejected.
## Root Cause
Each commit fixes its own root cause; see the commit messages. All are
fundamental fixes, not workarounds.
## Code Changes
32 commits, one per change, so they can be reviewed one at a time:
- **Engine (`agent-core-v2`)**: mid-turn progress notes and calmer
NotifyUser nudges, media tools restored after resume, fork subagent
prefix parity (plus a prompt-cache probe that reports it),
`PYTHINKER_CODE_LLM_HEADERS_TIMEOUT_MS`, `select_tools` explanations,
plugin skills under qualified names, `[mcp] default_deferred`, a
todo-list nudge, subagent tool descriptions that match what the subagent
can use, model migration metadata from provider registries.
- **Tower (experimental)**: missions are merged and reviewed through
deterministic git checks; new `TowerComplete` and `TowerRebase` tools; a
bash guard blocks destructive commands in the main checkout;
`tower.base` state is removed.
- **TUI / CLI**: Working… spinner label, shutdown progress with forced
exit on a second Ctrl+C, inline skill-prompt tokens and steering, the
previous answer stays visible after task-notification turns, the
git-status footer no longer blocks (chokidar watcher), command lookup
skips workspace binaries instead of failing, cumulative survey turn
counts.
- **Gateway**: agent hooks run in the session's working directory.
- **Remote Control**: `pythinker web` exits when the relay takes the
device offline; responses over 10 MiB are sent as 5 MiB `response_chunk`
frames (up to about 100 MiB), and a relay `abort` cancels a transfer.
The relay already accepts `response_chunk` frames (deployed before this
merges).
- **Providers**: Gemini 4 uses thinking levels; "off" maps to LOW.
- **Removed**: the unused `packages/pyaos` package, the
never-implemented MCP `executor = "pyaos"` option (and its `"kaos"`
alias), the SDK `pyaos` session options and RPCs, and the `ssh2`
overrides. `flake.nix` workspace lists and the `pnpmDeps` hash are
updated.
- **VS Code**: Back navigation in multi-question AskUserQuestion
prompts.
- **Docs**: Tower guide, NotifyUser, MCP "Loading tools on demand",
provider registry upgrade metadata.
## Behavior Changes and Affected Users
| Behavior | Before | After | Who relies on the old behavior | Escape
hatch |
|---|---|---|---|---|
| Plugin skill invocation by bare name | `/skill:review` ran a plugin's
`review` skill | Only `/skill:<plugin-id>:review` runs it | Users, saved
prompts and scripts that call plugin skills by short name | None
(maintainer sign-off below); use the qualified name |
| Plugin name validation | Lowercase only | Uppercase, dots and an `@`
suffix allowed | Nobody (it only widens accepted input) | n/a |
| MCP stdio `executor = "pyaos"` / `"kaos"` | Accepted (`kaos`
normalized to `pyaos`), never implemented | Config fails validation at
load time | Configs that set it; it never had any effect | Remove the
key |
| SDK `pyaos` / `persistencePyaos` session options | Accepted and
ignored | Stripped before the RPC; the `*WithPyaos` RPCs are gone | SDK
hosts that pass them (still ignored, no crash) | n/a |
| Agent hook working directory (web/desktop) | Gateway process cwd |
Session working directory | Hook scripts that assumed the gateway cwd |
Use absolute paths in the hook |
| Command lookup finds a binary inside the workspace | Lookup failed |
Binary skipped; search continues on PATH; also when cwd is `/` | Nobody
relied on the failure | n/a |
| Tower shell in the main checkout | Any command allowed | Destructive
commands blocked | Tower users (experimental flag) | Tower is off unless
`PYTHINKER_CODE_EXPERIMENTAL_TOWER=1` |
| `tower_mode.enter` records with `base` | `base` stored in `tower.base`
| Field dropped on replay (zod strips unknown keys) | Sessions that
entered Tower before this change | Resume works; verified |
| Default model when a registry retires it | Kept the retired model |
Switches to the declared replacement and shows migration notes | Users
whose default model the registry retires | None |
| Registry re-import | Cleared default model and provider | Keeps them |
Nobody | n/a |
| Remote Control response > 10 MiB | Rejected | Sent in chunks up to
about 100 MiB | Relays without `response_chunk` support (ours is
updated) | n/a |
| `pythinker web` when the relay takes the device offline | Kept running
| Exits | Users who expected it to keep serving locally | None |
| Gemini 4 thinking | Thinking budget | Thinking level; off → LOW |
Gemini 4 users | n/a |
| MCP deferred loading | Per-server `deferred` only | Plus global `[mcp]
default_deferred` (needs tool-select flag) | Nobody (default off) | n/a
|
| Prompt text: NotifyUser / progress notes | Discouraged short notes
between tool calls | Allows them; reminders counted per round of tool
calls | Every session | n/a |
| Prompt text: todo nudge | No nudge | Reminder when todo items stay
open for several steps | Every session with a todo list | n/a |
| Prompt text: subagent tool descriptions | Listed tools the subagent
could not use | Lists only available tools | Sessions that spawn
subagents | n/a |
**Maintainer sign-off needed:** the plugin-skill bare-name removal has
no escape hatch. Approved by the maintainer for this PR.
**Contract files touched and their consumers:**
- `config-manifest.toml`: new `[mcp] default_deferred`, new registry
`upgrade` object. Additive; old configs load unchanged.
- `state-manifest.d.ts`: `tower.base` removed,
`llmRequester.lastTurnRequest` added. Old journals replay (unknown key
dropped).
- `wire-manifest.d.ts`: `tower_mode.enter` drops `base`. Older records
still parse.
- `features/externalHooks/`: hook cwd change above.
- `apps/pythinker-code/src/cli/`: `provider` refresh now goes through
the engine; `web` exits on relay offline.
- `packages/node-sdk`: `pyaos` options and RPCs removed (SDK is
internal; the CLI is the only published consumer).
**Tests:** every row above has a test in the touched package. Full
gates: build, typecheck, lint, sherif, all tests, VS Code typecheck and
tests, Nix workspace check, web bundle check, `nix build
.#pythinker-code`.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] The behavior-change table above is complete, and every removed
behavior or flipped default is named in the changeset and either has an
escape hatch or was explicitly approved by a maintainer in this PR.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.1 parent e1791a6 commit 9e30eed
376 files changed
Lines changed: 20919 additions & 14122 deletions
File tree
- .agents/skills/gen-changesets
- .changeset
- apps
- pythinker-code
- dist-web
- src
- cli/sub
- web
- constant
- tui
- commands
- components
- chrome
- dialogs
- messages
- constant
- controllers
- utils
- utils
- git
- process
- test
- cli/web
- tui
- commands
- components
- chrome
- dialogs
- messages
- panels
- controllers
- input
- utils
- utils
- git
- process
- vscode
- scripts
- src/runtime
- test
- webview
- webview-ui/src/components
- docs
- .vitepress
- configuration
- customization
- guides
- reference
- packages
- agent-core-v2
- docs
- src
- agent
- contextMemory
- llmRequester
- mcp
- media
- modeMutex
- profile
- task
- toolActivation
- toolPolicy
- toolSelect
- tools
- agent
- read-media-file
- select-tools
- task/task-wait
- usage
- app
- agentProfileCatalog
- kosongConfig
- mcpConfig
- mcpManagement
- plugin
- telemetry
- features
- externalHooks/agent
- notify
- tools/notify-user
- plan/profile
- skill
- catalog
- tools
- todo
- tools/todo-list
- tower
- injection
- protocol
- tools
- complete
- finding
- inbox
- init
- merge
- mission
- plan
- rebase
- review
- send
- spawn
- status
- human
- llm/requester
- bases
- anthropic
- google-genai
- openai-responses
- openai
- test/llm
- llm-adapter/model
- mcpCore
- session
- agentLifecycle/profile
- mcp
- subagent
- workspace
- workspaceMcpConfig
- workspaceMcp
- test
- agent
- contextMemory
- fullCompaction
- llmRequester
- loop
- mcp
- media/tools
- modeMutex
- profile
- task
- toolActivation
- toolPolicy
- toolSelect
- usage
- app
- agentProfileCatalog
- plugin
- features
- externalHooks
- notify
- tools
- skill
- catalog
- workspace
- todo
- tools
- tower
- tools
- lint
- llm-adapter/model
- mcpCore
- session
- agentLifecycle
- subagent
- state
- wire
- workspace/workspaceMcpConfig
- agent-gateway
- src
- protocol
- routes
- transport/ws/v1
- test
- klient
- scripts
- src/contract
- agent
- global
- test
- e2e
- helpers
- kosong
- src/providers
- test
- node-sdk
- scripts
- src
- config
- v2
- test
- oauth
- src
- test
- pyaos
- src
- test
- e2e
- fixtures
- remote-control
- src
- test
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 | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments