Commit ecdde9d
authored
feat(web): redesign the Providers settings panel (#280)
## Related Issue
None — user-reported UX problem with the desktop Providers settings tab,
plus engine/gateway hardening carried on the same branch.
## Problem
The Providers tab listed all models above the config form, so editing a
provider meant scrolling past dozens of rows. Worse, the form under the
list showed a *different* provider's data (selecting `opencode-go` still
showed `deepseek`'s name and key) and an empty `model-id` row. Delete
lived in a button at the bottom of that scroll.
Separately: quoted heredoc bodies forced extra Bash approval prompts,
the Bash tool rejected a `cwd` outside the workspace roots, an uncaught
exception killed the gateway process, and session details always
reported `last_seq: 0` so clients replayed history on resume.
## What changed
**Web (`apps/pythinker-web`)**
- `ProvidersPanel.vue`: config form comes first; the read-only model
list and the bottom delete button are gone. Each provider row has a red
trash icon that opens the existing delete confirmation. The edit form is
keyed by provider id so switching providers re-seeds it (root cause of
the stale `deepseek` form).
- `ProviderForm.vue`: the editable model table is collapsed behind a
"Models (N)" toggle, open by default only in add mode; auto-opens on Add
model or a model-row validation error. The form re-seeds when the config
prop arrives after mount (root cause of the empty row). The grid fits
the pane without horizontal scroll.
- `providerForm.ts`: `modelsForProvider` falls back to catalog aliases
when the config section has no rows; the panel merges `listModels()` in
so fallback rows carry real context sizes.
- `dist-web` restaged.
**Engine / gateway**
- `tree-sitter-bash` lexer: `scanBalancedStatements` is heredoc-aware
(queues `<<`/`<<-` delimiters, skips bodies after the newline), and
skips comments, `$[ ]`/`${ }`, `[[ ]]`, subscripts and `(( ))` so a `<<`
inside them is not taken as a heredoc. Parse budget raised from 20ms to
500ms in the permission policy and AGENTS.md reminder.
- `RuntimeWorkspaceView.resolve` no longer asserts the path is inside
the workspace; `assertAllowed` returns the resolved path and the
terminal service calls it explicitly. The Bash tool therefore accepts
any `cwd` (a command could `cd` there anyway).
- `start.ts`: `uncaughtException` is logged at error level and no longer
exits the process.
- Session detail (`GET /api/v1/sessions/:id`) reports the broadcaster's
journaled watermark as `last_seq`; the cursor is fetched after the 404
check.
- Telemetry `flattenEvent` drops null fields; `SessionIndexMirror`
tracks the give-up event once per failure streak.
- `createServerLogger` accepts a pino destination stream (used by
`boot.test.ts`).
## Verification
- `pnpm run lint`: 0 errors. Typecheck clean for agent-core-v2,
agent-gateway, telemetry, tree-sitter-bash, pythinker-web.
- Package suites: agent-gateway 1361, telemetry 72, tree-sitter-bash
867, pythinker-web 1186, agent-core-v2 6089 (7 temp-dir races under
parallel load; pass in isolation).
- Pre-push full run: 7347 passed.
- Providers tab checked in the browser against the dev gateway.
## 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: the issue must have a
maintainer's `/approve`).
- [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 provider settings with per-provider model configuration,
collapsible model lists, model counts, and inline deletion controls.
* Session details now report event positions so clients can resume
without replaying earlier events.
* Bash commands support working directories outside workspace roots.
* **Bug Fixes**
* Quoted Bash heredocs no longer trigger unnecessary approval prompts.
* The gateway server remains available after unexpected errors.
* Provider model catalogs now populate missing configured model entries
automatically.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 6c8f668 commit ecdde9d
126 files changed
Lines changed: 1033 additions & 460 deletions
File tree
- .changeset
- apps
- pythinker-code/dist-web
- assets
- pythinker-web
- src
- components/settings
- lib
- test
- packages
- agent-core-v2
- src
- agent
- agentsMdReminder
- permissionPolicy/policies
- app
- sessionIndex
- telemetry
- runtime
- session/terminal
- test
- agent/permissionPolicy
- app
- sessionIndex
- telemetry
- os/backends/node-local/tools
- runtime
- agent-gateway
- src
- routes
- services
- test
- telemetry
- src
- test
- tree-sitter-bash
- src
- test
- fixtures/differential
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 | |
|---|---|---|---|
| |||
| 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 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments