Compare commits

...
1272 Commits
Author SHA1 Message Date
esengine 56795d8913 docs(release): studio 2.45.0 notes 2026-10-18 17:56:42 -07:00
YHH 5163088956 Merge pull request #13853 from esengine/fix/browser-fit-v2
fix(studio): a page with a viewport of its own is centred at its size or scaled to fit, and the agent's clicks are mapped by the scale
2026-10-18 17:55:29 -07:00
esengine a0589c8ad0 test(studio): pixel checks that local html, a 3200x1800 image document and a PDF fill the built-in browser, with and without an agent viewport 2026-10-18 17:37:07 -07:00
YHH 6318ab0ae4 Merge pull request #13840 from esengine/fix/13833-root-missing
fix(agent): refuse a call whose project or external folder is gone, with one typed cause
2026-10-18 16:56:47 -07:00
esengine d536418db3 refactor(agent): lift the workspace lease hold out of prepareToolExecution; drop the test-only IsRootMissing 2026-10-18 16:39:50 -07:00
esengine 77134b5ef0 Merge studio into fix/13833-root-missing 2026-10-18 16:27:14 -07:00
YHH 8d714ba296 Merge pull request #13825 from esengine/feat/13320-bound-candidate
fix(compaction): retry a refused summary request at a smaller size
2026-10-18 16:23:24 -07:00
esengine f73a5b1507 docs(release-notes): wrap the root-missing fragment under 200 columns 2026-10-18 16:08:32 -07:00
esengine 814dbd5402 Merge remote-tracking branch 'origin/studio' into feat/13320-bound-candidate 2026-10-18 16:08:06 -07:00
YHH fdaf05584f Merge pull request #13820 from imcreazy/fix/explorer-after-closing-a-file
fix(studio): closing a file opened from the explorer comes back to the explorer
2026-10-18 14:41:38 -07:00
YHH dfa8f70ea4 Merge pull request #13877 from esengine/a9/cost-effect
test(boot): a DeepSeek-shaped OpenAI-compatible usage reaches the quote split by cache
2026-10-18 14:31:52 -07:00
YHH 54ca8a7847 Merge pull request #13876 from esengine/fix/13642-subagent-images
fix(delegation): a delegate gets the pasted images its task names, and a skill sub-agent is routed to the vision model
2026-10-18 14:29:31 -07:00
YHH f2ac8905ad Merge pull request #13875 from esengine/a9/versions-refresh-watch
fix(studio): opening the Versions page checks for a release when automatic download is chosen
2026-10-18 14:25:46 -07:00
esengine 1b25fca477 test(boot): a DeepSeek-shaped OpenAI-compatible usage reaches the quote split by cache (local, not pushed) 2026-10-18 14:12:49 -07:00
esengine fe6c7c3a91 fix(studio): opening the Versions page checks for a release when automatic download is chosen
Refs #13683
2026-10-18 14:10:17 -07:00
YHH e741c70074 Merge pull request #13874 from esengine/a9/fix-feedbackmine-selector
test(feedback): read the status chips inside the list, not the first one on the page
2026-10-18 14:10:02 -07:00
esengine c0d08b437c fix(delegation): a delegate gets the pasted images its task names, and a skill sub-agent is routed to the vision model
A task text that names a file in the host's own .reasonix/attachments directory
now gives the delegate that image (judged by the resolved path, read through the
same checks an @-reference gets), on the vision role with the note that it rides
the message, including on a follow-up turn that carried no image. The
read_only_skill runner took the turn's candidates without routing the model or
saying so, so a text-only skill sub-agent dropped them silently.
2026-10-18 14:09:16 -07:00
esengine f800585f31 test(feedback): read the status chips inside the list, not the first one on the page 2026-10-18 13:55:04 -07:00
YHH 45c763ce15 Merge pull request #13814 from esengine/fix/shell-mode-stuck
fix(studio): a refused ! command stays selected in the box so the next message replaces it
2026-10-18 13:36:21 -07:00
YHH 8e1ea87adc Merge pull request #13873 from esengine/fix/13872-tui-stream-append
fix(tui): appending to a streamed answer, its thinking or a command's output no longer copies it whole
2026-10-18 13:09:42 -07:00
esengine 30c63e6023 fix(tui): appending to a streamed answer, its thinking or a command's output no longer copies it whole
Each delta did s += piece on the row's text, so a long stream cost time and
memory quadratic in its length: 20000 progress events of one command (4.5 MB)
took about 13 s of the UI's own time. The text now grows in a buffer kept beside
the row, trusted only while the row still holds exactly what it last handed out.
2026-10-18 12:53:36 -07:00
YHH 80fcd85b54 Merge pull request #13843 from esengine/feat/11411-effort-in-place
feat(effort): changing reasoning depth no longer rebuilds the session and works mid-turn
2026-10-18 11:54:24 -07:00
esengine 0ce5ce6436 Merge studio into feat/11411-effort-in-place 2026-10-18 11:40:16 -07:00
YHH 27ad7ded21 Merge pull request #13871 from esengine/fix/13684-open-lookup
fix(serve): match an open pane's row whatever the case of its transcript name
2026-10-18 11:04:42 -07:00
YHH fe0020056e Merge pull request #13869 from esengine/a9/usage-billing-mode
fix(usage): keep a subscription's estimate out of the paid total
2026-10-18 10:56:03 -07:00
YHH f5d2874d61 Merge pull request #13868 from esengine/fix/jump-resolve-flaky
test(remote): bound the real-ssh jump test by the run's budget, not the product's 15 s
2026-10-18 10:49:57 -07:00
YHH de2763b21e Merge pull request #13866 from esengine/feat/13142-board-studio
feat(feedback): the contribution board in Studio and the terminal, through the kernel
2026-10-18 10:49:14 -07:00
esengine 3b54ee9438 fix(serve): match an open pane's row whatever the case of its transcript name 2026-10-18 10:44:09 -07:00
YHH 0d50803ab1 Merge pull request #13842 from esengine/feat/11531-lease-release
feat(workspace): a session waiting on a person yields its write claim, and says so when another session took it
2026-10-18 10:41:02 -07:00
esengine d8abd5b5ce fix(usage): keep a subscription's estimate out of the paid total
Refs #13276
2026-10-18 10:32:04 -07:00
esengine e6ec598a58 feat(feedback): the contribution board in Studio and the terminal, through the kernel 2026-10-18 10:31:58 -07:00
YHH 78cb353fd8 Merge pull request #13865 from esengine/fix/13858-port-identity
fix(studio): two model services on one host and different ports are two services, and a duplicate is never dropped from the list
2026-10-18 10:25:50 -07:00
YHH bf1ff861ad Merge pull request #13864 from esengine/a9/price-provenance2
feat(billing): a model's price can say where it was read and when
2026-10-18 10:22:42 -07:00
YHH a925403b6f Merge pull request #13860 from esengine/a5/opencode-go-gateway
fix(providers): recognise OpenCode Go under its documented /inference/go prefix
2026-10-18 10:21:17 -07:00
YHH 38060091bd Merge pull request #13862 from esengine/test/control-git-push-trust
test(control): cover the push trust gate and hold control/git_push.go to it
2026-10-18 10:20:58 -07:00
esengine d4089914ea test(remote): the real-ssh jump resolution test bounds ssh by the run's budget, not the product's 15 s
The product keeps its 15 second bound on one ssh -G; the source now carries it
as a field with that default, and the test that runs the installed ssh sets it
to testenv.Budget, a bound that only reports a hang.
2026-10-18 10:17:52 -07:00
YHH 7b499ffaeb Merge pull request #13863 from esengine/a5/effort-undeclared
fix(effort): say a model's levels are undeclared, and where to declare them
2026-10-18 10:13:03 -07:00
YHH 5d6743aa2c Merge pull request #13844 from esengine/a9/acp-permission-mode
feat(acp): --permission-mode fixes the session posture and caps what a client can raise
2026-10-18 10:12:13 -07:00
esengine add01e5f04 fix(studio): a viewport override with a zero or non-finite size means no override 2026-10-18 10:11:53 -07:00
esengine 223a158a02 Merge origin/studio into feat/11531-lease-release 2026-10-18 10:06:32 -07:00
esengine ad7e7f835f fix(studio): two model services on one host and different ports are two services, and a duplicate is never dropped from the list 2026-10-18 09:58:38 -07:00
imcreazy 481aa9f9a6 fix(studio): closing a file opened from the explorer comes back to the explorer 2026-10-19 00:58:10 +08:00
esengine 1766c04904 feat(billing): a model's price can say where it was read and when
Refs #13276
2026-10-18 09:56:46 -07:00
YHH ea0538a72e Merge pull request #13851 from esengine/fix/13335-sibling-folders-domain
fix(workspace): a writer with no declared extent holds its own folder, not the whole repository
2026-10-18 09:56:07 -07:00
esengine 5888922ffc refactor(i18n): keep the /effort undeclared wording in the setting catalogue 2026-10-18 09:53:32 -07:00
esengine 94e236f203 docs(release): note the /effort wording fix 2026-10-18 09:51:17 -07:00
esengine 8ce086e1bc fix(effort): say a model's levels are undeclared, and where to declare them 2026-10-18 09:51:16 -07:00
esengine e1e5301681 test(control): cover the push trust gate and its refusals, and hold the file to it
internal/session/control/git_push.go measured 0 from the control package's own
tests, so declaring it sensitive recorded a floor of 0 that could never fail.
The tests cover the trust refusal for both calls, a repository that is not
there, a branch with no upstream, and the commit lock released after a refused
push; the floor is now 100.
2026-10-18 09:47:51 -07:00
esengine 7b8f7de8b0 docs(release): note the OpenCode Go endpoint fix 2026-10-18 09:45:27 -07:00
esengine fe45ff0a8c fix(providers): recognise OpenCode Go under its documented /inference/go prefix 2026-10-18 09:43:43 -07:00
esengine ae9fba3fd0 fix(workspace): a writer with no declared extent holds its own folder, not the whole repository
Two project folders under one git repository share a writer domain on purpose
(the lock and the visibility of each other's claims), but an undeclared writer
claimed the domain root, so sibling projects waited on each other for bash and
MCP writes, and the refusal read held X, requested X. It now claims the
selected folder; a session on the repository root still overlaps both, and a
declared path that cannot be resolved still claims the whole repository.
2026-10-18 09:36:18 -07:00
YHH ebe4f2dca2 Merge pull request #13850 from esengine/c5/sensitive-git-push
chore(security): declare the Git push path and the host-only route list sensitive
2026-10-18 09:31:49 -07:00
esengine 817e3fa03d fix(studio): a page with a viewport of its own is centred at its size or scaled to fit, and the agent's clicks are mapped by the scale 2026-10-18 09:31:00 -07:00
YHH 442f05cd11 Merge pull request #13846 from xxoingr/test/boot-catalog-close-budget
test(boot): bound the catalog close in cleanup by the hang budget
2026-10-18 09:24:13 -07:00
esengine 8126f5cf1e chore(security): declare the Git push path and the host-only route list sensitive
The push is the one git action Reasonix performs that leaves the machine, and
the host-only route list decides which requests a paired device may make. Both
now demand review plus security_review and are held to the coverage they have:
gitpush 84.0, serve/git_push.go 77.0, serve/host_routes.go 93.0, and
control/git_push.go 0 (its behaviour is covered by the serve and boot effect
tests, which the per-package gate does not count).
2026-10-18 09:17:17 -07:00
YHH 904ca4359b Merge pull request #13834 from esengine/feat/git-panel
feat(studio): one Git panel: a changes tree, discard, push with a preview, commit details and a section per repository
2026-10-18 09:10:38 -07:00
esengine c5e8080866 feat(workspace): a session waiting on a person yields its write claim, and says so when another session took it
An Auto Guard card and a call that asks before it writes now give the claim
back for the wait; the lease records granted claims so the resume can name
who took the ground, the model gets workspace.claim_contended and the receipt
workspace_claim_yielded. A blocked acquisition ends at a user-set maximum wait
with workspace.claim_timeout.
2026-10-18 09:08:45 -07:00
xxoingr e4a0841fec test(boot): bound the catalog close in cleanup by the hang budget
closeBootTestHistoryCatalog gave the history and usage catalog closes a
fixed 5 s. Closing a SQLite catalog, and waiting out an open still in
flight, can take longer on a loaded Windows runner, and the posture
effect test failed there in cleanup with "close usage catalogs: context
deadline exceeded". The wait only exists to report a hang, so use
testenv.Budget; a close that never returns still fails the same way.
2026-10-19 00:07:46 +08:00
esengine ab66297bab feat(acp): --permission-mode fixes the session posture and caps what a client can raise
Refs #13839
2026-10-18 09:00:03 -07:00
YHH 02341bf950 Merge pull request #13763 from esengine/a9/tools-disabled
feat(tools): turn tools off by name, one registry removal for every surface
2026-10-18 08:55:30 -07:00
esengine a52b35551f feat(session): a sub-agent and the status line follow an in-place depth change
A child that shares the parent's provider starts on the depth in force now, and one
that inherits the parent's model without an effort of its own is built for it, as a
rebuild would have given. The status line reads the depth the session is on.
2026-10-18 08:51:08 -07:00
esengine edc7e01bb4 feat(session): change reasoning depth in place when the provider takes it per request
A provider that exposes the depths it accepts in Request.EffortOverride
(provider.RequestEffortProvider; the OpenAI-shaped adapter does) lets a session change
depth without a rebuild: the controller sets a session depth every main request
carries, updates its running selection, and accepts the change mid-turn. Serve (and so
the terminal and the desktop) and ACP both apply it in place and keep their rebuild for
a depth the provider does not take per request. The level is still saved to the user's
config so a restart opens on it.
2026-10-18 08:51:08 -07:00
esengine a07ca77b69 fix(git): repositories are listed once and kept until the structure changes, reads are settled and not repeated, a kernel without the route keeps the old behaviour 2026-10-18 08:50:37 -07:00
esengine 6b653a7f32 fix(agent): refuse a call whose project or external folder is gone, with one typed cause 2026-10-18 08:46:27 -07:00
YHH d8f9eef43d Merge branch 'studio' into a9/tools-disabled 2026-10-18 08:42:35 -07:00
YHH 89d86f4d3f Merge pull request #13838 from esengine/a9/peak-indicator
feat(status): show which of the vendor's billing windows the model is in
2026-10-18 08:42:12 -07:00
esengine f8e16bfc29 feat(status): show which of the vendor's billing windows the model is in
The vendor's published schedule already prices every request; the status bar
now says, live, whether the model is billed at the peak or the off-peak rate
and when that changes, where the model is billed at the vendor's own rate.
2026-10-18 08:16:23 -07:00
esengine 30c6589451 wip peak indicator 2026-10-18 08:16:16 -07:00
esengine 0608ffeb63 fix(git): a repository name and a path are taken from a directory listing and from git's own list, never built from the request 2026-10-18 08:10:18 -07:00
YHH da9fbe7307 Merge pull request #13836 from esengine/a5/phone-push-service-error
fix(phone): say a browser that cannot reach its push service is that, not an account outage
2026-10-18 08:02:05 -07:00
YHH c38beaf09a Merge pull request #13835 from esengine/fix/13811-browser-fit-wide-viewport
fix(studio): show a page the agent laid out wider than the pane whole, scaled to fit
2026-10-18 08:01:11 -07:00
esengine a3a8c1ff79 fix(serve): host-only routes are one list the handlers and the remote proxy both read; windows fixtures and a HEAD read that failed is not a detached HEAD 2026-10-18 07:56:16 -07:00
esengine aa60b7f48b fix(serve): a paired device cannot preview or send a push or discard a change 2026-10-18 07:52:20 -07:00
esengine 040aa7dbde fix(phone): say a browser that cannot reach its push service is that, not an account outage 2026-10-18 07:48:27 -07:00
esengine ad9219543b fix(studio): show a page the agent laid out wider than the pane whole, scaled to fit 2026-10-18 07:44:17 -07:00
YHH 5f4c9ffad7 Merge pull request #13822 from esengine/a5/phone-push
feat(phone): remind this phone through Web Push, with its own key and a push-only service worker
2026-10-18 07:32:53 -07:00
YHH e5be3420b3 Merge pull request #13832 from esengine/a5/step-up-effect
test(mcp): hold step-up authorization at the boot boundary
2026-10-18 07:31:52 -07:00
YHH d130baa87c Merge pull request #13828 from esengine/a9/balance-format
feat(billing): a balance endpoint declares the format it answers in
2026-10-18 07:28:27 -07:00
esengine d294509df6 docs(release): the Git panel 2026-10-18 07:27:42 -07:00
esengine 18d679077d feat(studio): one Git panel: a changes tree to stage, discard and commit, push with a preview, commit details, and a section per repository 2026-10-18 07:27:41 -07:00
esengine a81f06208c feat(git): push the current branch to its upstream from a throwaway repository, with a preview and typed refusals 2026-10-18 07:27:41 -07:00
esengine 617a7c40d6 feat(git): a commit opens into its files and each diff, and one changed file can be discarded 2026-10-18 07:27:41 -07:00
esengine 344db1d16b feat(git): a workspace folder of projects lists its repositories, and every git read and write names which one 2026-10-18 07:27:41 -07:00
YHH aa34e20192 Merge pull request #13830 from esengine/fix/thought-time-test
test: three timing-dependent tests no longer depend on wall-clock thresholds or cleanup races
2026-10-18 07:25:46 -07:00
YHH 9f19b31fdf Merge pull request #13791 from esengine/a9/queue-paused
fix(peers): a message the person let in starts over a paused queue, by what paused it
2026-10-18 07:23:09 -07:00
esengine 8dcbc55218 test(mcp): gofmt 2026-10-18 07:12:58 -07:00
esengine 8993a8eec1 test(mcp): drop an unneeded Sprintf 2026-10-18 07:12:58 -07:00
esengine a40d996915 test(mcp): hold step-up authorization at the boot boundary 2026-10-18 07:12:58 -07:00
esengine 1119118780 Merge origin/studio into a5/phone-push 2026-10-18 07:12:44 -07:00
esengine 92b39e3ed0 feat(billing): a balance endpoint declares the format it answers in
A balance_url on a host that is not a vendor's own now names its format
(balance_format) or is not read, and the key is not sent to it. The connection
editor edits the address and format. Existing relay entries are declared as
deepseek once, and a format the 1.x line drops from the shared file is put back
at the next start.
2026-10-18 07:10:10 -07:00
YHH 6b8928a8c3 Merge pull request #13782 from esengine/a5/appimage
feat(release): build and verify an AppImage of Studio on Linux (download only)
2026-10-18 07:08:12 -07:00
YHH 6b0c9ef061 Merge pull request #13784 from esengine/a5/remote-agent-guard
feat(cli): refuse remote subcommands that change the book or open a link for an agent's shell
2026-10-18 07:07:31 -07:00
YHH 6e9294dd99 Merge branch 'studio' into a9/queue-paused 2026-10-18 07:07:27 -07:00
esengine 424343a8b4 test(boot): the mod-queued-prompt test waits for the turn it started before the temp dirs go
The queued prompt starts a turn of its own, still writing under the test's temp
directory when the test returned, so the directory's cleanup failed with 'directory not
empty'. Seen as 30 failures in 40 runs with eight test processes at once, 0 in 40 after.
2026-10-18 07:02:34 -07:00
esengine 118310d400 test(control): the heredoc cancel test waits for the shell to start, not for 2 seconds
The test gave a cold Git Bash two seconds to write the heredoc's file; on a shared
Windows runner the start can take longer, and the failure (4.25 s) was that wait plus
the cancel. The bound is now 15 seconds, only to keep a hang from lasting forever.
2026-10-18 07:02:34 -07:00
esengine 334598db44 test(boot): the thinking-time effect test asserts a measurement was taken, not a wall-clock size
The test compared the host's measured thought to the provider's 60 ms sleep minus 10,
which a loaded -race runner breaks (42 ms against 50). The size of the measurement is
the thought clock's own unit test with an injected clock; this test keeps its claim that
a measurement is taken, kept with the turn and framed identically.
2026-10-18 07:02:34 -07:00
YHH c58a1d7cb3 Merge pull request #13827 from esengine/a5/acp-sdk-conformance
test(acp): drive the agent with the official SDK and hold its output to the shipped schema
2026-10-18 07:01:43 -07:00
YHH 5b3968c6f5 Merge pull request #13795 from esengine/a5/push-host
feat(host): tell enrolled phones that something is waiting, and manage them from the desktop
2026-10-18 06:56:27 -07:00
YHH 26d7a21bf6 Merge pull request #13809 from esengine/chore/deps-go-group-with-desktop
chore(deps): bump the go group with 11 updates, including the desktop module
2026-10-18 06:56:15 -07:00
esengine f676e1d61a ci: run checks against studio 2026-10-18 06:48:32 -07:00
esengine 22bfd09c40 Merge remote-tracking branch 'origin/studio' into a5/remote-agent-guard 2026-10-18 06:48:32 -07:00
esengine 14ea889c81 Merge remote-tracking branch 'origin/studio' into a5/appimage 2026-10-18 06:46:34 -07:00
esengine d73352f4a6 test(acp): drive the agent with the official SDK and hold its output to the shipped schema 2026-10-18 06:44:42 -07:00
esengine 751def6d32 chore(deps): bump the go group with 11 updates, including the desktop module 2026-10-18 06:37:48 -07:00
YHH d8f84ed690 Merge pull request #13819 from esengine/fix/dispatch-profile-selection
fix(delegation): the dispatch profile stays the call's selection
2026-10-18 06:33:48 -07:00
esengine a26328f24b style(compaction): wrap the last refusal 2026-10-18 06:29:11 -07:00
esengine f7bc03da36 fix(compaction): retry a refused summary request at a smaller size
A summary request the provider rejects as larger than its context (the documented
context_length_exceeded code, nothing else) is retried at 70%, 50% and 35% of the
refused input, shortened by the same deterministic steps as before; a refused request
costs nothing, so the digest is not given up until three smaller inputs were refused.
A provider that refuses every size ends as summary_input_too_large.
2026-10-18 06:28:05 -07:00
esengine 79d971d607 feat(phone): remind this phone through Web Push, with its own key and a push-only service worker 2026-10-18 06:19:59 -07:00
YHH 97d7009cbb Merge pull request #13804 from esengine/dependabot/github_actions/actions-e40781d787
chore(deps): bump the actions group with 2 updates
2026-10-18 06:09:58 -07:00
esengine ba25d7c854 fix(peers): a message the person let in starts over a paused queue, by what paused it
The inbox manifest now records why a queue is paused, as a typed code beside
the old boolean. A message approved on its card is claimed over any pause; one
let in by a standing release or dispatch switch only over a pause the host set
to guard stale input, and stays queued over one the person set. The pause and
older queued items are left as they were.
2026-10-18 06:07:09 -07:00
esengine 002b09a921 fix(delegation): the dispatch profile stays the call's selection; the actual model rides the status events
#13812 made the dispatch-time profile the concrete runtime. The effort-switch audit
test (merged beside it) holds that profile to what the call selected (empty model and
effort when it inherits), so studio went red. The selection is audited as the model
asked it; what the child ran on is on its status events, which the window already
reads, so the dispatch profile goes back to the selection.
2026-10-18 06:05:44 -07:00
esengine 7f21f635ab feat(tools): turn tools off by name, one registry removal for every surface
[tools].disabled removes a tool from every request and refuses a call to it with
the reason; tools another feature requires declare so and stay on with a note;
a project file can only add names. Settings lists every tool with a switch.
2026-10-18 06:03:20 -07:00
YHH bda7ee6772 Merge pull request #13816 from esengine/a9/readme-dsh
docs: point to the DeepSeek Harness integration from the README and the guide
2026-10-18 05:53:30 -07:00
YHH 7df0c74c55 Merge pull request #13807 from esengine/dependabot/npm_and_yarn/desktop/electron/npm-76902424de
chore(deps-dev): bump the npm group in /desktop/electron with 2 updates
2026-10-18 05:53:07 -07:00
YHH 63cfcee555 Merge pull request #13799 from esengine/dependabot/go_modules/desktop/go-1d423e97b0
chore(deps): bump golang.org/x/mod from 0.41.0 to 0.42.0 in /desktop in the go group
2026-10-18 05:52:35 -07:00
YHH a151994365 Merge pull request #13798 from chuiwenwei/fix/compaction-stale-context-not-latched
fix(agent): release a stale-context maintenance block on the growth that caused it
2026-10-18 05:52:16 -07:00
YHH 5b1c282fed Merge pull request #13812 from esengine/feat/13640-child-model
feat(delegation): sub-agents show the model and effort they ran on
2026-10-18 05:47:23 -07:00
YHH 1b0b593f66 Merge pull request #13813 from esengine/a5/search-model-not-added
fix(settings): do not offer search models from connections that were never added
2026-10-18 05:44:33 -07:00
esengine edbe588256 docs: point to the DeepSeek Harness integration from the README and the guide
The integration lives in docs/DSH.md; the README and the guide now say it
exists and give the three steps and the index address in the README.
2026-10-18 05:43:50 -07:00
YHH ed9a4ad1c9 Merge pull request #13778 from esengine/feat/13694-mod-rulings
feat(extension): a mod answers a tool call, adds turn context, reads the session and queues a prompt
2026-10-18 05:42:40 -07:00
YHH 31d39290ec Merge pull request #13808 from esengine/dependabot/npm_and_yarn/desktop/frontend-next/npm-8a0a74f25b
chore(deps): bump the npm group in /desktop/frontend-next with 7 updates
2026-10-18 05:30:14 -07:00
YHH 245b85ec13 Merge pull request #13638 from SivanCola/codex/unified-project-sidebar
Unify local and SSH project navigation / 统一本机与 SSH 项目侧栏
2026-10-18 05:29:51 -07:00
YHH f43d985bda Merge pull request #13797 from chuiwenwei/fix/memory-finish-interrupted-rename
fix(memory): repair a rename interrupted after retiring the old file
2026-10-18 05:22:13 -07:00
esengine 0556027a94 fix(studio): a refused ! command stays selected in the box so the next message replaces it 2026-10-18 05:18:25 -07:00
esengine 44d3acfaf5 fix(desktop): the row keeps the model name and nothing in front of or behind it 2026-10-18 05:18:06 -07:00
esengine 8f691039d3 fix(desktop): the sub-agent row gives way on the provider, not the model name 2026-10-18 05:16:44 -07:00
esengine bcd54401f5 docs(release): shorten the search-model note 2026-10-18 05:09:12 -07:00
esengine 2f3ef27558 fix(settings): do not offer search models from connections that were never added 2026-10-18 05:04:45 -07:00
esengine e2c0aeb1a2 refactor(delegation): keep the child identity record in its own file 2026-10-18 05:00:56 -07:00
esengine b5c891a593 feat(desktop): sub-agents show the model and effort they ran on
The panel row, the full-record header and the nested card of the spawning call show
provider/model · effort, with the full reference as the title. The card takes it
from the child's status events, so a failed or interrupted run keeps it; a batch's
items each carry their own.
2026-10-18 05:00:56 -07:00
esengine 88982d21ad feat(delegation): every status of a child names the model and effort it ran on
The dispatch profile now names the concrete runtime a call resolves to (an alias
expanded, the parent's model when the call inherits), and each child's status events,
from queued to the terminal one, carry what its run actually started with, per item
for a batch. A failed or interrupted child therefore still says what it ran on.
2026-10-18 05:00:56 -07:00
dependabot[bot] 6e91c80dac chore(deps): bump the npm group in /desktop/frontend-next with 7 updates
Bumps the npm group in /desktop/frontend-next with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [react](https://github.com/react/react/tree/HEAD/packages/react) | `19.3.0` | `19.3.1` |
| [react-dom](https://github.com/react/react/tree/HEAD/packages/react-dom) | `19.3.0` | `19.3.1` |
| [@testing-library/user-event](https://github.com/testing-library/user-event) | `14.6.7` | `14.6.8` |
| [jsdom](https://github.com/jsdom/jsdom) | `30.1.2` | `30.1.3` |
| [playwright](https://github.com/microsoft/playwright) | `1.64.0` | `1.64.1` |
| [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `8.3.3` | `8.3.4` |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `5.0.3` | `5.0.4` |


Updates `react` from 19.3.0 to 19.3.1
- [Release notes](https://github.com/react/react/releases)
- [Changelog](https://github.com/react/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/react/react/commits/v19.3.1/packages/react)

Updates `react-dom` from 19.3.0 to 19.3.1
- [Release notes](https://github.com/react/react/releases)
- [Changelog](https://github.com/react/react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/react/react/commits/v19.3.1/packages/react-dom)

Updates `@testing-library/user-event` from 14.6.7 to 14.6.8
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v14.6.7...v14.6.8)

Updates `jsdom` from 30.1.2 to 30.1.3
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Commits](https://github.com/jsdom/jsdom/compare/v30.1.2...v30.1.3)

Updates `playwright` from 1.64.0 to 1.64.1
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.64.0...v1.64.1)

Updates `vite` from 8.3.3 to 8.3.4
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v8.3.4/packages/vite)

Updates `vitest` from 5.0.3 to 5.0.4
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v5.0.4/packages/vitest)

---
updated-dependencies:
- dependency-name: react
  dependency-version: 19.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: react-dom
  dependency-version: 19.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: "@testing-library/user-event"
  dependency-version: 14.6.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: jsdom
  dependency-version: 30.1.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: playwright
  dependency-version: 1.64.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: vite
  dependency-version: 8.3.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: vitest
  dependency-version: 5.0.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-18 12:00:23 +00:00
dependabot[bot] 6509535600 chore(deps-dev): bump the npm group in /desktop/electron with 2 updates
Bumps the npm group in /desktop/electron with 2 updates: [electron](https://github.com/electron/electron) and [playwright](https://github.com/microsoft/playwright).


Updates `electron` from 44.7.0 to 44.7.2
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](https://github.com/electron/electron/compare/v44.7.0...v44.7.2)

Updates `playwright` from 1.64.0 to 1.64.1
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.64.0...v1.64.1)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 44.7.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: playwright
  dependency-version: 1.64.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-18 12:00:17 +00:00
YHH c70464535b Merge pull request #13793 from esengine/feat/13780-level-notice
feat(feedback): tell the person once when their level goes up, if they asked
2026-10-18 04:57:50 -07:00
dependabot[bot] 0cf0d10c2a chore(deps): bump the actions group with 2 updates
Bumps the actions group with 2 updates: [github/codeql-action/init](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.38.3 to 4.39.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/24c54180a607b1449ed407dd24f251e4e9147c8d...6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee)

Updates `github/codeql-action/analyze` from 4.38.3 to 4.39.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/24c54180a607b1449ed407dd24f251e4e9147c8d...6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-18 11:56:46 +00:00
YHH 54f4f5a8b6 Merge pull request #13787 from esengine/a9/peer-release-idle
fix(peers): the text of a message from another session is not read for file references
2026-10-18 04:53:09 -07:00
dependabot[bot] 68d3238e98 chore(deps): bump golang.org/x/mod in /desktop in the go group
Bumps the go group in /desktop with 1 update: [golang.org/x/mod](https://github.com/golang/mod).


Updates `golang.org/x/mod` from 0.41.0 to 0.42.0
- [Commits](https://github.com/golang/mod/compare/v0.41.0...v0.42.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-18 11:52:28 +00:00
YHH c88d1715d4 Merge pull request #13790 from esengine/fix/terminal-feedback-surface
fix(cli): name the terminal's feedback surface in its first build so /feedback works from the start
2026-10-18 04:49:39 -07:00
YHH 8078d62b03 Merge pull request #13789 from esengine/a9/dsh-enable-step
docs(dsh): an installed plugin starts off and must be switched on
2026-10-18 04:43:20 -07:00
Will 944c61f9e6 test(memory): cover the interrupted-rename pairing and name-conflict edges
Two controls the audit's contract implies but nothing pinned: a staged copy whose
retired twin came from a different publish is left untouched (no pair, no writes),
and a fact created at the old name after the kill is never overwritten — the retry
refuses and keeps both artifacts for a later attempt. The refusal only named the
conflict once the exist check unwrapped the error, so it now uses
errors.Is(err, fs.ErrExist).
2026-10-18 19:42:39 +08:00
YHH 3f98212608 Merge pull request #13246 from chuiwenwei/fix/sessioninbox-unreadable-blobs-not-empty
fix(sessioninbox): stop publishing an empty queue when the bodies cannot be read
2026-10-18 04:42:33 -07:00
esengine 37892a1738 test(release): the artifact check requires the AppImage for both architectures 2026-10-18 04:40:24 -07:00
YHH 2ce0c3f97a Merge pull request #13777 from esengine/a5/wsl-cli
feat(cli): add, test and connect a WSL machine from the command line
2026-10-18 04:29:46 -07:00
esengine 29220a5c18 Merge origin/studio into a5/push-host 2026-10-18 04:26:23 -07:00
esengine ffa3d3df29 feat(desktop): mount the phone notification block under Remote settings 2026-10-18 04:25:25 -07:00
Will 13938149d5 fix(agent): release the stale-context block on the growth that caused it
A fold that loses the transcript race records FailContextChanged, but no later
turn could release it: retriesOnGrowth did not name the code, the receipt holds
until the generation advances, and the generation only advances on a commit the
held receipt prevents. One racing append then latched automatic compaction off
for the rest of the session, across restarts, and the next overflow failed the
turn instead of folding.

Name the code in retriesOnGrowth so the append that made the fold stale is the
growth that releases the receipt. The receipt already carries InputHash and
InputTokens, and every other code keeps its hold. A plan/provider refusal still
holds, and the retry buys exactly one fold: without further growth the next
prepare neither folds again nor re-records the block.
2026-10-18 19:24:01 +08:00
Will 406bf96f1e test(memory): pin that an interrupted rename restores the old revision first
The recovery may either finish the rename forward or roll it back. Only rollback
keeps an ExpectedRevision from before the rename valid, so the choice is a
contract, not an implementation detail; forcing the forward path makes this test
fail with name=beta revision=2.
2026-10-18 19:21:09 +08:00
Will 3eadd288f9 fix(memory): repair a rename interrupted after retiring the old file
publishRename retires the old fact file, flushes the index, then publishes
the staged new file. A kill in that window leaves the fact's only copies as
hidden .retired-* and .staged-* files: Read/List/Revisions report nothing,
the save retry by id reports "memory id not found", and a retry by name
mints a second identity for the same name.

A save by id that finds no active file now looks for the hidden pair a
single publishRename call writes, matched by the nanosecond stamp in the
two file names, with the staged copy's frontmatter carrying that id. The
rule is disk-driven and rollback-first: readable retired bytes are restored
under the old name (same bytes and mode) and reindexed, so the caller's
expected revision still names the fact and the retried save redoes the
rename itself. Only when the retired copy cannot be parsed does recovery
publish the staged copy forward under its new name. With no matching pair
nothing is written and the id is still reported not found, so a retired
copy left by a committed rename is not revived.

Covered by the audit's kill probe, an uninterrupted-rename control, a name
retry after recovery, a failed (not killed) publish, an unpaired-artifact
guard, and a cross-scope move whose pair spans two directories.
2026-10-18 19:19:35 +08:00
esengine 9de84cee74 style: modernize the new tests 2026-10-18 04:17:47 -07:00
esengine 8ddda45b60 style(desktop): a shorter line for the queued-prompt row of the mod preview 2026-10-18 04:17:45 -07:00
esengine 9bb7a469d2 refactor(config): render the notifications section from its own file 2026-10-18 04:12:50 -07:00
esengine 319f079a63 feat(host): tell enrolled phones that something is waiting, and manage them from the desktop 2026-10-18 04:11:40 -07:00
esengine 1f285edf60 feat(desktop): the mod preview lists reading the session and queueing prompts separately 2026-10-18 04:08:35 -07:00
YHH 81e0438de3 Merge pull request #13783 from esengine/feat/13111-origin-record
feat(agent): count a call whose arguments copy text an external result gave the task
2026-10-18 04:08:06 -07:00
YHH 4d094ce1f9 Merge pull request #13781 from esengine/a5/wsl-ui
feat(desktop): add a WSL distribution as a remote machine from Settings
2026-10-18 04:04:26 -07:00
YHH 66d144dd90 Merge pull request #13779 from esengine/a5/sched-pkg
refactor(schedule): run the scheduled child from a small package the Studio host can import without the command line
2026-10-18 04:03:00 -07:00
Will a88c474cbd i18n: carry the unrecovered wording in the embedded catalogues
Review follow-up after rebasing onto studio: messages_en/zh/zh_tw.go sit at the
800-line ceiling, so the two new strings move into the embedded QueueMessages and
NotifyMessages catalogues, which have their own files. No call site changes.
2026-10-18 19:02:12 +08:00
esengine 0c000c7ad4 feat(feedback): tell the person once when their level goes up, if they asked 2026-10-18 04:01:54 -07:00
esengine 2c8eb49a14 test(modhost): the byte-ceiling refusal reaches the mod as its own code 2026-10-18 04:01:29 -07:00
esengine 2a9743d790 feat(extension): split the session capability, and bound one queued prompt
session.read and session.submit are separate capabilities, so a mod that only
reads usage cannot put words in front of the model. One prompt a mod queues is
bounded by [mods] submit_bytes (8 KiB, 0 for none) and refused with a typed
identity that does not spend the per-turn count. The docs say the turn a queued
prompt starts is held to this session's own approvals and sandbox.
2026-10-18 04:01:29 -07:00
esengine 96f261b398 docs(mods): the receipt gap for a running mod, in the docs and in matching English 2026-10-18 04:01:28 -07:00
esengine 4af9d05744 docs(extension): keep the new prose and comments inside the repo's budgets 2026-10-18 04:01:28 -07:00
esengine 336cbc3c22 chore(extension): regenerate the protocol artifacts for the prompt refusal identity 2026-10-18 04:01:28 -07:00
esengine f28360eadc feat(extension): a mod reads the session and queues a prompt, and settings bound what it may add 2026-10-18 04:01:28 -07:00
esengine 49abf8c521 feat(extension): an extension may add context blocks to the turn tail, bounded by the user's mod ceilings 2026-10-18 04:01:28 -07:00
esengine f26e1c1359 feat(extension): a block at tool.before may carry an answer that stands in for the tool's output 2026-10-18 04:01:28 -07:00
SivanCola 965f331798 test(studio): align browser guards with unified project rows
Problem: Studio browser guards failed on 17f816d11 when the ordering guard
counted SSH rows as conversations in its local project. The remaining quick
action fixture also expected two trailing Archive/Delete buttons.

Root cause: Browser acceptance scripts still encoded the former separate
machine lists, trailing Delete action and individual folding chevrons. The
English wording scan also lacked a newly visible demo conversation title.

Fix: Scope ordering to the named local project and independently assert SSH
rows and keyboard focus are preserved. Exercise default-off and explicit
quick-action choices for local and remote rows, including hit targets,
leading Pin/trailing Archive geometry and menu access. Load the real row
stylesheet in the compact fixture and match its existing 1px spacing while
retaining 34px rows, ellipsis and contained controls. Update manual tree
checks to use project-row folding and five-item previews.
Recognize the existing demo title as user content in the wording fixture list.

Verification: Reproduced the ordering, quick-action and fixture failures
before the repair. Ran all 55 CI browser-guard commands against the built
perf harness and reran repaired guards, the affected manual tree scripts,
gofmt, root vet, make lint,
make check and the required builtin/boot suites. This changes acceptance
scripts only; production UI, workflows and budgets are unchanged.
2026-10-18 18:59:22 +08:00
Will 51db70d463 i18n(desktop): translate inbox.unrecovered 2026-10-18 18:57:25 +08:00
Will d91111647b fix(sessioninbox): give the unrecovered refusal an identity and stop racing the sink
The reviewer's blocking item: rebindInbox (called from New) started a goroutine
that read c.sink while New was writing it. Capture the sink before starting the
goroutine, for the new unrecovered notice and for the pre-existing recovered one
(it had the same shape and the same race).

Also give the refusal an identity: ErrUnrecovered, wrapped by commitManifestLocked,
with a case in the serve switch so the frontend gets inbox.unrecovered instead of an
internal fault. repolint's refusal-path rule requires that case.
2026-10-18 18:57:20 +08:00
Will 50a235f0f7 fix(sessioninbox): show an unreadable queue as unknown instead of empty
The store already told a caller that the queue's bodies could not be read
(InboxSnapshot.Unrecovered), but nothing user-facing consumed it: the TUI's
/queue line and the notice stream both dropped the field, so an unreadable
queue still read as "inbox empty" and the user could not tell it from a
genuinely empty one.

The TUI mirror and renderQueueList now carry and say the unknown state, and
the controller emits a distinct inbox_unrecovered warn notice (with an
InboxUnrecovered payload naming the queue directory) beside the existing
inbox_recovered one, so its sentence is not confused with "recovered N".

Cause: the frontend contract field had no consumer on the TUI or notice
surfaces.
Blast radius: TUI /queue line, TUI and desktop notice wording, and the two
controller inbox open paths; additive field, code and payload, no on-disk
schema change, recovered behaviour unchanged.
Neighbouring behaviours tested: empty-but-readable queue, recovered salvage
count, TUI mirror JSON decoding of the real GET /inbox body, and both the
serve and control boundaries.
Why this layer: the store owns "unknown vs empty"; the surfaces that render
a queue are where a user can act on it.

Provider-visible prefix: none
2026-10-18 18:57:20 +08:00
Will dc409fc506 fix(sessioninbox): stop publishing an empty queue when salvage cannot read bodies
salvageOrphanBlobsLocked returned nil for both "no blobs" and "blobs
unreadable", so a corrupt manifest plus an unreadable blobs directory
committed an empty paused manifest (recovered=true, recoveredN=0,
items=null) over the quarantined one. The queued bodies stayed on disk but
were unreachable, the RecoveredN>0 notice never fired, and the queue looked
empty.

The salvage now reports the read failure, and that failure is not turned
into a manifest: the corrupt bytes stay in place as evidence, the store
comes up paused with unrecovered=true on the snapshot, and no commit can
overwrite the evidence while the bodies are unreadable. An absent or empty
blobs directory is still an empty queue, not a failure.

Cause: (items, err) collapsed to (nil, nil) for directory-level and
per-entry read errors.
Blast radius: sessioninbox Open/Snapshot plus the commit path; new
additive InboxSnapshot.Unrecovered field, no on-disk schema change.
Neighbouring behaviours tested: readable-dir salvage, absent/empty blobs
dir, healthy manifest untouched, symlink blob refusal.
Why this layer: the store owns the manifest/blob transaction, so the
"unknown vs empty" distinction belongs where the read fails.
2026-10-18 18:57:20 +08:00
esengine 9e0c35100c docs(dsh): say that an installed plugin starts off and must be switched on
Found while demonstrating the install through Discover: until the switch and
both components read Running there is no reasonix tool, and the model falls
back to running reasonix -p in its own shell, which only looks like a
delegation.
2026-10-18 03:55:34 -07:00
esengine 5910c8ae10 fix(peers): the text of a message from another session is not read for file references
An @token in a peer message or a background-job notice was frozen into the
prompt as a file reference, so a sender could make the receiver read a file
into its prompt, and an unreadable one paused the queue behind it. Items the
host authored are data and are no longer scanned.
2026-10-18 03:53:52 -07:00
YHH 08f01f2d79 Merge pull request #13776 from esengine/feat/mcp-panel
feat(tui): add and remove MCP servers from the /mcp panel
2026-10-18 03:52:00 -07:00
esengine d226841381 fix(cli): name the terminal's feedback surface in its first build so /feedback works from the start 2026-10-18 03:48:37 -07:00
esengine 1b556ddbc8 feat(cli): refuse every remote subcommand that changes the book or opens a link when an agent tool started it 2026-10-18 03:33:32 -07:00
esengine 76e579923f fix(release): name the AppImage explicitly and make the verifier say what it wanted 2026-10-18 03:31:48 -07:00
esengine 97e4675986 Merge remote-tracking branch 'origin/studio' into a5/wsl-cli 2026-10-18 03:31:04 -07:00
esengine dd6b73380d Merge remote-tracking branch 'origin/studio' into a5/sched-pkg 2026-10-18 03:30:59 -07:00
esengine c4fa9c73f7 fix(schedule): the scheduled child drains the usage catalogs itself, with a test through the host's entry 2026-10-18 03:30:57 -07:00
esengine 3da8e6b23e test(agent): the origin ledger is on the restarted side of a new task 2026-10-18 03:30:51 -07:00
esengine 069e5b54f3 style(agent): use slices.Contains for the origin list 2026-10-18 03:30:51 -07:00
esengine cbeed94933 style(agent): keep execute_one and run_loop at the size ceiling 2026-10-18 03:30:51 -07:00
esengine 1de856a0f6 feat(agent): count a call whose arguments copy text an external result gave the task
The host keeps the text of a task's external results and counts, per turn, how
many were recorded and how many later non-read-only calls carried a verbatim
string from one. The numbers ride the completion-report audit; nothing is
blocked or shown to the model.
2026-10-18 03:30:51 -07:00
esengine d136ac2828 feat(release): build and verify an AppImage of Studio on Linux (download only) 2026-10-18 03:25:38 -07:00
YHH edcbc47c06 Merge pull request #13764 from esengine/feat/13694-mod-ui-3
feat(studio): Claude Code mods in the window: install preview, the band above the prompt, mod questions (settings block hidden)
2026-10-18 03:23:05 -07:00
SivanCola 17f816d11c Merge studio WSL transport and cover remote host boundaries
Problem: Review requested WSL boundary evidence and removal of the unrelated
design-qa.md diff after studio introduced non-SSH machines.

Root cause: The new WSL transport supersedes a blanket rejection at shared
remote endpoints. SSH construction must still reject WSL entries, while
generic probe, browse and open must select their configured transport.
The earlier QA cleanup also deleted a document already owned by studio.

Fix: Integrate studio through 0363720bd and cover the real Hub/remotehost/pool
route with disposable WSL and SSH factories. Assert WSL failures survive the
HTTP boundary and never construct an SSH client. Cover Windows, distribution,
empty and fallback default paths. Restore design-qa.md byte-for-byte from
studio so it no longer appears in the PR diff. Retain the upstream SSH form's
refusal to overwrite non-SSH entries.

Verification: Frontend 5529 tests and production build; full serve,
remotehost, remote, attach, wslconn, config, builtin and boot suites; gofmt,
root vet, make lint and make check. No live Windows/WSL qualification claimed.
2026-10-18 18:21:13 +08:00
SivanCola 643902d35a Merge studio project moves with host-qualified sidebar actions
Problem: PR #13638 became conflicting after studio introduced moving a
conversation to another project.

Root cause: HubPort acquired moveSessionTo beside the archive declaration
that this branch extends with an optional host. Automatic merging also
omitted the errors import needed by the upstream WSL edit guard.

Fix: Keep both capabilities and restore the required import. Retain the
upstream local-only move workflow and the host-qualified pin/archive routes.
Remove an inaccurate rename comment so the combined component stays within
its existing size ceiling without widening the baseline.

Verification: Frontend suite (5529 tests), production build, full serve,
sessionstore, config, builtin and boot tests; gofmt, root vet, make lint and
make check. Transport coverage exercises local project moves beside remote
flags; an interaction regression covers the shared keyboard menu and dialog.
An isolated development browser confirms menu access, project selection and
cancel with hover controls off. Hosted CI remains a separate observation.
2026-10-18 18:13:32 +08:00
esengine 8aa66a6521 Merge remote-tracking branch 'origin/studio' into a5/wsl-ui 2026-10-18 03:11:48 -07:00
esengine 447cc6ae39 ci: run checks against studio 2026-10-18 03:11:43 -07:00
esengine b67222e1a3 Merge remote-tracking branch 'origin/studio' into a5/wsl-cli 2026-10-18 03:11:43 -07:00
esengine 75d8b75051 refactor(schedule): the scheduled child runs from a small package the Studio host can import without the command line 2026-10-18 03:09:47 -07:00
YHH 0363720bd2 Merge pull request #13767 from esengine/a5/wsl-link
feat(remote): bring up a kernel in a WSL distribution and reach it over loopback
2026-10-18 03:08:05 -07:00
YHH 6693788cc4 Merge pull request #13771 from esengine/a9/dsh-integration-doc
feat(integrations): run Reasonix as a DeepSeek Harness subagent, with docs, a plugin package and a market index
2026-10-18 03:05:54 -07:00
YHH bc9d7a16ad Merge pull request #13773 from esengine/feat/13694-mod-receipt
feat(receipt): say when a Claude Code mod's effects were not observed
2026-10-18 03:03:11 -07:00
YHH 5375b9c8f8 Merge pull request #13772 from esengine/feat/12025-thread-badge
feat(feedback): show the reporter's level badge beside their replies in a thread
2026-10-18 03:01:01 -07:00
esengine 60938d36d9 feat(cli): add, test and connect a WSL machine from the command line 2026-10-18 03:00:14 -07:00
esengine d3139f5a4f fix(studio): the mod preview promises no re-confirmation the kernel does not enforce 2026-10-18 03:00:13 -07:00
esengine cebdb37431 fix(studio): the mock mods settings say the switch is not available yet 2026-10-18 03:00:12 -07:00
esengine 8951095309 test(desktop): settings search leaves out the hidden mod entry 2026-10-18 03:00:12 -07:00
esengine 01e775312e feat(studio): keep the mod host's settings out of sight until the kernel allows it 2026-10-18 03:00:12 -07:00
esengine 2cf8510775 test(desktop): the mod UI guard, release note and the strip's focus-ring room 2026-10-18 03:00:12 -07:00
esengine e2e642a488 feat(studio): the band above the prompt, mod questions with their source, and a button with no action id does nothing 2026-10-18 03:00:12 -07:00
esengine 61d2cfd5a8 feat(studio): the mod block in the install preview: full trust, static listing, hidden imports and not-previewed 2026-10-18 03:00:11 -07:00
esengine 721b61eb40 feat(studio): the Claude Code mod block in settings: switch, hook time limit and each mod's state by code 2026-10-18 03:00:11 -07:00
esengine 70d164489f feat(tui): add and remove MCP servers from the /mcp panel 2026-10-18 02:59:58 -07:00
YHH 598de997fa Merge pull request #13770 from esengine/feat/12073-union-list
feat(feedback): show linked devices' reports in My feedback and link from the terminal
2026-10-18 02:53:06 -07:00
YHH dcd4632f8f Merge pull request #13739 from esengine/feat/13693-subagent-steer
feat(delegation): guide a running sub-agent through task_id or from the window
2026-10-18 02:48:06 -07:00
esengine 84e70760b7 feat(feedback): show the reporter's level badge beside their replies in a thread 2026-10-18 02:31:55 -07:00
YHH 4014c87a38 Merge pull request #13768 from esengine/feat/11995-sync-close
feat(feedback): close the mirror issue of a withdrawn report
2026-10-18 02:31:46 -07:00
esengine f3bcb117f7 Merge remote-tracking branch 'origin/studio' into a5/wsl-ui 2026-10-18 02:31:25 -07:00
esengine 4f80c12e2b Merge branch 'a5/wsl-link' into a5/wsl-ui 2026-10-18 02:31:25 -07:00
esengine 8b58ce9eed feat(desktop): add a WSL distribution as a remote machine from Settings 2026-10-18 02:31:25 -07:00
esengine f02ef7d620 feat(integrations): DeepSeek Harness plugin market index for the Reasonix bundle
The index pins the commit that last changed the package; scripts/dsh-market-index.mjs
pins it and validates it with DSH's own validator. docs/DSH.md explains Discover
and the Studio release runbook gains a precondition that keeps the pin current.
2026-10-18 02:30:46 -07:00
esengine 79430cf8cf feat(integrations): website, author and doc links on the DeepSeek Harness bundle 2026-10-18 02:30:29 -07:00
esengine e22b515af1 feat(integrations): DeepSeek Harness plugin market index for the Reasonix bundle
A format-1 index pinned to the commit that last changed the package, and
scripts/dsh-market-index.mjs to pin and validate it with DSH's own validator.
2026-10-18 02:30:29 -07:00
esengine 8ba8c1cf72 feat(integrations): a ready-made DeepSeek Harness bundle that runs Reasonix as a subagent
A configuration-only package (no code) in integrations/dsh-plugin, installed
from this repository's subdirectory with pnpm's path: selector, plus the
integration guide docs/DSH.md.
2026-10-18 02:30:29 -07:00
esengine 34eb44fcd0 docs: using Reasonix from DeepSeek Harness as an ACP subagent
How to wire dsh's subagent-acp provider to reasonix acp, what each permission
policy does to Reasonix, what the parent sees, and the limits, verified against
dsh 0.2.1-rc.2.
2026-10-18 02:30:29 -07:00
esengine 957bdaa323 chore(i18n): keep the message tables at their size ceiling 2026-10-18 02:27:40 -07:00
esengine 2f28235ab6 feat(receipt): say that a Claude Code mod's effects were not observed, and count a live mod as an unseen writer 2026-10-18 02:27:40 -07:00
YHH 7c56994e82 Merge pull request #13705 from esengine/a9/acp-auth-required
fix(acp): a session that cannot open for want of credentials is the authentication-required error
2026-10-18 02:26:40 -07:00
esengine 84d16a1508 Merge remote-tracking branch 'origin/studio' into a5/wsl-link 2026-10-18 02:24:49 -07:00
esengine 36044d1515 style(remote): match exit errors with errors.As in the Linux-only tests 2026-10-18 02:24:47 -07:00
YHH 1a11a6691d Merge pull request #13766 from esengine/a9/rules-dir
feat(rules): rules directories, delivered on the turn and scoped by paths
2026-10-18 02:20:33 -07:00
esengine 119f392248 feat(delegation): guide a running sub-agent through task_id or from the window 2026-10-18 02:17:23 -07:00
YHH d4d7ef809e Merge pull request #13752 from esengine/a5/schedule-ticker
feat(schedule): the Studio host runs the ticker while supervised and visible
2026-10-18 02:16:16 -07:00
esengine 74b4c5d21b feat(feedback): show linked devices' reports in My feedback and link from the terminal 2026-10-18 02:15:42 -07:00
YHH d70edac126 Merge pull request #13737 from esengine/feat/session-move-import
feat(studio): move a conversation to another project, carrying the conversation and not what the old project allowed
2026-10-18 02:11:57 -07:00
esengine f9c6f37b78 fix(remote): stage WSL launches in a private home directory and bound the wait by the session 2026-10-18 02:04:21 -07:00
esengine ae0f9f8fee feat(feedback): close the mirror issue of a withdrawn report 2026-10-18 02:03:13 -07:00
esengine 057d8094ba fix(acp): a session that cannot open for want of credentials is the authentication-required error
session/new answered -32603 for a model with no API key or no configured
provider, although initialize advertises a setup auth method. The cause is now
a provider.ErrKeyMissing / ErrNoProvider identity and the frontend maps it to
the ACP schema's -32000.
2026-10-18 02:01:16 -07:00
esengine ab3f88ac9b Merge remote-tracking branch 'origin/studio' into a5/wsl-link 2026-10-18 02:00:31 -07:00
esengine 137a5831e9 feat(rules): rules directories, delivered on the turn and scoped by paths
Rule files under .reasonix/rules, .claude/rules and the user's rules folder are
read from disk each turn. Rules without paths: join the turn as a block owed
like the standing instructions; rules with paths: are owed once the session has
touched a matching file and retracted when they stop applying. Glob parsing and
matching stay with skills' paths: through one exported entry point. Neither layer
reaches the cache-stable prefix; capability diagnostics report what was skipped.
2026-10-18 01:57:13 -07:00
YHH 4d3c09211b Merge pull request #13725 from esengine/feat/13714-skill-remove
feat(skills): remove a skill from Settings, and never take its whole folder root with it
2026-10-18 01:56:43 -07:00
esengine 2bf3bd7b7e ci: run checks against studio 2026-10-18 01:56:02 -07:00
esengine 9e74ed1806 Merge remote-tracking branch 'origin/studio' into a5/schedule-ticker 2026-10-18 01:56:00 -07:00
esengine c013a4f20b fix(serve): the move target is matched against declared project roots and never reaches the file system 2026-10-18 01:55:42 -07:00
YHH 113523c5f8 Merge pull request #13686 from esengine/feat/11721-browser-full
feat(studio): the browser and workbench can be viewed full screen with the conversation folded away
2026-10-18 01:50:05 -07:00
YHH 0f13cf54c5 Merge pull request #13765 from esengine/a5/wsl-kind
feat(remote): a host entry has a kind, and a WSL distribution is one
2026-10-18 01:46:19 -07:00
YHH 5c99c45ded Merge pull request #13750 from esengine/feat/13693-subagent-rate
feat(delegation): report an estimated token rate while a sub-agent streams
2026-10-18 01:46:13 -07:00
YHH 92ca1b2180 Merge pull request #13753 from esengine/feat/11995-withdraw-client
feat(feedback): withdraw your own report from My feedback or /feedback withdraw
2026-10-18 01:42:08 -07:00
esengine dd9cf72abf style(remote): range over a count in the live test 2026-10-18 01:40:06 -07:00
esengine 6cd443fc94 Merge branch 'a5/wsl-kind' into a5/wsl-link 2026-10-18 01:38:43 -07:00
esengine 34c17c5abf style(config): range over the name's length 2026-10-18 01:38:40 -07:00
YHH ae0af1d5ed Merge pull request #13760 from esengine/a9/default-mode
feat(agent): start new conversations in plan mode when the user chose it
2026-10-18 01:35:23 -07:00
esengine ce73697390 Merge branch 'a5/wsl-kind' into a5/wsl-link 2026-10-18 01:33:54 -07:00
esengine 3ed0deb61d Merge remote-tracking branch 'origin/studio' into a5/wsl-kind 2026-10-18 01:33:39 -07:00
esengine f91eba7de2 fix(config): a WSL distribution name is checked against the characters WSL allows 2026-10-18 01:33:35 -07:00
esengine 89fbc59761 feat(remote): translate Windows workspaces for a WSL machine and refuse a distribution without ps 2026-10-18 01:31:49 -07:00
YHH c9c258067d Merge pull request #13761 from esengine/a5/bootstrap-fs
refactor(remote): bootstrap depends on the file calls it uses, not on SFTP
2026-10-18 01:31:33 -07:00
esengine d235c1fce8 feat(remote): bring up a kernel in a WSL distribution and reach it over loopback 2026-10-18 01:28:00 -07:00
esengine 03725a6939 test(desktop): the full-screen guard waits out the entrance and keeps the pointer off the rail before it shoots 2026-10-18 01:23:09 -07:00
esengine ff5242bcfc docs(release-notes): shorten the full-screen browser line 2026-10-18 01:23:09 -07:00
esengine 00ecd029d4 feat(studio): the browser and workbench can be viewed full screen with the conversation folded away 2026-10-18 01:23:09 -07:00
YHH 74772ab76a Merge pull request #13744 from esengine/fix/1q3k-moved-root-path
fix(hub): open a session by its pre-move path after the state root moves
2026-10-18 01:21:59 -07:00
esengine a67c05616d feat(feedback): withdraw your own report from My feedback or /feedback withdraw 2026-10-18 01:19:11 -07:00
esengine a280324b78 feat(agent): start new conversations in plan mode when the user chose it
agent.default_mode (user file only, off by default) is applied by the assembly
for builds that open a fresh conversation: Studio panes without a saved
session, the TUI without a resume, and ACP session/new. A resume, a headless
run and sub-agents never take it. Settings gets the switch.
2026-10-18 01:11:28 -07:00
YHH ddc01a3793 Merge pull request #13762 from xxoingr/fix/completion-receipt-cut-at-character
fix(completion): cut a declined check's command at a character boundary
2026-10-18 01:10:52 -07:00
esengine 764fad7299 fix(hub): open a session by its pre-move path after the state root moves 2026-10-18 01:04:35 -07:00
esengine 45f7b33165 Merge branch 'a5/bootstrap-fs' into a5/wsl-link 2026-10-18 01:04:11 -07:00
YHH fc4c0e8e5b Merge pull request #13757 from esengine/feat/7950-btw
feat(tui): /btw asks a read-only side question that is not saved to the session
2026-10-18 01:03:26 -07:00
esengine 4025ef24dc feat(remote): a host entry has a kind, and a WSL distribution is one 2026-10-18 01:01:42 -07:00
YHH ed1c127d65 Merge pull request #13747 from esengine/a5/schedule-tick
feat(schedule): a tick that runs what is due, and the schedule commands
2026-10-18 00:55:49 -07:00
xxoingr a94ba07bab fix(completion): cut a declined check's command at a character boundary
The unverified-change gap names the command the host declined, bounded
at 80 bytes by command[:80]. A check with non-ASCII paths, common in a
Chinese project, could be cut inside a character, and the delivery card
then showed a replacement glyph before the cut mark. Step back to the
start of the character instead, keeping the budget and the mark.
2026-10-18 15:54:15 +08:00
YHH cdb7d2318a Merge pull request #13724 from esengine/feat/13694-mod-host
feat(modhost): run Claude Code mods as tighten-only extension runtimes
2026-10-18 00:54:01 -07:00
esengine b39058d42b feat(tui): /btw asks a read-only side question that is not saved to the session 2026-10-18 00:50:18 -07:00
esengine d91e7f8d17 refactor(remote): bootstrap depends on the file calls it uses, not on SFTP 2026-10-18 00:48:06 -07:00
YHH d31d8daf07 Merge pull request #13743 from esengine/fix/dispatch-proof-replay
fix(peers): a dispatch proof is valid once per sequence number, and the adopt/spool boundaries are pinned
2026-10-18 00:46:31 -07:00
YHH 8b1895f05d Merge pull request #13746 from esengine/a5/acp-names-cancel
feat(acp): cancel one request, message ids, elicitation
2026-10-18 00:41:44 -07:00
esengine c52d0c325c Merge remote-tracking branch 'origin/a5/schedule-tick' into a5/schedule-ticker
# Conflicts:
#	docs/GUIDE.md
2026-10-18 00:41:40 -07:00
esengine 24c3fe0f87 feat(schedule): refuse agent-started commands, confirm by typing the plan id, record who created it
Subprocesses the host starts for the agent carry REASONIX_AGENT_CHILD=1, and the
person-only schedule commands refuse when it is set, so a pty opened by a tool
no longer passes the terminal check. add prints the whole plan and requires its
short id typed back; list shows how each schedule was confirmed. The Windows
preview test compares against the resolved workspace path.
2026-10-18 00:39:59 -07:00
esengine adee10bd33 fix(modhost): read the package through a root, and run the mod effect tests with the sandbox off 2026-10-18 00:35:49 -07:00
esengine 971346ff56 docs(release): the user-visible change in the mod host core is the MCP ruling, not a switch that is still withheld 2026-10-18 00:35:49 -07:00
esengine 58a6432e55 test(modhost): wait for the script's stderr line instead of reading it the instant the reply lands 2026-10-18 00:35:49 -07:00
esengine 035453edfb refactor(agent): one gate method for the trusted MCP path 2026-10-18 00:35:49 -07:00
esengine 92c7f9d107 fix(desktop): English wording for the withheld mods switch 2026-10-18 00:35:49 -07:00
esengine 338264c6b7 fix(modhost): an extension's ruling also reaches installed MCP tools, and the mods switch stays withheld until the gaps merge 2026-10-18 00:35:49 -07:00
esengine 905eb76143 refactor(modhost): satisfy the linters 2026-10-18 00:35:48 -07:00
esengine fea2a123f6 refactor(modhost): keep the touched files inside their size and comment budgets 2026-10-18 00:35:48 -07:00
esengine 7dad28cf6b fix(desktop): the mods routes and refusal wording the parity tests ask for 2026-10-18 00:35:48 -07:00
esengine 00d6b85d34 docs(mods): the mod host, its trust and what it serves 2026-10-18 00:35:40 -07:00
esengine 95428e8f17 feat(mods): the mods status and settings port, its routes, and the environment a host states 2026-10-18 00:35:39 -07:00
esengine ec49147dee feat(permission): a tighten-only extension's ask is a fresh human approval of the one call 2026-10-18 00:35:39 -07:00
esengine 2234a3d68b test(modhost): effect tests for the prefix, a refused allow and a mod that dies or hangs 2026-10-18 00:35:39 -07:00
esengine f2a2da4120 feat(modhost): a mod installs, previews and runs through the real boot assembly 2026-10-18 00:35:39 -07:00
esengine 2a035ffdb1 feat(config): the [mods] switch and hook budget, user file only 2026-10-18 00:35:39 -07:00
esengine 152db8582e feat(modhost): synthesise a runtime for an installed mod and supervise it through the sidecar client 2026-10-18 00:35:27 -07:00
esengine 3d624951db feat(ext): dynamic tools and kill-on-timeout for single-threaded runtimes; the mod host serves tools, commands and the band 2026-10-18 00:35:27 -07:00
esengine 047b9e96b0 style(modhost): gofmt the harness 2026-10-18 00:35:27 -07:00
esengine a21d8d8b64 feat(modhost): the host script and its protocol tests under a real node 2026-10-18 00:35:27 -07:00
esengine 3219135e7e feat(modhost): resolve the JavaScript runtime a mod runs on 2026-10-18 00:35:27 -07:00
esengine 674712eadf feat(ext): a static preview of a mod's hooks module from its syntax tree 2026-10-18 00:35:27 -07:00
esengine 0154163c84 feat(ext): tighten-only runtimes and the wire types for Claude Code mods 2026-10-18 00:35:27 -07:00
esengine e906f7b4d5 docs(peers): say what a dispatched session inherits, including YOLO's reach over ask rules 2026-10-18 00:32:28 -07:00
YHH 8d7a55e8ad Merge pull request #13742 from esengine/a5/otlp-export
feat(otlp): opt-in OpenTelemetry trace export, user config only
2026-10-18 00:29:50 -07:00
YHH c73eb851bf Merge pull request #13749 from esengine/docs/sandbox-in-containers
docs(sandbox): what the Linux sandbox does in a container, measured
2026-10-18 00:24:43 -07:00
esengine 92b2e46f69 docs(sandbox): what the Linux sandbox does in a container, measured 2026-10-18 00:08:54 -07:00
esengine 4cddc3390c feat(schedule): the Studio host runs the ticker while it is supervised and visible
The host also answers 'schedule exec' by running the CLI's entry, so the
supervisor can start it as the child. One kernel at a time ticks, under the
machine's ticker lock.
2026-10-18 00:08:22 -07:00
esengine e453fe539e Merge studio into a5/otlp-export 2026-10-18 00:01:14 -07:00
esengine 20d807cb80 Merge remote-tracking branch 'origin/studio' into a5/schedule-tick 2026-10-18 00:00:24 -07:00
esengine c85b77bee2 Split the ceilings in the scheduled runs guide 2026-10-18 00:00:06 -07:00
esengine da001ded22 Shorten the release note fragment 2026-10-17 23:58:24 -07:00
esengine 3d71e57313 Shorten the release note fragment 2026-10-17 23:58:20 -07:00
esengine fb99e0effd feat(schedule): a tick that claims and runs what is due, and the person-facing schedule commands
Scheduler.Tick reaps dead runs, claims at most one due slot inside its grace
and hands it to the supervisor; the schedule add, list, pause, resume, renew,
rm and tick commands drive it. Creating, resuming and deleting need a
terminal.
2026-10-17 23:58:11 -07:00
esengine 6d700b071b Merge remote-tracking branch 'origin/studio' into a5/acp-names-cancel 2026-10-17 23:57:46 -07:00
esengine b09691402d Keep ACP docs and protocol.go within the size standards 2026-10-17 23:57:44 -07:00
esengine b3ec1e2e87 feat(delegation): report an estimated token rate while a sub-agent streams 2026-10-17 23:56:26 -07:00
YHH 896552483e Merge pull request #13588 from SivanCola/feature/new_system_person_20261017
feat(persona): add a system persona to Studio / 新增 Studio 系统人设
2026-10-17 23:54:08 -07:00
esengine e6ba328ad4 Merge remote-tracking branch 'origin/studio' into a5/acp-names-cancel 2026-10-17 23:52:15 -07:00
esengine ba8900aba9 fix(peers): a dispatch proof is valid once per sequence number, and the adopt/spool boundaries are pinned 2026-10-17 23:48:36 -07:00
esengine 57ca36e635 fix(studio): the move dialog says checkpoints, task logs and queued messages stay behind 2026-10-17 23:47:27 -07:00
esengine 5fdd45af4b feat(acp): cancel one request, message ids, tool names on permission requests, elicitation
$/cancel_request cancels only the named request and answers -32800;
agent message chunks carry an opaque messageId; an MCP server's form or
page goes through elicitation/create when the client advertised the mode.
2026-10-17 23:43:20 -07:00
SivanCola cc629b6424 merge: isolate persona imports from evolving settings types
Problem: Studio's new SearXNG connection probe conflicts with the persona
types in three transport import lines, blocking this PR again.

Root cause: independent settings features append types to the same line.

Fix: normally merge Studio 6f68a14a9, preserving the search probe and persona
contracts. Keep persona-only imports separate so subsequent upstream type
additions do not repeatedly conflict. Remove one upstream trailing space.
Retain the upstream MCP scope upgrades, ACP session directories, Gemini
provider, session ordering and rail-search behavior without modifying their
implementations. Persona prompt, user-only scope and guarded writes remain
unchanged, as do the approved composition UI and default-off behavior.

Verification: three-way simulations of future settings imports merge cleanly
in all three files. Format, vet, lint, make check, required builtin/boot tests,
full root Go tests with atomic coverage, full CI race package group and Desktop
Go pass. Frontend typecheck/build and 662 files / 5425 tests pass. Chromium
checks cover persona navigation in both locales, light/dark, wide/390px;
rail search, session ordering, web access, settings rows and font scaling.
Local review and security review check the integration and fresh MCP consent;
they do not replace maintainer approval. No gate or budget was relaxed.
2026-10-18 14:37:59 +08:00
esengine 157ca8533c Merge studio into a5/otlp-export 2026-10-17 23:32:08 -07:00
SivanCola c190fe4bf4 Merge studio into unified project sidebar
Problem: the sidebar PR conflicts with studio's new per-session move actions.

Root cause: both branches extend the row key handler and the mock tree's
session projection. Sorting shortcuts also bubbled into tree navigation,
moving focus to a different session after a reorder.

Fix: retain keyboard context menus and session moves together, compose mock
placement with pin/archive decoration, and consume sorting keys at their
owning row. Keep the existing remote host and body-size guards unchanged.

Verification: 5478 frontend tests across 669 files; production frontend
build; full serve, sessionstore, builtin and boot suites; gofmt, root vet,
make lint and make check. A failing-first keyboard regression and isolated
browser checks prove reordered rows retain focus and keyboard menus still
expose pin, archive and move actions.
2026-10-18 14:32:00 +08:00
YHH 6943f966da Merge pull request #13718 from esengine/a5/video-url
feat(video): hand a public video address the user wrote to the model vendor (off by default)
2026-10-17 23:30:55 -07:00
esengine de67ca98e8 Merge remote-tracking branch 'origin/studio' into a5/otlp-export 2026-10-17 23:15:49 -07:00
esengine 436fa1754a Fix lint findings in the otlp package 2026-10-17 23:15:12 -07:00
esengine cf745b383c feat(studio): move a conversation to another project, carrying the conversation and not what the old project allowed 2026-10-17 23:13:36 -07:00
esengine 790943ac97 Merge studio into a5/video-url 2026-10-17 23:12:21 -07:00
YHH 6f68a14a9d Merge pull request #13732 from esengine/a5/tui-mcp-signin
feat(tui): sign in to an MCP server, or grant it more access, from /mcp
2026-10-17 23:12:14 -07:00
esengine 032e9b771d test(perf): the web access guard expects the video address as its own third list 2026-10-17 23:11:10 -07:00
esengine 089a348753 Merge studio into a5/otlp-export 2026-10-17 23:09:23 -07:00
YHH d87dc94c26 Merge pull request #13659 from esengine/a5/searxng-probe
feat(search): test a SearXNG address from settings and say why it does not answer
2026-10-17 23:07:45 -07:00
YHH 7c35e9bfab Merge pull request #13733 from esengine/feat/session-manual-order-2
feat(studio): move a conversation up or down in its project's list, kept by the kernel
2026-10-17 23:07:42 -07:00
esengine e667bbcd59 fix(desktop): declare the trace export block in the settings catalogue 2026-10-17 23:05:01 -07:00
esengine 9057c3211e feat(otlp): serve route, Studio settings group, docs 2026-10-17 23:04:15 -07:00
esengine b6dbbde594 feat(otlp): opt-in trace export from the user's config, with settings, boot wiring and effect tests 2026-10-17 22:55:38 -07:00
esengine 065d5200da feat(otlp): an exporter that turns a run into GenAI traces 2026-10-17 22:48:43 -07:00
YHH 8e14cdff21 Merge pull request #13731 from esengine/a5/acp-additional-dirs
feat(acp): session-scoped additionalDirectories as write roots
2026-10-17 22:45:40 -07:00
esengine 74e594faed Keep the i18n catalogs under the size ceiling 2026-10-17 22:43:43 -07:00
esengine 6a93a3d01e fix(sessionstore): the order index is a new format now that a row carries its rank 2026-10-17 22:40:36 -07:00
esengine f821e2be49 feat(studio): move a conversation up or down in its project's list, kept by the kernel 2026-10-17 22:40:36 -07:00
esengine 8ce6be77d8 feat(tui): sign in to an MCP server, or grant it more access, from the /mcp panel 2026-10-17 22:40:12 -07:00
esengine e60cc114e8 Merge remote-tracking branch 'origin/studio' into a5/video-url 2026-10-17 22:32:55 -07:00
YHH bbe38032c3 Merge pull request #13730 from esengine/a5/mcp-stepup
feat(mcp): let the user grant a server the access it asked for
2026-10-17 22:32:27 -07:00
esengine bb43735206 feat(acp): take additionalDirectories as session-scoped write roots
Each folder gets the vetting a user-granted root gets; one refused folder
refuses the request with a typed code. Nothing reaches the user's grants.
2026-10-17 22:31:06 -07:00
esengine 1571fe64dc feat(skills): remove a skill from Settings, and never take its whole folder root with it 2026-10-17 22:22:41 -07:00
YHH fc4626cf94 Merge pull request #13726 from esengine/fix/subagent-view-live-after-completion
fix(delegation): a run recorded complete is not live while its owner has yet to let go
2026-10-17 22:10:16 -07:00
YHH cbff25b46b Merge pull request #13715 from esengine/fix/rail-hit-first-click
fix(studio): the rail search box stays open while it holds a query, so the first press on a result is a click
2026-10-17 22:08:33 -07:00
esengine 33b05e79d8 Keep the OAuth authorization flow under the size limits 2026-10-17 22:05:28 -07:00
esengine cacc7c6789 Let the user grant an MCP server the access it asked for
A 403 insufficient_scope from a signed-in server now stops the model and
tells the user; granting more is a fresh approval asked every time, from
the server row or reasonix mcp auth --upgrade.
2026-10-17 22:05:28 -07:00
esengine 3f61753054 feat(mcp): type a 403 insufficient_scope answer, extend access by scope, tell the model by code and the user once 2026-10-17 22:05:28 -07:00
YHH 92d8795b31 Merge pull request #13721 from esengine/a9/acp-vendor-optin
fix(acp): vendor notifications reach only clients that declare them; transcriptPath rides _meta
2026-10-17 21:57:07 -07:00
SivanCola 576e89b111 merge: preserve persona alongside session references
Problem: the latest Studio session-reference settings overlap the persona
port imports and development proxy, leaving this PR in conflict.

Root cause: both features add settings types at the same transport boundary.

Fix: normally merge Studio 8c311b02b, retaining both Persona and SessionRef
contracts, Mock state, SSE methods, routes and settings panels. The upstream
dispatch-consent, bounded-fold and subagent-view implementations stay intact.
Persona prompt assembly, user-only scope, guarded settings and save timing
remain unchanged. The preceding test-only commit synchronizes cancellation
observation without changing the mock provider or relaxing error/close checks.

Verification: formatting, vet, lint, make check, required builtin/boot tests,
full root Go tests with atomic coverage, the full CI race package group and
Desktop Go tests. Frontend typecheck/build and 660 files / 5411 tests pass.
Chromium checks cover persona/settings navigation in Chinese and English,
light/dark and wide/390px layouts; upstream session-reference interactions,
settings rows, font scaling and explorer counts are covered as well.
2026-10-18 12:53:02 +08:00
YHH f249ab3e0e Merge pull request #13712 from esengine/a5/gemini-kind
feat(gemini): a native Gemini provider on the Interactions API, with video (experimental)
2026-10-17 21:50:26 -07:00
esengine 4618349369 Merge origin/studio into fix/rail-hit-first-click 2026-10-17 21:48:03 -07:00
esengine 27dbf237af Merge studio into a5/searxng-probe 2026-10-17 21:47:46 -07:00
esengine 83fde1922f fix(delegation): a run recorded complete is not live while its owner has yet to let go 2026-10-17 21:47:36 -07:00
SivanCola 8bebe521d6 test(agent): synchronize mock stream cancellation observation
Problem: the hosted race group failed the mock provider cancellation test
when the next received chunk was an already-pending tool call.

Root cause: cancellation does not prioritize the Done case over a send that
is also ready in select. The test canceled the context and immediately read
again without establishing that the producer had observed cancellation.

Fix: acknowledge cancellation through the test context's Err method before
draining the stream. Retain the strict cancellation-error and subsequent
channel-close assertions, plus the unchanged pre-canceled request test.
The hang guard uses the existing test budget. No mock/product behavior,
runtime prompt, UI, thresholds or workflow approvals change.

Verification: reproduced one failure in 10000 race-instrumented iterations
with GOMAXPROCS=2 before the change; 10000 final iterations pass afterward.
A temporary explicit-marker mutation that ignores cancellation is rejected.
The complete CI race package group passes, alongside gofmt, vet, lint,
make check and builtin/boot tests. Prior frontend/coverage evidence applies
to the unchanged product tree.
2026-10-18 12:39:10 +08:00
esengine eacf0618e8 fix(acp): vendor notifications reach only clients that declare them; transcriptPath rides _meta
The prompt result carried a top-level transcriptPath the ACP schema does not
allow, and status_update / mcpStatus_update went to every client, which
standard SDK clients answer with a method-not-found error each. The two
notifications now need clientCapabilities._meta["reasonix.io"].statusUpdates
and the path moves under _meta["reasonix.io"].
2026-10-17 21:28:25 -07:00
YHH 8c311b02bd Merge pull request #13708 from esengine/feat/13687-session-reference
feat(studio): reference a past conversation of this workspace from the message box
2026-10-17 21:27:41 -07:00
esengine 7b775ed15e test(video): an address another session delivered is not the user's, and a reopened conversation keeps who wrote what 2026-10-17 21:23:55 -07:00
YHH 64c5ff3273 Merge pull request #13717 from esengine/feat/13693-subagent-view
feat(delegation): read a sub-agent run's conversation while it runs
2026-10-17 21:19:13 -07:00
esengine 291d02c884 Merge remote-tracking branch 'origin/studio' into a5/searxng-probe 2026-10-17 21:14:41 -07:00
SivanCola f40ab35660 merge: reconcile persona with the settings interface
Problem: newer Studio settings UI and persona translations both appended to
the shared English catalog, leaving the PR conflicting. Its new setting-open
notices also lacked a destination for the guarded persona fields.

Root cause: translations for an independent settings domain shared an append
point, and the newly introduced frontend routing table did not know persona.

Fix: normally merge Studio 15de9ec33, preserve both sides' translations and
extract persona's unchanged entries into its own catalog module. Route the
three guarded persona setting ids to their editor and cover actual notice
clicks. Preserve the persona's user scope, supplemental prompt semantics,
save timing, settings navigation and existing authorization boundaries.

Verification: format, vet, lint, make check, complete root Go tests with
atomic coverage, Desktop Go, frontend typecheck/build and 657 files / 5400
tests. Verified all 25 extracted translations unchanged. Chromium navigation
passed in Chinese/English, light/dark and wide/390px layouts; settings rows
and font scaling pass. The later dispatch config/catalog combination also
passes an explicit-marker build overlay. No thresholds or approvals changed.
2026-10-18 12:06:50 +08:00
esengine b96ad582a6 feat(video): the Settings switch for handing a video address to the vendor, with docs 2026-10-17 21:04:31 -07:00
YHH 42c505b50e Merge pull request #13711 from esengine/feat/13320-bound-fold
fix(agent): give [[keep]] turns a budget of their own and stop the fold ceiling where the send-time output check stops
2026-10-17 21:03:07 -07:00
YHH 5c38676052 Merge pull request #13709 from esengine/feat/dispatch-open-switch
feat(peers): the dispatch switch is the consent between a session and the sessions it opens
2026-10-17 21:01:08 -07:00
esengine 58e2da8db2 feat(video): read_video takes an address the user wrote, when the user turned that on 2026-10-17 20:58:33 -07:00
esengine 4b483d3897 fix(control): cut a referenced conversation at a character boundary and quote its attributes with %q 2026-10-17 20:57:29 -07:00
esengine 085f20c576 feat(video): an address the vendor visits, on the Zhipu and Gemini wires 2026-10-17 20:54:12 -07:00
esengine 3e10e6faf6 Merge branch 'a5/gemini-kind' into a5/video-url 2026-10-17 20:52:28 -07:00
esengine 8f1fe5965d fix(gemini): follow only an upload address on the configured host and only Files-shaped names; say experimental in the config 2026-10-17 20:52:08 -07:00
esengine f1fa8538d5 wip(video-url): the user-only switch in the config 2026-10-17 20:49:18 -07:00
esengine 4d2c7cd4d0 fix(studio): the rail search box stays open while it holds a query, so the first press on a result is a click 2026-10-17 20:48:09 -07:00
esengine 863ed17e70 feat(delegation): read a sub-agent run's conversation while it runs 2026-10-17 20:47:52 -07:00
esengine a2aef0b953 fix(agent): give [[keep]] turns a budget of their own and stop the fold ceiling where the send-time output check stops 2026-10-17 20:42:45 -07:00
YHH 15de9ec334 Merge pull request #13706 from esengine/a9/acp-readiness-pause
fix(acp): a host-paused turn ends with end_turn, a paused outcome and a receipt
2026-10-17 20:41:07 -07:00
YHH ec207aabf7 Merge pull request #13707 from esengine/feat/13697-user-message-time
feat(chat): show when your own message was sent in its action row
2026-10-17 20:40:46 -07:00
YHH bec46d99ab Merge pull request #13704 from esengine/fix/13699-user-action-icons
fix(chat): the action icons under your own message match the reply's size
2026-10-17 20:40:35 -07:00
esengine 992e0155a5 Merge remote-tracking branch 'origin/studio' into a5/gemini-kind 2026-10-17 20:36:53 -07:00
esengine 3b5ef3dff1 style(gemini): satisfy the linters in the tests 2026-10-17 20:36:43 -07:00
YHH 33bb46e95a Merge pull request #13698 from esengine/a5/settings-ui
feat(settings): draw the setting card and point at a setting only the user may change
2026-10-17 20:30:15 -07:00
esengine 14206bc978 test(settings): the dispatch ceilings share the words of the dispatch switch 2026-10-17 20:29:24 -07:00
esengine da0c5c6a9f test(peers): range over SplitSeq with one variable 2026-10-17 20:29:24 -07:00
esengine 038732325c fix(settings): declare the two dispatch ceilings 2026-10-17 20:29:24 -07:00
esengine ffe30b62bf test(peers): range over SplitSeq 2026-10-17 20:29:24 -07:00
esengine eb48decd12 fix(desktop): the peers settings fixtures carry the dispatch ceilings 2026-10-17 20:29:24 -07:00
esengine e7d19e3d65 chore(peers): fit the repolint budgets 2026-10-17 20:29:24 -07:00
esengine 2002ef72ea feat(peers): ceilings, error identities and the dispatch tool's own words follow the switch being the consent 2026-10-17 20:29:24 -07:00
esengine ddba148a36 feat(peers): the dispatch switch is the consent between a session and the ones it opens 2026-10-17 20:29:24 -07:00
esengine 8720820542 Merge studio into a5/gemini-kind 2026-10-17 20:28:35 -07:00
esengine ec8a91e1e1 feat(studio): reference a past conversation of this workspace from the message box 2026-10-17 20:22:18 -07:00
esengine 25d9f7f028 style(gemini): split the stream loop and trim comments to the repo's limits 2026-10-17 20:19:25 -07:00
esengine aa80cdce2e feat(gemini): effect test, docs, release note and the desktop kind label 2026-10-17 20:18:28 -07:00
esengine 5b4f35502f fix(acp): a host-paused turn ends with end_turn, a paused outcome and a receipt
The final-readiness pause answered session/prompt with the non-standard
stopReason "error", so a client that reads only message text took unverified
work for finished. The turn now ends with end_turn, the typed outcome in _meta
and a host-written [paused] line at the end of the streamed text.
2026-10-17 20:16:53 -07:00
SivanCola fbdb85dc4e merge: retain guarded persona behavior with the settings tool
Problem: newer Studio introduces the model-facing setting tool across the
same catalog, boot assembly and controller used by the persona feature.

Root cause: validating only the earlier base would leave their combined
authorization and request contracts untested.

Fix: normally merge Studio 4840df982 and retain the existing guarded persona
entries, user-only loading and supplemental prompt assembly. Add a real
boot.Build effect test for all three persona fields: even in YOLO a model
proposal receives a guarded refusal, produces no approval card, preserves
the user file and discloses no value through refusal or settings listing.

Verification: gofmt, vet, lint, make check, full root Go tests with atomic
coverage, Desktop Go and SDK suites, frontend typecheck/build and 654 files
/ 5384 tests; Chromium settings navigation, row layout and font-scaling
checks in light/dark and wide/narrow layouts. Earlier Electron checks apply
unchanged. No baselines, thresholds, workflow approvals or draft state change.
2026-10-18 11:16:47 +08:00
esengine 006616829a feat(chat): show when your own message was sent in its action row 2026-10-17 20:16:31 -07:00
esengine b9510a1cc2 Merge remote-tracking branch 'origin/studio' into a5/settings-ui 2026-10-17 20:13:06 -07:00
YHH 0d9bae435a Merge pull request #13703 from esengine/a9/dsh-acp
fix(acp): a failed session/prompt turn is a JSON-RPC error with a typed code
2026-10-17 20:12:47 -07:00
esengine fbf2495a4c feat(gemini): the native preset, with only models whose pages were read 2026-10-17 20:08:07 -07:00
SivanCola 724d94af8c merge: reconcile persona with current Studio contracts
Problem: the approved persona head failed hosted Go tests and coverage, and
the combined Settings/config files exceeded their line budgets.

Root cause: CI tested synthetic merge 6309314327 against newer Studio
5e53be32a. Its attachment ceiling key had no settings declaration, while
independent additions accumulated in the shared settings/config files.

Fix: normally merge Studio 667f2ca16, including the upstream guarded
attachment-key declaration and ProviderEntry method extraction. Keep all
three guarded persona keys and their user-scope/prompt behavior. Extract
the unchanged settings navigation into SettingsNav, retaining keyboard
navigation, status values and the new version dot. Assert that the
attachment storage ceiling stays guarded.

Verification: gofmt, vet, lint, make check, complete root Go tests with
atomic coverage, independent Desktop Go tests, Electron tests, frontend
typecheck/build and 654 files / 5381 tests. Chromium fs-scale and settings
row guards pass, with light/dark 1280px/390px navigation checks. No budgets,
test thresholds, workflow approvals or draft state are changed.
2026-10-18 11:07:54 +08:00
esengine e24b481e40 fix(chat): the action icons under your own message match the reply's size 2026-10-17 20:05:22 -07:00
YHH 4840df9825 Merge pull request #13690 from esengine/a5/settings-tool
feat(settings): the model can propose a setting change and the user confirms it
2026-10-17 20:03:48 -07:00
esengine 8c4e0ef1e8 feat(gemini): video through inline data or the Files API, with WebM and MOV sniffed natively 2026-10-17 20:02:52 -07:00
YHH fadd893983 Merge pull request #13701 from esengine/fix/search-button-toggle
fix(find): the title bar search button closes an open find bar
2026-10-17 20:02:14 -07:00
esengine 12fb14abb6 feat(pricing): Google's Gemini rates, with a dated generation for the announced step 2026-10-17 19:57:22 -07:00
esengine 001d33f232 fix(acp): a failed session/prompt turn is a JSON-RPC error with a typed code
stopReason "error" is not in the ACP prompt-turn enumeration, and the cause
travelled only on a vendor notification, so a text-only client saw an
unexplained failure. The turn now ends with -32603, the redacted cause as the
message and data.code turn_failed.
2026-10-17 19:57:07 -07:00
YHH 667f2ca166 Merge pull request #13688 from SivanCola/fix/skill-spec-info-key
fix(studio): key each skill metadata row / 技能元数据行补上 key
2026-10-17 19:56:36 -07:00
esengine 33219e58c5 feat(gemini): a native provider kind on the Interactions API 2026-10-17 19:53:46 -07:00
esengine f6c18ac5a3 Merge branch 'a5/settings-tool' into a5/settings-ui 2026-10-17 19:50:31 -07:00
esengine fc80457d14 fix(settings): the card shows the whole value or the value is refused, no proposals in plan mode, no values for boundary rows 2026-10-17 19:50:12 -07:00
esengine 5d99b3a628 fix(find): the title bar search button closes an open find bar 2026-10-17 19:44:03 -07:00
esengine 96d21061db Merge remote-tracking branch 'origin/studio' into a5/settings-tool 2026-10-17 19:43:10 -07:00
SivanCola 7392199b3c Merge remote-tracking branch 'origin/studio' into fix/skill-spec-info-key 2026-10-18 10:41:01 +08:00
YHH 1d1a8c7ad8 Merge pull request #13691 from esengine/fix/config-size-budget
refactor(config): move ProviderEntry's model and key methods out of config.go
2026-10-17 19:40:28 -07:00
SivanCola fb84c5af25 fix(studio): refuse unknown SSH hosts and keep hover actions opt-in
Problem: remote sidebar mutations could dial an unconfigured SSH target,
accept unbounded JSON, and enable hover actions without a user choice.

Root cause: a missing host resolved to an empty workspace without an error;
remote JSON handlers lacked a shared size boundary, and the preference
treated every value except explicit off as enabled.

Fix: classify unknown hosts before link reuse or acquisition, share a
64 KiB single-body decoder across remote writes, and restore explicit-on
hover preferences with a safe storage-error default. Preserve configured
hosts, far-kernel refusals, menu access and declared workspace resolution.
Align synchronization fixtures and keep translated directory prose in the
interface font.

Verification: failing-first unknown-host and oversized-body regressions;
full serve, builtin and boot tests; 5389 frontend tests; production build;
gofmt, root go vet, make lint and make check; isolated browser interaction
checks for default-off, opt-in persistence, menu access and opt-out.
2026-10-18 10:32:18 +08:00
esengine c24492d2c0 feat(settings): draw the setting card, point at a setting only the user may change, and offer the choice over ACP 2026-10-17 19:29:39 -07:00
esengine c1c7d99ecb Merge remote-tracking branch 'origin/fix/declare-attachments-key' into fix/config-size-budget 2026-10-17 19:24:54 -07:00
esengine 02ff3c3352 fix(settings): the receipt notice names the setting and carries no machine payload 2026-10-17 19:23:30 -07:00
SivanCola cc14bcb75e fix: display the server-owned remote workspace default
Problem: The SSH project menu re-derived a default from the project list when
the host response omitted workspace.

Root cause: A client fallback duplicated the kernel's configured-default rule.

Fix: Pass the host response's workspace directly to the menu. Align the fixture
with the server response and cover both an explicit default that differs from
list order and an omitted default that must stay unset.

Verification: The omitted-default regression failed before repair. All 17
remote project/worktree interaction tests and the production build passed.
gofmt, root go vet, make lint, make check and builtin/boot tests passed.
2026-10-18 10:16:54 +08:00
esengine 14c5dcbcee style(search): slices helpers in the dial guard, tidy the probe tests 2026-10-17 19:15:00 -07:00
esengine 623e792df3 fix(search): probe only the saved SearXNG address and never a link-local or metadata one 2026-10-17 19:13:09 -07:00
esengine a6329ea5f4 fix(settings): declare attachments.max_stream_bytes as Guarded
The key landed with the streaming attachment ceiling without a class, so the
settings package panics at registration and every test importing it fails.
2026-10-17 19:11:19 -07:00
esengine a8dc464e9a refactor(config): move ProviderEntry's model and key methods out of config.go
config.go is over its file-size budget on studio after two merged changes,
which fails lint for every new pull request. The model-price/override and
API-key methods belong with ProviderEntry; the one function that reads the
process environment stays in config.go so no process-input debt moves.
2026-10-17 19:09:37 -07:00
SivanCola 321e3bbaf0 fix(studio): scale explorer counts with interface text
Problem: the Studio browser guard on the persona PR measured file and
change counts staying at 10px when interface text was enlarged.

Root cause: both explorer headers share a small element without an explicit
font size, leaving the size response to the browser's smaller-text rules.
The stylesheet is inherited from studio; macOS Chromium did not reproduce
the Linux hosted failure.

Fix: give the shared counter rule an explicit 10px base multiplied by the
existing interface scale. Preserve the default appearance and the persona
and composition behavior. Add a bilingual release note.

Verification: gofmt, vet, lint, make check, builtin/boot tests, frontend
typecheck, production/perf builds and 651 files / 5370 tests; Chromium
fs-scale, text-size and explorer guards. In light and dark, both counts
measure 10px, 11.5px and 13px across the three interface size steps.
2026-10-18 10:05:34 +08:00
esengine 5393e818e2 Merge remote-tracking branch 'origin/studio' into a5/searxng-probe 2026-10-17 19:04:52 -07:00
YHH 5e53be32ab Merge pull request #13685 from esengine/fix/13682-versions-nav-update-dot
fix(settings): mark the Version row when an update is known
2026-10-17 19:00:48 -07:00
esengine aab760b0b2 feat(settings): declare attachments.max_stream_bytes as a guarded size limit 2026-10-17 18:59:07 -07:00
SivanCola a72134c0ef fix(studio): key each skill metadata row
The metadata list mapped entries to an unkeyed fragment, so React warned about the missing key when Settings -> Extensions rendered a skill's spec. Give the fragment the entry key and add a regression test that fails without it.
2026-10-18 09:58:59 +08:00
esengine 530ccbf688 style(config): fold two comments so config.go is back inside its size budget 2026-10-17 18:57:53 -07:00
esengine 9c6c91da9c style(settings): errors.As in tests, slices.Contains, keep config.go within its size budget 2026-10-17 18:57:27 -07:00
esengine c7e6ef9a52 feat(settings): offer the setting tool, name the switch on a disabled dispatch, and document both 2026-10-17 18:57:27 -07:00
esengine f3a5a6bcce feat(settings): the setting tool, the host that confirms a change, and the structured remedy on refusals 2026-10-17 18:57:27 -07:00
YHH 2d6656cd14 Merge pull request #13544 from SivanCola/fix/native-file-streaming-studio
fix(studio): reference native files and stream attachment uploads / 大文件路径引用与流式上传
2026-10-17 18:49:56 -07:00
SivanCola 6fe0fd6867 fix(persona): declare guarded keys in the settings catalog
Problem: the new studio settings catalog rejects config fields without an
explicit classification, including the three persona fields added here.

Root cause: the catalog foundation landed after the persona implementation.

Fix: integrate studio and classify persona prefix, suffix and optional runtime
context as user-owned Guarded settings. Plain file writes do not rebuild a
runtime. Reject model proposals before any persona value can be changed.

Verification: root Go tests including settings, boot and builtin pass; gofmt,
vet, lint and make check pass; frontend typecheck/build and 5,370 tests pass.
2026-10-18 09:46:59 +08:00
YHH ce7c69ca75 Merge pull request #13681 from esengine/fix/browser-minimized-click
fix(desktop): raise a minimized window unseen so the agent's clicks reach the built-in browser
2026-10-17 18:42:53 -07:00
esengine edaccd5f4c fix(settings): mark the Version row when an update is known 2026-10-17 18:37:55 -07:00
YHH 8dbf869fa8 Merge pull request #13680 from esengine/a5/settings-catalog
feat(settings): declare every user-config key with a class, an effect timing and a secret flag
2026-10-17 18:37:34 -07:00
YHH 0ea504ea77 Merge pull request #13679 from esengine/fix/dispatch-switch-off-identity
fix(peers): say that the dispatch switch is off, apart from a host that cannot open panes
2026-10-17 18:30:26 -07:00
YHH e88e02556a Merge pull request #13676 from esengine/fix/11577-editor-text-size
fix(desktop): the code editor's text and find panel follow the interface text size
2026-10-17 18:24:46 -07:00
esengine 2529f757f4 test(desktop): restore the focused-window assertion 2026-10-17 18:22:57 -07:00
SivanCola e7d50cf0e9 fix(persona): preserve first-party guidance and user scope
Problem: project configuration could replace the user persona, and complete
mode could suppress built-in guidance. The UI misstated rebuild semantics.

Root cause: persona was absent from the user-scope hold, replacement was a
supported runtime option, and settings metadata described only new sessions.

Fix: hold and clone the user's persona across project decoding, retire complete
throughout config/runtime/API/UI, and describe next-build activation. Integrate
current studio without dropping its settings or transport contracts.

Verification: gofmt, vet, lint, make check, root and Desktop Go suites, boot
scope/prompt regressions, frontend typecheck/build and 5,369 tests pass.
2026-10-18 09:22:31 +08:00
esengine 466e44779b fix(desktop): a window that fails to raise gets its opacity and mouse back 2026-10-17 18:22:18 -07:00
esengine f9714be60d feat(settings): a writable value is judged by the config's own setter, a bound, or a stated freedom 2026-10-17 18:21:48 -07:00
esengine 8ae413c9ef fix(settings): never read a structured key, and declare protection-relaxing keys Elevated 2026-10-17 18:20:05 -07:00
esengine 6efead8677 fix(settings): read and write an optional key through its pointer 2026-10-17 18:19:40 -07:00
esengine 792c1a0fcd fix(settings): declare only effect timings a plain file write delivers 2026-10-17 18:17:16 -07:00
esengine 8a968bb900 test(desktop): the live browser check submits each turn after the last has ended 2026-10-17 18:16:55 -07:00
esengine 2180caa3d8 test(desktop): the person who restores the window also activates it 2026-10-17 18:16:55 -07:00
esengine 8e105ba1fd fix(desktop): raise a minimized window unseen for the agent's input to the built-in browser 2026-10-17 18:16:55 -07:00
esengine 245928be33 test(desktop): the live browser check uses the controls the panel has now 2026-10-17 18:16:55 -07:00
esengine 0b3c709ed1 style(settings): use reflect.TypeFor and range over int 2026-10-17 18:16:09 -07:00
esengine 32a79410d2 feat(settings): declare every user-config key with a class, an effect timing and a secret flag 2026-10-17 18:15:44 -07:00
esengine aa67e223cc fix(peers): say that the dispatch switch is off, apart from a host that cannot open panes 2026-10-17 18:12:06 -07:00
YHH bafb4c0818 Merge pull request #13674 from esengine/fix/flaky-frontend-tests
fix(desktop): the branch menu survives the chip settling, and its list is re-read when the root moves
2026-10-17 18:03:41 -07:00
YHH b79d5d0836 Merge pull request #13675 from esengine/a5/parity-exemptions
chore(repolint): scope five frontend-parity edges where a frontend reaches the same behaviour another way
2026-10-17 17:40:31 -07:00
esengine 7a1bbc51b9 fix(desktop): the code editor's text and find panel follow the interface text size 2026-10-17 17:37:37 -07:00
esengine 791c00f496 chore(repolint): scope five frontend-parity edges where a frontend reaches the same behaviour another way 2026-10-17 17:29:55 -07:00
YHH 31f230cf49 Merge pull request #13673 from esengine/docs/studio-2.44.0-notes
docs(release): studio 2.44.0 notes
2026-10-17 16:19:24 -07:00
esengine f6a3680d09 docs(release-notes): name the pull request in the fragment 2026-10-17 16:19:00 -07:00
esengine adc02158fb docs(release): studio 2.44.0 notes 2026-10-17 16:11:02 -07:00
esengine 4fd0dab507 fix(desktop): the branch menu survives the chip settling, and its list is re-read when the root moves 2026-10-17 16:09:42 -07:00
YHH 481aa4a0eb Merge pull request #13672 from esengine/fix/shell-probe-test-hedge
test(boot): count launches of the planted bash, not hedged candidates, in the proven-shell effect test
2026-10-17 15:46:19 -07:00
esengine 7bf97efccb test(boot): count launches of the planted bash, not hedged candidates, in the proven-shell effect test 2026-10-17 15:27:48 -07:00
YHH b50bb0c29e Merge pull request #13470 from esengine/fix/13197-slash-catalog-memo
fix(skill): memoize slash-list discovery for two seconds
2026-10-17 15:21:14 -07:00
esengine 1c718f8547 test(skill): a skill added outside the store shows once the slash-list memo has aged out 2026-10-17 15:08:07 -07:00
YHH 1339e794d8 Merge pull request #13530 from esengine/fix/12900-adopted-hint
feat(desktop): say what a shipped report is on the feedback level card
2026-10-17 15:04:52 -07:00
YHH 6a6342446d Merge pull request #13668 from esengine/feat/open-document-default-app
feat(studio): open a local HTML, SVG or PDF file in the system default program
2026-10-17 15:04:23 -07:00
YHH f743552038 Merge pull request #13671 from esengine/feat/13526-provider-retries
feat(agent): agent.max_provider_retries sets how often a failed provider connection is retried, 0 until cancelled
2026-10-17 15:03:52 -07:00
esengine 188f100cc5 fix(serve): check an opened document's path against the roots as strings before touching the disk 2026-10-17 14:37:08 -07:00
YHH e1211b7715 Merge branch 'studio' into fix/12900-adopted-hint 2026-10-17 14:34:21 -07:00
YHH c926b5306b Merge branch 'studio' into fix/13197-slash-catalog-memo 2026-10-17 14:34:17 -07:00
esengine 0fe1bbc31b test(boot): name the status the retry probe returns 2026-10-17 13:17:16 -07:00
esengine 3b0ab63f4a feat(agent): agent.max_provider_retries sets how often a failed provider connection is retried, 0 until cancelled 2026-10-17 13:07:38 -07:00
YHH df91037c1c Merge pull request #13670 from esengine/feat/peers-wire-parity
test(repolint): hold the desktop's PeersSettings mirror to the kernel's
2026-10-17 12:59:33 -07:00
esengine 1bb970d834 test(repolint): hold the desktop's PeersSettings mirror to the kernel's 2026-10-17 12:48:51 -07:00
YHH 1593ac424b Merge pull request #13661 from esengine/a5/acp-mcp-session-control
feat(acp): reconnect and disconnect MCP servers per session, submit extension forms
2026-10-17 12:40:31 -07:00
esengine a4781fa524 Merge origin/studio into a5/acp-mcp-session-control 2026-10-17 12:26:20 -07:00
YHH 1d4c43e98b Merge pull request #13669 from esengine/test/machine-list-explicit-times
test(cli): the machine-list fixture keeps the update times it asks for
2026-10-17 12:23:12 -07:00
esengine 47addbe945 test(opendoc): hold the Windows opener's argument list whole, and make the opener tests path-portable 2026-10-17 12:15:49 -07:00
esengine c0cf65568c test(cli): the machine-list fixture keeps the update times it asks for 2026-10-17 12:10:41 -07:00
YHH 987c13b4cb Merge pull request #13667 from esengine/a5/goal-usage
feat(goal): show a goal's usage and stop cause in the desktop and the terminal
2026-10-17 12:05:31 -07:00
YHH 414bec6f4d Merge pull request #13664 from esengine/fix/pricecheck-deepseek-cny
feat(pricecheck): check DeepSeek's yuan page as well as the dollar one
2026-10-17 12:01:36 -07:00
esengine 42d4313907 feat(studio): open a local HTML, SVG or PDF file in the system default program 2026-10-17 11:56:49 -07:00
esengine 813884f9d2 feat(goal): show a goal's usage and stop cause in the desktop and the terminal 2026-10-17 11:38:18 -07:00
esengine d6b6acb309 feat(pricecheck): check DeepSeek's yuan page as well as the dollar one 2026-10-17 11:35:16 -07:00
YHH b2f9c25ae7 Merge pull request #13656 from esengine/fix/skill-warnings-once
fix(skill): write each distinct discovery diagnostic once per store
2026-10-17 11:31:31 -07:00
YHH 504465f8de Merge pull request #13657 from esengine/fix/narrow-line-limit
refactor(config): side conversations and queued prompts are held with the other agent limits
2026-10-17 11:14:40 -07:00
esengine 2301cb0fd7 feat(acp): scope the persistent MCP capabilities away, with the trust gate documented 2026-10-17 11:14:37 -07:00
esengine c1617dfc69 feat(acp): reconnect and disconnect MCP servers for one session, submit extension forms 2026-10-17 11:14:37 -07:00
YHH 876a4ae39d Merge pull request #13658 from esengine/docs/win-port-note
docs(release): word the Windows port note for users
2026-10-17 11:14:18 -07:00
esengine 299a10f39a docs(release): word the Windows port note for users 2026-10-17 11:03:48 -07:00
esengine 7c9d16c82f refactor(config): side conversations and queued prompts are held with the other agent limits 2026-10-17 10:59:04 -07:00
esengine fc501c8219 fix(skill): write each distinct discovery diagnostic once per store 2026-10-17 10:55:42 -07:00
esengine e858a46f70 feat(search): say why a SearXNG instance does not answer, and test the address from settings 2026-10-17 10:54:09 -07:00
YHH ee92b3f4d7 Merge pull request #13654 from esengine/a5/narrow-size
refactor(config): move the workspace grants out of heldScope.narrow
2026-10-17 10:53:54 -07:00
esengine e6cb790416 fix(skill): memoize slash-list discovery for two seconds 2026-10-17 10:48:44 -07:00
esengine fcb4264282 refactor(config): move the workspace grants out of heldScope.narrow 2026-10-17 10:43:07 -07:00
YHH 34efa76dd3 Merge pull request #13572 from esengine/test/resource-diag
test(boot): a red resource-tool run names what the schema cache held
2026-10-17 10:38:45 -07:00
YHH 43a515dc27 Merge pull request #13599 from esengine/fix/subagent-done-status
fix(studio): a finished sub-agent says it is handed back, not only how long it took
2026-10-17 10:38:34 -07:00
YHH 1caab22b6a Merge pull request #13651 from esengine/fix/subagent-view-image-by-own-model
fix(delegation): a child on an image model gets view_image whatever the parent's model reads
2026-10-17 10:36:02 -07:00
YHH af3e7e973b Merge pull request #13633 from esengine/feat/13526-queued-inputs
feat(inbox): the session queue holds as many prompts as asked unless the user sets agent.max_queued_inputs
2026-10-17 10:32:56 -07:00
YHH b4c126d66e Merge pull request #13648 from esengine/fix/tree-open-pane-identity
fix(serve): a pane belongs to a folder however the folder is spelled, and a pane with no row is logged
2026-10-17 10:28:49 -07:00
YHH 5e6fe553c7 Merge pull request #13649 from esengine/fix/win-port-retry-eacces
fix(cli): a Windows bind refused as forbidden moves the web server to the next port
2026-10-17 10:27:51 -07:00
YHH f0ab419902 Merge pull request #13646 from esengine/a5/acp-session-info
feat(acp): report session info and configured MCP servers
2026-10-17 10:22:41 -07:00
YHH d4f5a36c1b Merge pull request #13647 from esengine/test/pipe-status-product-bash
test(builtin): the pipe-status probe runs under the bash the product resolves
2026-10-17 10:20:41 -07:00
YHH 73dbd8e8c4 Merge pull request #13645 from esengine/fix/13565-versions-memo
fix(update): share one version-catalog read between Settings, the versions panel and the update check
2026-10-17 10:16:43 -07:00
esengine e7b2cbd8f5 fix(delegation): a child on an image model gets view_image whatever the parent's model reads 2026-10-17 10:14:32 -07:00
esengine c6b36276a8 fix(cli): a Windows bind refused as forbidden moves the web server to the next port 2026-10-17 10:08:40 -07:00
esengine 2fa53d3cc4 test(builtin): the pipe-status probe runs under the bash the product resolves, not the first bash on PATH 2026-10-17 10:07:06 -07:00
YHH 6f653cbfaf Merge pull request #13643 from esengine/a5/video-windows-skip
test(model): skip the swap-after-open video tests on Windows
2026-10-17 10:06:42 -07:00
esengine 2f1c6648b1 feat(acp): report session info and configured MCP servers, scope four lifecycle capabilities 2026-10-17 10:04:56 -07:00
YHH 75883d7f04 Merge pull request #13641 from esengine/chore/release-fragments-2.44
docs(release): merge the two session-messages fragments and rewrite the scratch-spill one
2026-10-17 10:04:00 -07:00
esengine 544d17f6dd fix(serve): a pane belongs to a folder however the folder is spelled, and a pane with no row is logged 2026-10-17 10:02:45 -07:00
esengine fafb92b935 test(model): skip the swap-after-open tests on Windows, which cannot replace an open file 2026-10-17 09:54:22 -07:00
YHH 9696d762ed Merge pull request #13602 from esengine/feat/mcp-signin-follow-ui
feat(desktop): sign in to an MCP server that answered 401, and follow a server's tool changes
2026-10-17 09:50:55 -07:00
esengine 9f1d20cd46 fix(update): share one version-catalog read between Settings, the versions panel and the update check 2026-10-17 09:50:12 -07:00
esengine 70e5060ec3 docs(release): merge the two session-messages fragments and rewrite the scratch-spill one 2026-10-17 09:49:20 -07:00
esengine b3b39feefe Merge origin/studio into feat/mcp-signin-follow-ui 2026-10-17 09:35:51 -07:00
YHH 9374e1eda7 Merge pull request #13617 from esengine/a5/video-native
feat: let read_video hand an MP4 to a model that watches video natively
2026-10-17 09:34:52 -07:00
SivanCola eebc6d2a3c fix: make remote workspace binding explicit before link reuse
Problem: Host reads could borrow another pane's workspace or reuse an existing
link after its host was disabled. Review also requested explicit defaults,
boundary regressions and removal of development notes from the tree.

Root cause: remoteLink returned the first host pane before reading current
user configuration, so neither workspace identity nor the disabled policy
governed the reuse path.

Fix: Resolve the user-host default before reuse and accept only a matching
host/workspace pane. Share the declared-default-first rule with host views,
show actual and default connection paths separately, and document the rule
in both GUIDE languages. Remove three root QA notes and seven captures;
preserve their useful context in the PR discussion.

Verification: Reproduced both incorrect read behaviors before repair. Added
HTTP regressions for declared defaults, fallback, empty configuration,
reordered extras, explicit opens, project injection and disabled hosts with
existing panes. Focused frontend tests (80), production build, owning Go
serve/config and builtin/boot tests, gofmt, go vet, lint and make check passed.
2026-10-18 00:19:23 +08:00
YHH 37ccec6449 Merge pull request #13595 from esengine/feat/12356-follow-tool-changes
feat(mcp): follow a server's tool changes instead of accepting each one
2026-10-17 09:18:23 -07:00
YHH a75e30b5de Merge pull request #13637 from xxoingr/fix/desktop-account-panel-language
fix(desktop): the account panel says its failures in the window's language
2026-10-17 09:15:38 -07:00
esengine 443d9afb6d docs(model): give the unavailable-video code its own line 2026-10-17 09:08:42 -07:00
esengine 30b2cf89de fix(model): open only the videos a tool in this process handed out
A stored reference carried a path the adapter opened as written, so a session
file that was edited, restored or imported could name a file no tool had
checked. read_video now records the path it verified under the file's hash in a
process-local registry; the adapter resolves through it and reports an
ungranted reference as video.file_unavailable.
2026-10-17 09:08:20 -07:00
SivanCola 8709b556f0 merge: integrate current studio project contracts
Problem: The unified sidebar conflicted with newer Studio worktree grouping
and text scaling changes.

Root cause: Both branches evolved project identity and row presentation from
the same baseline, including helpers extracted by the sidebar change.

Fix: Preserve workspaceContains across grouped local and SSH projects, keep
isolated session directories in open and palette routes, retain isolation and
peer-thread markers, and preserve font scaling. Include reviewed synthetic UI
captures and a release note for the relocated controls.

Verification: The integrated frontend suite passed 5381 tests. Four focused
grouped SSH/palette regressions and the production build passed. gofmt, go vet,
make lint, make check and builtin/boot tests passed without widening baselines.
2026-10-18 00:02:12 +08:00
xxoingr 783584d3f1 fix(desktop): the account panel says its failures in the window's language
Account caught with String(e), so a coded refusal such as
account.signin_disabled printed "Error: " and the kernel's English
fallback instead of the wording kernel.ts already has, and its
expired-request message was set without t() and had no English. The
port's accountPoll also hand-rolled its fetch and threw the raw
response text, a JSON envelope with no code to word.

Catch with reason(e) like every other panel, put the expiry message
through t() with an English entry, and send accountPoll through post0.
2026-10-18 00:01:00 +08:00
esengine 1010be9737 refactor(plugin): copy the approval map with maps.Copy 2026-10-17 09:00:29 -07:00
esengine 8d7870b067 feat(mcp): follow a server's tool changes instead of accepting each one 2026-10-17 09:00:29 -07:00
SivanCola da051abb2c feat: unify local and SSH project navigation
Problem: Machine-grouped navigation made project switching cumbersome, and
session hover actions had inconsistent selection and keyboard behavior.

Root cause: Local and remote lists owned separate presentation and opening
flows. Remote defaults, paused stream costs, mutation deduplication and focus
restoration did not consistently survive asynchronous navigation.

Fix: Present one project list with source metadata, a common project picker,
fold-all control and bounded recent-session previews. Share neutral selection,
leading pin and trailing archive actions across local and SSH conversations.
Route new sessions and quick switching through the active environment, retain
latest navigation intent, and guard pending mutations and keyboard focus.
Forward remote session flags to the owning kernel and preserve typed errors,
configured workspaces and dedicated-stream connection costs.

Verification: 5263 frontend tests passed, production TypeScript/Vite build
passed, and focused browser and real SSH navigation checks are documented in
the QA reports. Owning Go serve/remotehost/attach suites passed. Pre-commit
gofmt, go vet, make lint, make check and builtin/boot tests passed without
widening the repository lint baseline.
2026-10-17 23:48:21 +08:00
SivanCola 18eeb0c8ff fix(attachments): enforce a user-owned streaming disk ceiling
Problem: ordinary binary uploads can consume unbounded workspace disk, and the
review needs direct coverage of file versus directory grants at read consumers.

Root cause: the streaming saver copies until EOF without a byte policy; the
project-config merge must not become an authority for a user disk safeguard.

Fix: enforce a named 1 GiB default while counting real bytes, retain rooted
cleanup on overflow, and return typed ceiling/source facts. Allow user config
to set the limit or explicit zero, hold it across project merges, render it
only at user scope, and strictly read it without degraded config fallback.
Cover selected-file siblings and directory link escape through actual reference
and tool consumers. Incorporate current Studio without rewriting history.

Verification: the former 8-byte/9-byte acceptance fails first and now refuses
cleanly. Full config race and focused control/serve/builtin races, frontend
tests/build, actual Electron rejection/retry, native Windows ARM64 boundary
and cleanup regressions, pinned lint and repolint pass.
2026-10-17 23:38:14 +08:00
YHH d7707f5183 Merge pull request #13597 from esengine/feat/web-access-settings-ui
feat(desktop): web search and fetch backends are set from Settings, and consent to be billed is its own switch
2026-10-17 08:37:04 -07:00
YHH cb2059a3df Merge pull request #13634 from esengine/fix/brand-badge-outline
fix(studio): draw the STUDIO badge as an outline
2026-10-17 08:29:31 -07:00
YHH 26fcf1134a Merge pull request #13632 from esengine/fix/spxx-file-image
test(desktop): live checks that a local image and the side question are seen with the built-in browser open
2026-10-17 08:24:53 -07:00
esengine efc38208bd fix(perf): restore the web-access harness override's closing brace after the merge 2026-10-17 08:21:37 -07:00
esengine e644290329 fix(studio): draw the STUDIO badge as an outline 2026-10-17 08:03:05 -07:00
esengine 00fcacca11 Merge remote-tracking branch 'origin/studio' into feat/web-access-settings-ui
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/perf/harness.tsx
#	desktop/frontend-next/src/i18n/en.ts
#	desktop/frontend-next/src/styles/peers.css
2026-10-17 08:01:04 -07:00
SivanCola 8b94e2d5da merge: reconcile attachment intake with current Studio composer
Problem: the attachment PR conflicts with Studio's extracted composer helpers
and the newer worktree setup surface.

Root cause: both branches changed the Composer's chip type and helper ownership.

Fix: merge origin/studio, use its shared composerChips owner and worktree setup
flow, and retain cancellable attachment uploads and native path references.
Remove the redundant local chip type instead of duplicating the shared owner.

Verification: TypeScript checking, 155 focused frontend tests, production build,
attachment/CSRF/cloud/control/fileutil Go regressions, 169 Electron unit and
packaging tests (one existing conditional skip), pinned lint and repolint pass.
2026-10-17 22:59:32 +08:00
YHH 4d3b21e333 Merge pull request #13571 from esengine/fix/queue-row-image-reason
fix(inbox): say why a queued line with a picture waits for the turn to end
2026-10-17 07:59:09 -07:00
YHH ac3085a257 Merge pull request #13583 from esengine/feat/peers-settings-ui
feat(desktop): session messages are switched on from Settings, and a held message can be let through for its project
2026-10-17 07:48:05 -07:00
esengine 4f8852dbd2 Merge remote-tracking branch 'origin/studio' into feat/web-access-settings-ui
# Conflicts:
#	.github/workflows/studio.yml
2026-10-17 07:33:06 -07:00
esengine 80dbb55361 test(desktop): the refusal is worded from the kernel's code now that its wording is on studio 2026-10-17 07:32:34 -07:00
esengine 5ffb22c1f5 Merge remote-tracking branch 'origin/studio' into feat/peers-settings-ui
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/port/mock_boundary.ts
#	desktop/frontend-next/src/port/port.ts
#	desktop/frontend-next/src/port/sse_boundary.ts
2026-10-17 07:24:27 -07:00
YHH a30c58ff94 Merge pull request #13631 from esengine/fix/price-fallback-explained
feat(studio): say why a price cannot be shown in the pinned currency, and offer the official one
2026-10-17 06:58:33 -07:00
esengine b225a3889f feat(inbox): the session queue holds as many prompts as asked unless the user sets agent.max_queued_inputs 2026-10-17 06:55:59 -07:00
esengine a56f1241e8 test(desktop): live checks that a local image and the side question are seen with the built-in browser open 2026-10-17 06:55:58 -07:00
YHH a4da20d96a Merge pull request #13629 from esengine/fix/feedback-reply-while-received-app
fix(studio): offer a reply on a released report that is still received
2026-10-17 06:48:06 -07:00
YHH 23708e88cb Merge pull request #13438 from chuiwenwei/fix/sessioninbox-read-failure-not-empty-queue
fix(sessioninbox): a queue that cannot be read is not an empty queue
2026-10-17 06:38:16 -07:00
YHH ef40245efc Merge pull request #13628 from esengine/fix/13605-ime-composition
fix(desktop): the agent's browser loads and navigates out of the window, so a composition in progress is not cut off
2026-10-17 06:32:52 -07:00
esengine 879c1c8ae6 feat(studio): say why a price cannot be shown in the pinned currency, and offer the official one 2026-10-17 06:29:27 -07:00
YHH abf120c2ce Merge pull request #13590 from esengine/feat/12357-mcp-signin
feat(mcp): sign-in asks which host the server sends you to before the browser opens
2026-10-17 06:22:13 -07:00
YHH b21ae6ee3c Merge pull request #13579 from esengine/fix/13560-cache-by-spec
fix(plugin): the MCP handshake cache keeps one entry per server name and spec
2026-10-17 06:20:59 -07:00
YHH 21ae289cc9 Merge pull request #13586 from SivanCola/fix/group-worktree-sessions
fix(studio): group worktree chats under their source project / 将隔离会话归入原项目
2026-10-17 06:18:59 -07:00
Will 3e9dcd0e53 test(sessioninbox): hold the transaction lock through filelock, not unix.Flock
Review follow-up: the audit helper used unix.Flock with no build tag, so lint's
typecheck and test (windows-latest) failed with 'undefined: unix.Flock'. Take the
lock through internal/base/filelock's TryAcquire, which has the same unix and
windows implementations the store uses, so the held-lock tests run on every platform.
2026-10-17 21:15:12 +08:00
YHH d46fa91cb5 Merge pull request #13585 from esengine/feat/peers-settings
feat(peers): a real switch for messages between sessions, applied at the next turn
2026-10-17 06:13:40 -07:00
esengine 3d69508aca test(desktop): drop the leftover debugging from the hung-navigation check 2026-10-17 06:09:11 -07:00
esengine ae8397df0a test(desktop): do not wait on a navigation that never answers 2026-10-17 06:07:07 -07:00
esengine 164bc5d258 wip debug3 2026-10-17 06:06:26 -07:00
esengine 1bd238e593 wip debug2 2026-10-17 06:05:44 -07:00
esengine f78b2a86fe fix(studio): offer a reply on a released report that is still received 2026-10-17 06:05:22 -07:00
esengine c3f2befaa3 wip debug 2026-10-17 06:05:05 -07:00
esengine 1ddfa7206a fix(desktop): a page held out of the window for a navigation comes back within a fixed limit 2026-10-17 06:04:23 -07:00
esengine 335ab3ad8b fix(plugin): forget sign-in consent through a root opened on the server's state directory 2026-10-17 06:00:37 -07:00
esengine 0a804c33ad docs(release): note for the input-method fix 2026-10-17 05:59:35 -07:00
esengine f8a6d19980 fix(desktop): the agent's browser loads and navigates out of the window, so the app page keeps the keyboard and its composition 2026-10-17 05:59:35 -07:00
esengine fd822b3623 test(desktop): a live check that an IME composition survives the agent's browser 2026-10-17 05:59:35 -07:00
esengine 1ac226ac6d fix(plugin): list a server's cache entries from the fixed directory, not a pattern holding the name 2026-10-17 05:59:28 -07:00
YHH 771427b639 Merge branch 'studio' into feat/peers-settings 2026-10-17 05:58:36 -07:00
esengine addbb5bf05 fix(model): hash the opened video before sending a byte of it 2026-10-17 05:48:17 -07:00
YHH 06c4340cc0 Merge pull request #13608 from esengine/a5/web-access-settings
feat(serve): read and save the web search and fetch settings over HTTP
2026-10-17 05:47:27 -07:00
esengine dedc3e5af3 fix(model): open a video file once and send exactly what was checked 2026-10-17 05:45:21 -07:00
YHH 55e73ec8fa Merge pull request #13612 from esengine/fix/13610-prefs-nav-selected-hover
fix(studio): keep the selected settings section's look while it is hovered
2026-10-17 05:44:37 -07:00
esengine c472732883 feat(desktop): web access settings read as read-only in a window that was not granted editing 2026-10-17 05:40:29 -07:00
esengine 957c90e3e8 fix(studio): keep the selected settings section's look while it is hovered 2026-10-17 05:33:10 -07:00
YHH b0c6cf2dd8 Merge pull request #13621 from xxoingr/fix/desktop-settings-refusal-codes
fix(desktop): keep the refusal's code when network or wallpaper settings fail
2026-10-17 05:32:13 -07:00
esengine 9a45df0c8b Merge remote-tracking branch 'origin/a5/web-access-settings' into feat/web-access-settings-ui 2026-10-17 05:31:51 -07:00
esengine abcf61d321 fix(serve): web access settings are written only with the edit grant 2026-10-17 05:30:56 -07:00
YHH ea7be33211 Merge pull request #13436 from chuiwenwei/fix/e2ebench-unsplit-runs-not-in-medians
fix(e2ebench): keep runs without a recorded split out of the boundary medians
2026-10-17 05:29:03 -07:00
YHH 610a6a99d9 Merge pull request #13623 from esengine/fix/13604-running-count
fix(desktop): a status read lost to the network is asked again, so a pane nobody is looking at stops reading as running
2026-10-17 05:24:29 -07:00
YHH 08198846ef Merge pull request #13622 from esengine/fix/scratch-spill-race
fix(sessionstore): scratch spill sweep keeps its directory so a concurrent spill is not truncated
2026-10-17 05:22:38 -07:00
YHH 1bf59ce841 Merge pull request #13618 from xxoingr/fix/desktop-port-shadowed-faces
fix(desktop): stop the real port's own copies from hiding its faces
2026-10-17 05:20:57 -07:00
YHH c4825325f6 Merge pull request #13620 from esengine/fix/flaky-oversize-spill-scratch
test(agent): give the scratch-spill test its own temp directory
2026-10-17 05:17:25 -07:00
YHH 7a1a9ef810 Merge pull request #13619 from esengine/fix/win-flake-walk-lock
test: Windows waits sized for a loaded runner
2026-10-17 05:13:59 -07:00
xxoingr b8ddd82efb fix(desktop): keep the refusal's code when network or wallpaper settings fail
saveNetwork, uploadWallpaper and clearWallpaper hand-rolled their fetch
and threw a plain Error, so the code the kernel sent never reached
reason(): an unsupported wallpaper read as the kernel's English fallback
in a Chinese window, a failed clear as a path and a status, and the
existing wording for network.rejected and wallpaper.* went unused. They
now go through post0 and del, whose fail() keeps it.

SaveNetworkSettings also stops prefixing its refusal with a Chinese
sentence: the frontend frames network.rejected itself, and the prefix
would read twice in one language and as a fragment in the other.
2026-10-17 20:09:15 +08:00
esengine c1992ffe7f fix(sessionstore): the scratch spill sweep leaves its directory in place so a concurrent spill is not truncated 2026-10-17 05:08:12 -07:00
esengine 7b726d70fa fix(desktop): a status read lost to the network is asked again, so a pane nobody is looking at stops reading as running 2026-10-17 05:04:26 -07:00
esengine a8bfcd0944 test(agent): give the scratch-spill test its own temp directory 2026-10-17 05:02:48 -07:00
xxoingr 8d267f265a fix(desktop): stop the real port's own copies from hiding its faces
SsePort still declared exportPlugin, dryRunHook, trustMcp, reconnectMcp,
parseMcp and probeProvider after they were split into its faces, and a
method on the outer class hides the face's. So the faces' dryRunHook and
probeProvider, which go through post0 to keep a refusal's code, never
ran: probeProvider threw the raw response text, and onboarding showed a
refusal envelope as its message and could never offer the vendor-console
link it keys on provider.probe.unauthorized. exportPlugin was the other
way round, the face holding the stale copy.

Drop the six copies, move the current exportPlugin into SseExtensions,
and guard the chain so no face redeclares one below it.
2026-10-17 20:02:29 +08:00
YHH 022b82d2d5 Merge pull request #13606 from esengine/a5/acp-paid-persist
fix(acp): offer a saved choice for paid search consent and keep it on a replayed card
2026-10-17 04:57:39 -07:00
Will d8c0c249cb fix(e2ebench): keep a run with no recorded split out of the correct-boundary medians
renderSolveProfiles folded every run that reached a correct checkpoint into
the boundary medians, including runs whose trajectory was never read. With
-checkpoints and no -trajectories those runs carry zero round and
verification tallies, so the report printed "rounds before 0 · rounds after
0 · verifications after 0" as if they had been measured.

Only runs whose split was actually recorded now fold in, and a suite where no
run recorded one says the boundary was never split instead of printing zeros.
The all-measured medians are unchanged.
2026-10-17 19:55:50 +08:00
esengine f40b87d144 test: Windows waits sized for a loaded runner (walk re-stat window, grant-lock helper retry) 2026-10-17 04:55:39 -07:00
YHH 132deb676b Merge pull request #13611 from esengine/a5/title-wait
fix(serve): a stale title result must not overwrite a newer one, and a changed first message is a new request
2026-10-17 04:53:46 -07:00
YHH 75a4e7e2fe Merge pull request #13598 from SivanCola/codex/workspace-flow
Complete workspace preparation and branch switching / 补齐工作目录准备与分支切换流程
2026-10-17 04:47:59 -07:00
YHH a45f8abe4d Merge pull request #13552 from esengine/feat/peer-threads
feat(desktop): an icon on each session this one has written to, saying where the exchange stands
2026-10-17 04:42:48 -07:00
esengine 6c53e4d6a4 refactor: walk the messages backward with slices.Backward 2026-10-17 04:35:17 -07:00
esengine 506ef7e5de style: align the native video line with the card body 2026-10-17 04:35:17 -07:00
esengine d45454a300 feat: show a natively sent video on the card and in the terminal; document it 2026-10-17 04:35:17 -07:00
esengine d0f220096b refactor: keep the video change inside the file, function and comment budgets 2026-10-17 04:35:17 -07:00
esengine d1488d5d0c feat(boot): wire native video through the real build and prove it at the vendor request boundary 2026-10-17 04:35:17 -07:00
esengine a91aaa6c4d feat(config): a user-level ceiling below the documented native video limit 2026-10-17 04:35:17 -07:00
esengine 1502533094 feat(tools): read_video hands an MP4 to a model that watches video natively 2026-10-17 04:35:17 -07:00
esengine e47de51cab feat(model): send a referenced video to endpoints that declare a protocol, and say so when one cannot 2026-10-17 04:35:17 -07:00
esengine 4b297506db feat(provider): a message can reference a video file; it rides only the request before the model answers 2026-10-17 04:35:17 -07:00
esengine 2a51c686bc feat(config): declare which models read video natively and how a file reaches them 2026-10-17 04:35:16 -07:00
YHH 189f7672c7 Merge pull request #13614 from xxoingr/fix/control-pdf-cancel-bounded-taskkill
fix(control): cancel a PDF extraction through proc's bounded tree kill
2026-10-17 04:32:12 -07:00
YHH ffe2885867 Merge pull request #13446 from chuiwenwei/fix/e2ebench-unmeasured-run-not-accounted
fix(e2ebench): account a sidecar-recovered run as a lower bound
2026-10-17 04:27:53 -07:00
esengine f11d657c32 Merge remote-tracking branch 'origin/studio' into feat/peer-threads
# Conflicts:
#	.github/workflows/studio.yml
2026-10-17 04:26:24 -07:00
SivanCola 5284c18764 fix: restore worktree preparation focus and truthful terminal states
Problem: creating a worktree dropped keyboard focus when the composer became
inert, returning to editing did not restore it, and terminal pages still
reported waiting or mapped cleanup failure to a confirmation state.

Root cause: draft restoration attempted focus before React removed inert;
the preparation page had no focus owner, phase fallbacks conflated terminal
states, and details/edit actions shared a configuration identity.

Fix: focus the preparation heading on entry, recover focus when a removed
phase action leaves the body active, preserve surviving detail focus, and
restore the composer only after the stage-clearing commit. Use distinct
view action IDs and explicit terminal labels, and show elapsed waiting only
for active phases without changing existing typography or button recipes.

Verification: failure/cancellation interaction regressions, phase/disclosure
unit tests, real-browser focus and draft-retention checks, English dark-page
labels and shared button hierarchy, frontend typecheck/build/census, and
repository lint/check; full frontend: 634 files and 5,257 tests passed.
No Git or backend behavior changed.
2026-10-17 19:25:03 +08:00
xxoingr 2234b0f8a0 fix(control): cancel a PDF extraction through proc's bounded tree kill
setShellKillTree on Windows ran its own taskkill /F /T inside
exec.Cmd.Cancel with no time limit. #13323 bounded the taskkill in
proc.KillTree because Wait does not return until the cancel hook has,
but this hook never went through KillTree, so a PDF text extraction past
its 8 s deadline could still hang on a taskkill that never answers.

Delegate to proc.SetCancelKillsTree, the helper proc.RunCommand already
uses, so the only taskkill left is the bounded one in proc.
2026-10-17 19:12:32 +08:00
esengine 71cd039be4 Merge remote-tracking branch 'origin/studio' into feat/web-access-settings-ui
# Conflicts:
#	.github/workflows/studio.yml
2026-10-17 04:10:40 -07:00
Will 27c92d2dfb fix(e2ebench): a lower-bound run stays partial across legs and out of the meter ratio
Review follow-up: Partial now accumulates across legs (a killed first leg plus a
complete second leg is still a lower bound), and the meter comparison skips a
Partial run the same way it skips an unaccounted one, since its missing tail is
not a divergence. Rebased onto current studio; the stub tests use requireShellStub
so test (windows-latest) can run.
2026-10-17 19:06:09 +08:00
SivanCola 865399363f fix: preserve MCP shutdown metadata and confine worktree rollback
Problem: hosted atomic coverage intermittently lost the MCP resource tool,
and CodeQL reported an unchecked filesystem probe during worktree cleanup.

Root cause: a queued cache callback read clients after Host.Close cleared
handshake metadata. Cleanup accepted a result path without independently
checking the trusted managed root used by its construction owner.

Fix: snapshot advertised capabilities and instructions before releasing the
deferred spawn; keep only persistence asynchronous. Capture the managed root
once for creation and rollback, validate a local relative descendant before
probing the filesystem, and retain registration and unchanged-head checks.

Verification: deterministic shutdown/cache and wrong-boundary regressions;
plugin atomic coverage and race tests; boot atomic coverage; worktree/serve
race checks; native Windows rollback cases; local CodeQL path query; root
lint, Windows lint and changed-file repository checks.
2026-10-17 19:05:38 +08:00
Will d74e5ad218 fix(e2ebench): account a sidecar-recovered run as a lower bound
A leg whose final record was missing but whose <metrics>.partial snapshot was
read was marked Unaccounted, which gatherSuiteStats skips outright. That
contradicted Partial's meaning — real numbers that stop at the last snapshot
and belong in the totals — so the recovered tokens, cost and lower-bound hint
were all unreachable. Only a leg with neither record is now Unaccounted; a
recovered snapshot stays accounted and sets Partial, matching the semantics
swebench mode already uses.

renderMeterAccounting also treated PromptTokens+CompletionTokens == 0 as an
absent harness measurement, inferring state from a value. A persisted record
saying zero is a valid zero, so the guard is now the explicit Unaccounted flag
alone.

Tests: the copied audit case that asserted unaccounted=1 for a sidecar-recovered
run encoded the wrong semantics and now asserts Partial=true, Unaccounted=false
and that 1200/80 and the cost reach the aggregates; the divergence fixture that
relied on zero tokens sets Unaccounted explicitly, and a new case pins that a
persisted zero is priced on both sides. The record-less case and the healthy-run
control are unchanged in intent.
2026-10-17 19:05:20 +08:00
YHH 6d74605fd0 Merge pull request #13609 from esengine/fix/13605-browser-steals-focus
fix(desktop): the agent's built-in browser no longer takes the keyboard from the page you are typing in
2026-10-17 04:03:12 -07:00
Will fd9792e536 i18n(desktop): translate inbox.foreign_run 2026-10-17 19:00:33 +08:00
esengine df88dde9ba fix(serve): a stale title result must not overwrite a newer one, and a changed first message is a new request 2026-10-17 03:45:53 -07:00
esengine b8fa5ed0f6 docs(release): note for the agent browser keyboard fix 2026-10-17 03:45:51 -07:00
esengine 3f6e122e30 test(desktop): stage the person's click the way the platform delivers it 2026-10-17 03:45:51 -07:00
esengine 1ce9cb84c5 test(desktop): the person's own click into the agent's page keeps the keyboard there 2026-10-17 03:45:51 -07:00
esengine 03c71ce0ee fix(desktop): hand the keyboard back a turn after the platform gives it to the agent's page 2026-10-17 03:45:51 -07:00
esengine 02bdb8b8bc wip debug 2026-10-17 03:45:50 -07:00
esengine 41318d5da9 fix(desktop): the agent's browser no longer takes the keyboard from the app page 2026-10-17 03:45:50 -07:00
esengine 5bea200f3a wip probe 2026-10-17 03:45:50 -07:00
esengine 639a53278c test(desktop): a live check of who owns the keyboard while the agent drives its browser 2026-10-17 03:45:50 -07:00
YHH d53132fdf6 Merge pull request #13603 from esengine/a5/mux-attach-baseline
fix: keep the open pane across a failed pane-list read and resume a first mux attach from where it attached
2026-10-17 03:42:47 -07:00
YHH e5d01a32ce Merge pull request #13561 from par73e/fix/11860-compaction-cache-prefix
fix(compaction): reuse eligible sent request prefixes safely
2026-10-17 03:41:27 -07:00
SivanCola f58bd3866b fix(worktree): normalize Windows rollback paths and explain recovery
Problem: failed or cancelled worktrees remain registered on Windows, and the
cleanup-failed screen leaves users without a concrete recovery procedure.
Root cause: native backslash paths are compared directly with Git porcelain's
slash paths. Cleanup uncertainty deliberately fences replacement creation.
Fix: normalize both registered and expected paths while preserving symlink
resolution and the unchanged-head guard. Cover native rollback and changed
branches, wire the Windows regressions into PR CI, and explain draft retention,
manual reconciliation, runtime closure and retry from the source folder.
Restore the existing design QA content and metadata, append only workspace
acceptance, and remove all eight screenshots from the final PR tree.
Verification: native Windows regression fails before the fix; the fixed worktree
package passes 36 tests with 6 platform skips. macOS worktree suite, focused
serve/worktree race tests, Windows lint, workflow contracts, 5,245 frontend tests,
typecheck/build, census and repository lint pass. Hosted CI still needs approval.
2026-10-17 18:37:23 +08:00
esengine a10b5f6758 Merge remote-tracking branch 'origin/studio' into feat/peers-settings-ui
# Conflicts:
#	.github/workflows/studio.yml
2026-10-17 03:28:54 -07:00
esengine f0a9ce4720 feat(serve): read and save the web search and fetch settings over HTTP 2026-10-17 03:28:46 -07:00
YHH 8e4fe65a87 Merge pull request #13580 from esengine/feat/11577-text-size
feat(desktop): an interface text size, separate from the interface zoom
2026-10-17 03:27:56 -07:00
esengine b5c2f8216d Merge remote-tracking branch 'origin/studio' into feat/peer-threads
# Conflicts:
#	.github/workflows/studio.yml
2026-10-17 03:27:24 -07:00
esengine 8b536210dd fix(acp): offer a saved choice for paid search consent and keep it on a replayed card 2026-10-17 03:25:57 -07:00
SivanCola 595f9cbbef test(boot): await discovery before disabled MCP assertions
Problem: Windows smoke reported an empty live catalog in the disabled-MCP
effect test's fresh always-loaded phase; the fixture expected one read tool.

Root cause: Build returns while cold discovery and always-loaded preconnection
can still be in flight. The fixture immediately issued an explicit connection,
leaving competing handshakes and initial catalog publication in its setup.
The adjacent always-load effect tests already await the boot-owned connection.

Fix: Wait for that connection in cold and always-loaded phases before explicit
registration. Keep cached deferred startup explicit and retain all filtering,
restart, catalog and provider assertions. Report held tools and server catalog
diagnostics if the allowed tool is still missing.

Verification: Related disabled/always-loaded/held-definition effect tests pass
normally and under the race detector. go vet, make lint and make check pass.
Full builtin and boot suites pass as well.
Native Windows CI must confirm the replacement candidate.
2026-10-17 18:24:33 +08:00
YHH a4bc92bcc9 Merge pull request #13549 from esengine/feat/0b-peer-threads
feat(peers): where each hand-off stands: waiting, working, replied or declined
2026-10-17 03:24:16 -07:00
par73e b739448a83 fix(compaction): reuse eligible sent request prefixes safely 2026-10-17 18:22:08 +08:00
SivanCola fdae95f92e fix(studio): fence stale worktree source reads and update palette guard
Problem: an explicit source refresh can repopulate the palette after switching
workspace, port or session, and an older initial read can overwrite a later read.
Root cause: only the initial fetch had a lifetime fence; manual reads published
without a shared generation. The browser guard still awaited a retired hover card.
Fix: put initial and manual reads behind one latest-read generation, invalidate
it on scope changes, and verify the unified palette before and after task delivery.
Verification: four deferred-response regressions fail without the fix and pass
with it; 633 frontend files / 5,245 tests pass, typecheck/build, census invariants
and fixture verification, repository checks, and browser palette interactions.
Upstream workflows remain pending repository-admin approval, not passed CI.
2026-10-17 18:17:44 +08:00
esengine d586ffdb67 fix: keep the open pane across a failed pane-list read and resume a first mux attach from where it attached 2026-10-17 03:15:39 -07:00
esengine 13e6f6fed0 Merge remote-tracking branch 'origin/feat/12356-follow-tool-changes' into feat/mcp-signin-follow-ui 2026-10-17 03:10:59 -07:00
esengine 21c9ecfec8 chore(desktop): leave followsChanges to the kernel PR that sends it 2026-10-17 03:10:58 -07:00
esengine 476c301df9 feat(desktop): sign in to an MCP server that answered 401, and follow a server's tool changes 2026-10-17 03:10:28 -07:00
YHH 42a50deb7e Merge branch 'studio' into feat/0b-peer-threads 2026-10-17 03:09:06 -07:00
SivanCola cc0c4beacf Merge latest Studio base into workspace preparation flow
Problem: the PR overlaps the current Studio font-scaling update.
Root cause: both changes replace the workspace stylesheet, and hub additions
bring its combined source over the repository file-size ceiling.
Fix: retain the new palette with shared, scalable typography tokens; preserve
all upstream behavior and extract hub close/shutdown ownership together.
Verification: 633 frontend files and 5,241 tests; typecheck/build; affected
worktree, serve, control and boot suites and race tests; Desktop Go suite;
make lint/check; fresh production browser palette with no console errors.
2026-10-17 18:05:08 +08:00
SivanCola 2d65cb07b0 feat(studio): complete branch and worktree preparation flow
Problem: workspace configuration disappeared after the first task and creating
an isolated worktree left the composer without visible progress or recovery.

Root cause: workspace selection, Git branch switching and runtime construction
had separate UI lifetimes, with no cancellable preparation/publication boundary.

Fix: keep one searchable workspace palette across conversation states; expose
real preparation phases with operation-ID reconciliation, retry and cancellation.
Serialize cancellation against publication, terminate checkout descendants and
clean unpublished resources before acknowledging cancellation. Preserve task
and attachment drafts, and reuse existing typography throughout status screens.

Verification: 5,231 frontend tests, typecheck and production build; root and
Desktop Go suites; affected backend race tests; lint and repository checks;
real Git browser checks for switch, failure/retry, cancellation and handoff.
Include light/dark and wide/narrow before-and-after screenshots and design QA.
2026-10-17 17:59:47 +08:00
esengine e0577c3381 fix(studio): a finished sub-agent says it is handed back, not only how long it took
The sub-agent list replaced the status with the duration whenever one was recorded. It now shows the status word and the duration, in the ok ink.
2026-10-17 02:59:28 -07:00
esengine 907aba3e90 Merge remote-tracking branch 'origin/studio' into feat/11577-text-size 2026-10-17 02:56:59 -07:00
SivanCola bc47cd69e9 fix: confine worktree registration reads to Git metadata
Problem: CodeQL still reported a path-injection alert at the worktree
registration read, and a registration symlink could read outside its metadata
directory before assigning the checkout to a project.

Root cause: Validating checkout identity and the registration backlink did not
constrain the filesystem operation that reads that backlink. The plain
os.ReadFile call followed symlinks outside the selected Git directory.

Fix: Validate the checkout metadata path relative to the shared repository,
open that directory through os.Root, and read the fixed gitdir entry through a
second root confined to this checkout's metadata. Preserve relative backlinks
and internal symlinks while refusing escaping registrations.

Verification: A real-Git symlink-escape regression fails on the original code
and passes with the fix. Worktree/workspace identity suites, grouped-project
HTTP regressions, focused race tests, Windows test compilation, go vet,
make lint and make check pass. Local CodeQL CLI 2.27.1 with go-queries 1.6.11
reproduces the exact remote alert before the change; afterward that alert is
removed and the same path-injection query introduces no new results.
Builtin and boot integration suites also pass.
2026-10-17 17:46:10 +08:00
esengine b2d1b1aa5a docs(release): name the change the web-access note belongs to 2026-10-17 02:41:56 -07:00
esengine ba51af6781 feat(desktop): web search and fetch backends are set from Settings, and consent to be billed is its own switch 2026-10-17 02:41:13 -07:00
YHH fed3ca2b75 Merge pull request #13592 from xxoingr/test/secrets-sinks-vanished-walk
test(secrets): let the sink registry walk past an in-tree temp folder
2026-10-17 02:39:38 -07:00
esengine 0d13220cc2 refactor(plugin): copy the approval map with maps.Copy 2026-10-17 02:35:53 -07:00
SivanCola 76ee9db5e9 fix: keep checkout labels inside narrow title bars
Problem: Checkout labels could push a conversation title beyond its breadcrumb
at phone widths and high interface scale.

Root cause: The fixed-width directory badge consumed the title's reserved
space even after project and folder controls were hidden by the narrow layout.

Fix: Group project and checkout context in a shrinkable clipped flex child,
allow labels to ellipsize, and preserve the title's existing four-em floor.
Document the shared layout constraint without weakening browser guards.

Verification: The eight failing light/dark width-and-zoom cases now pass in
perf/narrow.mjs. Title spacing and overflow, intrinsic layout and hover guards,
12 related interaction tests, typecheck, production build, vet and repository
checks pass. The Go implementation is unchanged by this layout correction.
2026-10-17 17:33:20 +08:00
SivanCola dbc39493d6 fix: harden grouped checkout ownership and sync studio
Problem: Grouped projects could open the source after an explicit worktree
selection, hide source-alias history, omit inferred launcher exclusions, or
remain unusable when their source folder disappeared. Copied Git metadata
could also claim another checkout's project identity.

Root cause: Display identity was reused as execution and catalog authority.
Project inference duplicated an unbounded marker walk without validating
managed checkout containment or the reverse Git registration.

Fix: Preserve selected directories and all catalog members, choose a surviving
project directory, and use complete member roots for editor discovery and
launch. Reuse shared checkout identity and validate its managed boundary,
local prefix and registration backlink. Merge studio, move root resolution to
its project owner to preserve the file-size budget, and align the title guard
with the intended checkout label while retaining spacing and overflow limits.

Verification: Failing original-head HTTP/path regressions pass after the fix.
Frontend tests (629 files, 5,221 tests), production build, focused race tests,
go vet, make lint and make check pass. Added a 100-root tree benchmark and a
deterministic delayed-header test; repository suites and browser guards cover
adjacent behavior. Hosted checks must validate the replacement PR head.
2026-10-17 17:28:59 +08:00
esengine 29e3125d07 Merge remote-tracking branch 'origin/studio' into feat/web-access-settings-ui 2026-10-17 02:27:36 -07:00
YHH b952a3fbd6 Merge pull request #13575 from esengine/feat/11577-fs-scale
refactor(desktop): every interface font size rides one scale, so a text-size setting can reach it
2026-10-17 02:27:33 -07:00
YHH e35748e0ba Merge pull request #13589 from esengine/feat/granted-folder-file-open
feat(workbench): open a file in a folder the user granted, read-only
2026-10-17 02:17:58 -07:00
xxoingr d0f3e547fa test(secrets): let the sink registry walk past an in-tree temp folder
TestCredentialSinkRegistry walks internal/frontend/serve, where serve's
own tests create and remove extra-* folders through tempAside. Run in
parallel with those tests, the walk can list such a folder and fail when
it is gone a moment later, the same race that failed the storage
state-path guard. Skip a vanished entry with testenv.VanishedMidWalk.
2026-10-17 17:14:33 +08:00
esengine 4db4e8b319 feat(mcp): follow a server's tool changes instead of accepting each one 2026-10-17 02:13:47 -07:00
esengine 842aa364ce Merge remote-tracking branch 'origin/feat/11577-fs-scale' into feat/11577-text-size 2026-10-17 02:12:53 -07:00
esengine 1eecbc113b Merge remote-tracking branch 'origin/studio' into feat/11577-fs-scale
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/sidepanel.css
2026-10-17 02:05:28 -07:00
SivanCola ce29aae765 docs(release): note for the Studio persona page 2026-10-17 17:03:44 +08:00
SivanCola 27434c885f feat(studio): a persona page that writes the user config for new sessions 2026-10-17 17:01:53 +08:00
SivanCola 21d8cc2fa9 feat(persona): compose a user persona into the cache-stable system prompt 2026-10-17 17:01:51 +08:00
esengine a3337ebbf7 feat(mcp): sign-in asks which host the server sends you to before the browser opens 2026-10-17 01:52:04 -07:00
SivanCola 86c3630d17 fix: group managed worktree chats under their source project
Problem: Studio lists a managed worktree and its source checkout as two
same-named sidebar projects, scattering one project's conversations.

Root cause: Sidebar ownership, session catalogs, and project operations use
checkout paths as project identities even when they share a Git repository.

Fix: Resolve project ownership from managed checkout Git identity while
retaining each transcript and runtime working directory. Merge session
catalogs before paging and keep registration, ordering, capacity, and removal
consistent with the project group. Show the checkout type in the chat header
and mark isolated history without migrating persisted data.

Verification: Serve/worktree/workspace identity and builtin/boot suites,
focused race tests, Desktop Go tests, frontend tests and production build,
go vet, make lint, and make check passed. Browser interactions and an installed
macOS package verified grouping and original/isolated conversation navigation.
2026-10-17 16:51:22 +08:00
esengine b72c6b4506 feat(workbench): open a file in a folder the user granted, read-only
GET /workspace/file takes an optional root, checked against the grant list and re-vetted on read through the decision the picture route uses. The workbench carries the folder, never saves, and says why.
2026-10-17 01:51:12 -07:00
YHH 3d983ca0f3 Merge pull request #13550 from esengine/feat/13526-concurrency
feat(delegation): sub-agent concurrency and parallel writers default to no limit; depth keeps a named stop at 8
2026-10-17 01:49:28 -07:00
esengine b334cd31d9 fix(desktop): session message settings follow the kernel's refusal codes and its available flag 2026-10-17 01:42:53 -07:00
esengine 747c79dcc8 test(peers): compare wrapped errors with errors.Is 2026-10-17 01:27:16 -07:00
YHH f2b47cdfe0 Merge pull request #13567 from esengine/fix/13253-composer-feel
feat(desktop): the composer keeps the 1.x feel — a border sweep on hover and focus, no state word inside the box
2026-10-17 01:26:54 -07:00
YHH 0e740d3299 Merge pull request #13581 from esengine/a5/mux-soak-clean
test(serve): per-pane delivery metrics on the multiplexed stream and a hundred-pane soak
2026-10-17 01:26:32 -07:00
YHH 522b9f61e4 Merge pull request #13577 from esengine/feat/13540-view-image
feat(tools): view_image shows a model the picture in a workspace file, for models that read images
2026-10-17 01:22:56 -07:00
esengine c127511bf2 feat(peers): English wording for the new refusal codes 2026-10-17 01:22:34 -07:00
esengine 5c27e9c6f3 docs(release): shorten the session-messages note 2026-10-17 01:16:32 -07:00
esengine 978914283b feat(desktop): session messages are switched on from Settings, and a held message can be let through for its project 2026-10-17 01:16:32 -07:00
esengine a0a1a860e8 feat(peers): a real switch for messages between sessions, applied at the next turn 2026-10-17 01:16:13 -07:00
esengine 0bd263426b test(serve): per-pane delivery metrics on the multiplexed stream and a hundred-pane soak 2026-10-17 01:08:45 -07:00
esengine 8300f72870 feat(tools): view_image shows a model the picture in a workspace file, for models that read images 2026-10-17 01:08:33 -07:00
YHH b4e9ae74bb Merge pull request #13574 from esengine/a5/relay-harness
test(relay): drive a hosted page against a real Studio through a stand-in relay in CI
2026-10-17 01:05:49 -07:00
YHH 9a67cbaa26 Merge pull request #13558 from par73e/fix/13288-side-panel-layout
fix(desktop): collapse side questions without losing their state
2026-10-17 01:03:21 -07:00
YHH 824e406f40 Merge pull request #13576 from esengine/fix/mcp-same-name-activation
fix(mcp): projects of one repository that declare a server by the same name keep their enables side by side
2026-10-17 00:55:28 -07:00
YHH 8809ed83bb Merge pull request #13548 from esengine/feat/0b-dispatch
feat(peers): a model tool that hands a task to a session in another project, default off
2026-10-17 00:54:34 -07:00
esengine 14db96264c fix(plugin): the MCP handshake cache keeps one entry per server name and spec 2026-10-17 00:48:38 -07:00
YHH ddb3d81907 Merge pull request #13556 from par73e/fix/12750-windows-remote-script
fix(remote): launch detached Windows kernels from a script file
2026-10-17 00:47:42 -07:00
YHH 154c8a8d9e Merge pull request #13551 from esengine/a5/ds-fetch
feat(fetch): DeepSeek Fetch API as a paid fallback for web_fetch, behind the billing-consent card
2026-10-17 00:41:17 -07:00
esengine d0c3dd5212 docs(release): shorten the text-size note 2026-10-17 00:40:54 -07:00
esengine bf02618c64 feat(desktop): an interface text size, separate from the interface zoom 2026-10-17 00:40:29 -07:00
YHH 5c0ea6f90a Merge branch 'studio' into fix/13288-side-panel-layout 2026-10-17 00:36:55 -07:00
YHH 295a981d83 Merge pull request #13568 from esengine/fix/job-stalled-notice-localized
fix(jobs): word the stalled background job warning in the interface language
2026-10-17 00:31:24 -07:00
par73e 121c0cf7ca fix(desktop): collapse side questions without losing their state 2026-10-17 15:31:06 +08:00
esengine f2e3ff8433 ci(relay): build the host from the repository root, where its module is 2026-10-17 00:31:05 -07:00
esengine 0648b575d0 feat(serve): read and save the web search and fetch settings over HTTP 2026-10-17 00:30:03 -07:00
esengine 1a0732b97e fix(mcp): projects of one repository that declare a server by the same name keep their enables side by side 2026-10-17 00:27:54 -07:00
YHH e9388db72b Merge pull request #13547 from esengine/a5/ds-search-paid
feat(search): DeepSeek Search API as a paid fallback behind a billing-consent card
2026-10-17 00:26:06 -07:00
esengine 5d99a796ce test(desktop): the type-scale tests read sizes that ride the text-size scale 2026-10-17 00:21:51 -07:00
esengine af765d6b82 refactor(desktop): every interface font size rides one scale, so a text-size setting can reach it 2026-10-17 00:21:51 -07:00
esengine 4eef35a0b5 ci(relay): pass the base ref through the environment 2026-10-17 00:20:56 -07:00
YHH 720dc69c75 Merge pull request #13570 from esengine/fix/state-root-walk-wait
test(config): the churn in the walk test never reuses a directory name
2026-10-17 00:19:26 -07:00
esengine 81729ee851 test(relay): drive a hosted page against a real Studio through a stand-in relay in CI 2026-10-17 00:19:05 -07:00
esengine 28af7a784f feat(inbox): say why a queued line with a picture is waiting for the turn to end
A queued message that froze an image cannot be admitted as mid-turn guidance. The manifest now records that (images), and the queue row says so instead of 'not delivered yet'.
2026-10-17 00:16:06 -07:00
par73e bb62bb8057 fix(remote): launch detached Windows kernels from a script file 2026-10-17 15:14:22 +08:00
esengine fdb5096f0c Merge a5/ds-search-paid into a5/ds-fetch 2026-10-17 00:11:34 -07:00
esengine e930472cf7 Merge studio into a5/ds-search-paid 2026-10-17 00:08:48 -07:00
esengine a2d77f97f5 test(boot): a red resource-tool run names what the schema cache held 2026-10-17 00:07:14 -07:00
esengine d6302bfae2 test(config): the churn in the walk test never reuses a directory name 2026-10-17 00:04:07 -07:00
YHH 8bf412accd Merge pull request #13564 from esengine/fix/mux-open-timeout
fix(studio): panes read their own event streams when the shared one never opens
2026-10-16 23:50:55 -07:00
YHH 72de55dc11 Merge pull request #13490 from xxoingr/test/storage-guard-vanished-walk
test(storage): let the state-path guard walk past an in-tree temp folder
2026-10-16 23:49:20 -07:00
esengine 0264316a83 fix(jobs): word the stalled background job warning in the interface language
recordStalled emitted a notice with no code, so the frontend showed the kernel's English sentence as is. It now carries job_stalled and a JobNotice payload with the quiet span, like the other job notices; the English text stays the fallback.
2026-10-16 23:48:02 -07:00
esengine a0efc71493 feat(desktop): the composer keeps the 1.x feel — a border sweep on hover and focus, no state word inside the box 2026-10-16 23:41:10 -07:00
YHH 507debd468 Merge branch 'studio' into feat/13526-concurrency 2026-10-16 23:32:00 -07:00
YHH 4e57ca2009 Merge branch 'studio' into feat/0b-dispatch 2026-10-16 23:31:56 -07:00
esengine 99ec610785 test(studio): every way a hub is built has to put a kernel frame into the pane 2026-10-16 23:28:26 -07:00
YHH f19d2fc208 Merge pull request #13545 from esengine/a5/ds-search
feat(search): web_search can answer from the user's own SearXNG, through an ordered backend chain
2026-10-16 23:27:12 -07:00
esengine faa5520f45 docs(release): shorten the open-wait note 2026-10-16 23:26:46 -07:00
esengine 9ab3feecde docs(release): note for the shared-stream open wait 2026-10-16 23:26:28 -07:00
esengine b6e34eb144 fix(studio): panes read their own event streams when the shared one never opens 2026-10-16 23:25:50 -07:00
YHH 801f53bf46 Merge pull request #13555 from esengine/feat/13526-workspaces
feat(desktop): the sidebar remembers as many projects as you open; desktop.max_workspaces is your own limit
2026-10-16 23:22:43 -07:00
YHH 28fc37a14a Merge pull request #13557 from esengine/fix/13539-side-panel-anchor
fix(desktop): the side-conversation panel opens above the composer, inside its pane
2026-10-16 23:22:35 -07:00
YHH a51bb50d07 Merge pull request #13559 from esengine/fix/project-mcp-tests-share-cache
test(boot): run the three tests that share the docs-helper cache entry one after another
2026-10-16 23:19:54 -07:00
YHH 91aa427a7c Merge pull request #13562 from tongsailong/fix/web-remote-mux
fix(web): preserve live remote updates with older Studio kernels
2026-10-16 23:15:16 -07:00
阿稳 b543d8629e fix(web): keep remote event streams compatible with older kernels
Hosted Web enables the multiplexed event stream for every pane, but a
Studio kernel without GET /events/mux answers it with the SPA shell. The
mux client waits for the stream's open frame to name its connection, so
no pane ever subscribed and none fell back to its own stream: the page
kept loading and stopped receiving events until a reload rebuilt it from
a snapshot.

RemoteEventSource is a polled stand-in that cannot carry that protocol,
so a hub reached over the relay now reads each pane's own /events. A
local hub keeps the shared stream.

The event contract is unchanged: attach, resume, cursor, watermark and
the pending-prompt attach all keep the code paths PR #13499 fixed.
2026-10-17 14:02:37 +08:00
esengine 7f5cdad445 test(boot): run the three tests that share the docs-helper cache entry one after another 2026-10-16 22:37:53 -07:00
SivanCola f18883380c fix(attachments): retain rooted storage ownership through upload cleanup
Problem: CodeQL reports uncontrolled paths in streamed upload cleanup and
attachment creation. A replaced storage directory can redirect failed-upload
cleanup to an external same-name file; a linked .reasonix parent can escape too.

Root cause: filename validation and path-based writes/removals do not preserve
directory identity across filesystem changes during I/O.

Fix: use os.Root for workspace-contained directory/file creation, share an owned
file lifecycle between streamed and legacy byte writes, and retain the directory
handle for failure cleanup. Publish the existing untracked marker atomically
through the same rooted directory rather than reopening its pathname.

Verification: full control/serve/fileutil suites, focused race tests, vet,
pinned linter and repolint passed. Native Windows 11 ARM64 regressions passed
with directory junctions and protected cleanup, plus large bounded streaming.
The independent replay test failure also reproduces with the PR's Go changes
removed through a base-source overlay; no replay behavior or CI gate is changed.
2026-10-17 13:08:06 +08:00
YHH 2b3b7c4d0c Merge pull request #13554 from esengine/docs/studio-2.43.0-notes-2
docs(release): fold the remaining fragments into the studio 2.43.0 notes
2026-10-16 21:55:15 -07:00
YHH 2d21bbc582 Merge pull request #13553 from esengine/fix/gitcmd-expired-ctx
fix(gitcmd): a git stopped by the deadline is the context's error, not a refusal of the folder
2026-10-16 21:52:58 -07:00
esengine a49133cc46 fix(desktop): the side button draws its own panel into the composer and takes the focus back 2026-10-16 21:50:26 -07:00
esengine a481f2d0b1 fix(desktop): the side-conversation panel opens above the composer, inside its pane 2026-10-16 21:45:42 -07:00
esengine 63618012a3 feat(desktop): the sidebar remembers as many projects as you open; desktop.max_workspaces is your own limit 2026-10-16 21:39:16 -07:00
esengine 83437904bb docs(release): fold the remaining fragments into the studio 2.43.0 notes
Fold the fragments merged after the first notes commit into 2.43.0.md and remove every consumed fragment, so the release commit leaves release-notes/studio/unreleased empty.
2026-10-16 21:38:42 -07:00
esengine ebe180c771 review: refuse names that cannot be public before a URL goes to DeepSeek; say the query string is sent as written 2026-10-16 21:34:57 -07:00
esengine 9fb2bbb542 review: refuse names that cannot be public before a URL goes to DeepSeek; say the query string is sent as written 2026-10-16 21:33:48 -07:00
esengine ccb2a7ad64 fix(gitcmd): a git stopped by the deadline is the context's error, not a refusal of the folder 2026-10-16 21:32:13 -07:00
esengine 1dffc620bb Merge remote-tracking branch 'origin/studio' into feat/peer-threads
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/perf/harness.tsx
#	desktop/frontend-next/src/main.tsx
2026-10-16 21:28:53 -07:00
esengine 38c0e02514 refactor(desktop): the first-run read leaves App so the file stays inside its budget 2026-10-16 21:28:41 -07:00
esengine db06675c87 feat(delegation): sub-agent concurrency and parallel writers default to no limit; depth keeps a named stop at 8 2026-10-16 21:21:30 -07:00
esengine 955040469a feat(desktop): an icon on each session this one has written to, saying where the exchange stands 2026-10-16 21:20:53 -07:00
YHH 97c9c5b24e Merge pull request #13536 from esengine/fix/13467-gate-stops-readiness
fix(control): a recorded await_user ends the readiness rounds the host would start
2026-10-16 21:16:41 -07:00
YHH d74c6bec95 Merge pull request #13502 from esengine/feat/13478-await-auto
feat(control): continue a task list handed back to the user once the ask timeout passes unanswered
2026-10-16 21:14:47 -07:00
YHH 639b852ed1 Merge pull request #13537 from esengine/feat/mux-page
feat(studio): carry every local pane on the hub's one multiplexed event stream
2026-10-16 21:14:28 -07:00
YHH 55b61653ef Merge pull request #13546 from esengine/feat/card-grammar-all
feat(desktop): card grammar slices 3–5 and the one-row brand lockup
2026-10-16 21:14:27 -07:00
YHH e997e19599 Merge pull request #13535 from esengine/fix/lease-wait-flake
test(workspacelease): wait for the first wait report instead of a fixed deadline
2026-10-16 21:10:46 -07:00
esengine 427d1a24b4 feat(peers): where each hand-off stands: waiting, working, replied or declined 2026-10-16 21:06:21 -07:00
esengine 16d82778ff feat(fetch): DeepSeek Fetch API as a paid fallback for web_fetch, behind the billing-consent card 2026-10-16 21:05:11 -07:00
esengine 88260228ad Merge origin/studio into feat/mux-page
Resolved by taking the page commit as applied on top of studio, where the
stream budget it builds on already landed under a different commit.
2026-10-16 20:57:50 -07:00
YHH c13c7fde60 Merge branch 'studio' into fix/lease-wait-flake 2026-10-16 20:56:10 -07:00
YHH 436726ef56 Merge branch 'studio' into fix/13467-gate-stops-readiness 2026-10-16 20:56:07 -07:00
YHH 52a10d8793 Merge branch 'studio' into feat/13478-await-auto 2026-10-16 20:56:03 -07:00
YHH 880a9e0b94 Merge branch 'studio' into feat/card-grammar-all 2026-10-16 20:55:58 -07:00
esengine a317b0998e feat(peers): a model tool that hands a task to a session in another project, default off 2026-10-16 20:54:32 -07:00
YHH 58e94afbf3 Merge pull request #13542 from esengine/test/replay-wait-for-log
test(serve): wait for the ask to reach the log before asserting what a resume replays
2026-10-16 20:53:33 -07:00
esengine f61017127a review: snippet cut test, cap rationale, privacy note for always allow 2026-10-16 20:49:30 -07:00
esengine 49c08b17c7 feat(search): DeepSeek Search API as a paid fallback behind a billing-consent card 2026-10-16 20:43:48 -07:00
SivanCola fc65229584 test(studio): validate Windows intake and document streaming bounds
Problem: Review requested a user-visible release fragment and clearer memory
bounds. The live regression also assumed new-session activation must create
a second runtime, which is false when an existing blank pane is reused.

Root cause: A workspace may already own a reusable blank pane, particularly
when native Windows roots have matching canonical spelling. The old setup
waited for a POST and a new pane identity instead of editor readiness.

Fix: Wait for boot completion at a stable viewport, allow a blank-pane reuse,
and preserve assertions for the captured workspace, one shared intake route,
saved upload size and four ready attachments. Allow an explicit test host
binary. Add bilingual release notes and state that memory, not total disk
consumption, is bounded by streaming.

Verification: Windows 11 ARM64 control, stream, HTTP upload/image-limit and
exact-file read-tool regressions passed. Electron 44.2.0 exercised picker,
paste and drop of a 111 MiB file and a 65 MiB streamed File with four ready
attachments. Release-note tests, repository checks and script syntax passed.
2026-10-17 11:42:29 +08:00
YHH dbb6ded60a Merge pull request #13483 from esengine/fix/history-search-test-race
test(history): close the shared catalog before resetting it in the session-search test
2026-10-16 20:42:07 -07:00
esengine 5304594bb0 Merge remote-tracking branch 'origin/studio' into feat/card-grammar-all 2026-10-16 20:39:11 -07:00
YHH cd81a8aea4 Merge branch 'studio' into fix/13467-gate-stops-readiness 2026-10-16 20:38:34 -07:00
YHH b6b6001e06 Merge branch 'studio' into feat/13478-await-auto 2026-10-16 20:38:29 -07:00
YHH 4e4597c630 Merge branch 'studio' into test/replay-wait-for-log 2026-10-16 20:38:25 -07:00
esengine 31370255fb test(studio): the card shell guard counts four cards now that a remembered fact is a row 2026-10-16 20:38:20 -07:00
YHH 7d870bdef3 Merge pull request #13533 from esengine/a5/busy-mux
feat(serve): carry every local pane on one multiplexed event stream
2026-10-16 20:36:39 -07:00
YHH 370b5a252c Merge pull request #13534 from esengine/fix/mcp-add-persists-schema
fix(plugin): a server connected by hand leaves its handshake in the cache
2026-10-16 20:34:00 -07:00
esengine 4c6ea3b000 docs(release): one fragment for the card grammar slices and the brand lockup 2026-10-16 20:31:08 -07:00
esengine c23b749298 Merge remote-tracking branch 'origin/feat/brand-lockup-badge' into feat/card-grammar-all
# Conflicts:
#	.github/workflows/studio.yml
2026-10-16 20:30:58 -07:00
esengine c37f2656d8 Merge remote-tracking branch 'origin/feat/card-grammar-slice5' into feat/card-grammar-all
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
2026-10-16 20:30:58 -07:00
esengine 1cb9b4300c Merge remote-tracking branch 'origin/feat/card-grammar-slice4' into feat/card-grammar-all
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
2026-10-16 20:30:57 -07:00
esengine 1f424fbff0 Merge remote-tracking branch 'origin/feat/card-grammar-slice3' into feat/card-grammar-all
# Conflicts:
#	.github/workflows/studio.yml
2026-10-16 20:30:57 -07:00
SivanCola 6f1e59b750 test(studio): certify upload cancellation signal listeners
Problem: The full frontend suite rejects the upload abort listener as an
unresolved interaction registration.

Root cause: The syntax-based census does not infer a Request.signal member's
AbortSignal type and cannot distinguish it from a possible user-input target.

Fix: Keep an explicitly typed upload signal and teach the shared receiver
certifier to recognize scoped AbortSignal bindings. Preserve unresolved
receivers and refuse borrowing an outer signal type across shadowing.
Do not add a file exception or raise any census or lint ceiling.

Verification: Abort receiver, actions census, cloud upload and attachment
regressions, frontend typecheck, production build and repository checks pass.
2026-10-17 11:15:10 +08:00
esengine 3ae1b7baef fix(i18n): English wording for the search backend notices 2026-10-16 20:11:48 -07:00
esengine 0d68e0a986 feat(search): web_search can answer from the user's own SearXNG, through an ordered backend chain 2026-10-16 20:11:48 -07:00
YHH 19640573dc Merge pull request #13516 from esengine/feat/13458-task-description
feat(tools): bash takes an optional description that names a background job
2026-10-16 20:09:12 -07:00
SivanCola 7f53665cd0 fix(studio): reference native files and stream attachment uploads
Problem: Large ordinary file attachments cause avoidable whole-file
allocations and exceed the legacy JSON attachment transport limits.

Root cause: Picker and paste intake Base64-encode files even when the shell
already knows their native paths. Pathless uploads also pass through JSON.

Fix: Share native path references across picker, paste and drop. Stream raw
ordinary-file bodies to bounded disk writes and clean up failed or cancelled
uploads. Grant external-file access only to the selected file. Preserve
image, legacy JSON and cloud relay limits; bound cloud intake before
materializing an oversized body. Document the transport and live regression.

Verification: Owning Go package suites, focused race tests, go vet, lint,
repository checks, frontend typecheck, production build and attachment
regressions passed on the original tested baseline. Real macOS Electron
exercised native picker, paste and drop with a 111 MiB file and an exact
65 MiB pathless upload. Windows native runtime verification remains open.
2026-10-17 11:08:58 +08:00
esengine 79e0e9e73d fix(plugin): a server connected by hand leaves its handshake in the cache 2026-10-16 20:08:11 -07:00
esengine ec014ebd0a Merge remote-tracking branch 'origin/studio' into feat/brand-lockup-badge
# Conflicts:
#	.github/workflows/studio.yml
2026-10-16 20:05:02 -07:00
esengine 2b103885e8 Merge remote-tracking branch 'origin/studio' into feat/card-grammar-slice5
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
2026-10-16 20:04:26 -07:00
esengine b46a1e11ec Merge remote-tracking branch 'origin/studio' into feat/card-grammar-slice4
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/perf/harness.tsx
#	desktop/frontend-next/src/main.tsx
#	desktop/frontend-next/src/styles/LAYOUT.md
2026-10-16 20:03:37 -07:00
esengine 3306732c50 Merge origin/studio into a5/busy-mux 2026-10-16 20:03:09 -07:00
esengine ca2da5c53a Merge remote-tracking branch 'origin/studio' into feat/card-grammar-slice3
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
2026-10-16 20:02:28 -07:00
esengine b5d3c529f2 test(serve): wait for the ask to reach the log before asserting what a resume replays 2026-10-16 19:56:37 -07:00
YHH 0cac9ae4b9 Merge pull request #13518 from esengine/perf/13176-cold-list
perf(sessionstore): read the sidecars of a cold session folder on a bounded pool
2026-10-16 19:47:43 -07:00
esengine e5d3291c03 fix(jobs): bound the model-written description for display 2026-10-16 19:38:28 -07:00
YHH 03f9c22072 Merge pull request #13538 from esengine/fix/tidy-perf-guards
test(studio): the receipt card guard turns the card on, and the reask probe draft goes
2026-10-16 19:36:25 -07:00
esengine dbfaf19aae Merge remote-tracking branch 'origin/studio' into feat/13458-task-description
# Conflicts:
#	.github/workflows/studio.yml
2026-10-16 19:28:52 -07:00
esengine f375354301 chore(studio): drop the committed perf build output and ignore every dist-perf directory 2026-10-16 19:28:47 -07:00
YHH 6fbeb4ce21 Merge pull request #13499 from tongsailong/fix/v2.42.0-dev
fix(web): hand pending prompts to late clients and stop false stale reports
2026-10-16 19:22:57 -07:00
esengine dfb0ff4bc4 test(studio): the receipt card guard turns the card on, and the reask probe draft goes 2026-10-16 19:16:19 -07:00
esengine 1f5aa55677 fix(control): a recorded await_user ends the readiness rounds the host would start 2026-10-16 19:14:39 -07:00
esengine 21200e3312 test(workspacelease): wait for the first wait report instead of a fixed deadline 2026-10-16 19:07:58 -07:00
YHH 3dcc52b6d2 Merge pull request #13529 from esengine/feat/13526-side-unlimited
feat(side): no cap on open side conversations; agent.max_side_sessions is the user's own limit
2026-10-16 19:07:37 -07:00
YHH 872ed93d49 Merge branch 'studio' into perf/13176-cold-list 2026-10-16 19:07:05 -07:00
YHH 574723954c Merge branch 'studio' into fix/history-search-test-race 2026-10-16 19:07:01 -07:00
YHH f5e9b01e91 Merge pull request #13496 from esengine/feat/card-grammar-slice2
feat(desktop): draw host notices as a one-line bar, severity in the glyph ink only
2026-10-16 19:05:43 -07:00
esengine 477ce369bb feat(studio): carry every local pane on the hub's one multiplexed event stream 2026-10-16 19:05:41 -07:00
esengine f46ac4f856 feat(control): continue a task list handed back to the user once the ask timeout passes unanswered 2026-10-16 19:05:39 -07:00
esengine 0d64b3ec14 fix(desktop): only a few panes hold a live event stream, the rest resume from their cursor 2026-10-16 19:02:00 -07:00
YHH 4aae38f890 Merge pull request #13522 from esengine/fix/peers-body-read
fix(peers): reduce a hand-written message body where the spool is read
2026-10-16 18:57:36 -07:00
YHH 1778e4cc43 Merge pull request #13520 from esengine/fix/peers-read-side-names
fix(peers): reduce the names in another session's record where they are read
2026-10-16 18:54:12 -07:00
esengine 6a2e9af854 test(serve): a retired mux subscription leaves no goroutine behind 2026-10-16 18:53:17 -07:00
esengine 5e5996d059 Merge remote-tracking branch 'origin/studio' into feat/brand-lockup-badge 2026-10-16 18:49:52 -07:00
esengine f1a5b77c80 Merge remote-tracking branch 'origin/studio' into feat/card-grammar-slice5
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
2026-10-16 18:49:20 -07:00
YHH 6397a75614 Merge pull request #13531 from esengine/fix/13491-stream-limit
fix(desktop): only a few panes hold a live event stream, the rest resume from their cursor
2026-10-16 18:49:09 -07:00
esengine 7ad1771a91 feat(desktop): say what a shipped report is on the feedback level card
The card showed "已落地 N 条" without saying what counts. One muted line
under the progress bar now states it.
2026-10-16 18:48:35 -07:00
esengine 07705bb0d1 Merge studio into feat/card-grammar-slice4
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
#	desktop/frontend-next/src/ui/cards/RememberCard.tsx
2026-10-16 18:46:19 -07:00
esengine 618807518b Merge studio into feat/card-grammar-slice3
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
2026-10-16 18:45:16 -07:00
esengine 95936b5167 feat(serve): carry every local pane on one multiplexed event stream
A window that gives each pane its own EventSource spends one HTTP/1.1 connection per pane, and a browser origin holds six, so the sixth stream starves every stop, submit and read behind it. GET /events/mux is one stream for all panes of a window; PUT/DELETE /events/mux/{conn}/panes/{id} subscribe a pane with its own cursor. /events and /events/replay are unchanged.
2026-10-16 18:44:09 -07:00
esengine 84199bf82d Merge studio into feat/card-grammar-slice2
# Conflicts:
#	.github/workflows/studio.yml
#	desktop/frontend-next/src/styles/LAYOUT.md
#	desktop/frontend-next/src/ui/cards/NoticeCard.tsx
2026-10-16 18:42:12 -07:00
YHH d40dc23eab Merge pull request #13504 from esengine/feat/13478-egress-open
feat(sandbox): a user setting that stops the egress question for hosts outside allowed_domains
2026-10-16 18:35:20 -07:00
esengine 450243769c fix(desktop): only a few panes hold a live event stream, the rest resume from their cursor 2026-10-16 18:34:32 -07:00
esengine 63a4755b12 feat(side): no cap on open side conversations; agent.max_side_sessions is the user's own limit 2026-10-16 18:27:07 -07:00
esengine b13f478809 feat(sandbox): a user setting that stops the egress question for hosts outside allowed_domains 2026-10-16 18:25:27 -07:00
YHH bcf0f3f5cb Merge pull request #13515 from esengine/perf/13176-tree-versions
perf(serve): the sidebar tree no longer resolves or opens every session on each refresh
2026-10-16 18:24:27 -07:00
YHH 4296a8365b Merge pull request #13524 from esengine/fix/13472-chevron-risk-colour
fix(desktop): colour the permission picker's chevron and icon like its label
2026-10-16 18:11:01 -07:00
YHH f8747c5abd Merge pull request #13521 from esengine/fix/13345-storage-shared-root
fix(storage): do not credit a root with the entries a neighbour declares
2026-10-16 18:04:56 -07:00
esengine bc89385120 fix(desktop): colour the permission picker's chevron and icon like its label
In the risk state the chevron kept its grey and, in the light theme, the
warning icon used a lighter orange than the label.
2026-10-16 17:56:56 -07:00
esengine 20eb088e61 fix(peers): reduce a hand-written message body where the spool is read 2026-10-16 17:53:33 -07:00
YHH d596bf63c2 Merge pull request #13517 from esengine/fix/13513-idle-cost-placeholder
fix(desktop): show no session cost before anything has been priced
2026-10-16 17:52:36 -07:00
阿稳 6560ae0c62 fix(web): keep the tree stream's attach asking past the watermark
RemoteEventSource now leaves the attach cursor empty so the kernel hands a late client the pending prompt. The tree stream shares that class but reads the tree rather than history, so an empty attach for it re-read the tree on every poll and failed tree_events.test.ts. The attach query is now chosen once from the path: the main stream attaches with no cursor, the tree attaches past the watermark as it always did.

Verified with the whole frontend suite: typecheck, 5139 tests, census, census:verify, build, and no fixtures in the bundle.
2026-10-17 08:50:48 +08:00
esengine 42dbb39367 fix(storage): do not credit a root with the entries a neighbour declares
Home declares no entries, so the survey treated it as sole occupant of its
directory and counted the sessions and archive that state declares in the
same folder (one folder on a default Windows install).
2026-10-16 17:50:24 -07:00
esengine e122025906 feat(desktop): the sidebar brand is one row, wordmark and a bordered badge 2026-10-16 17:49:07 -07:00
esengine 052a7424b4 fix(peers): reduce the names in another session's record where they are read 2026-10-16 17:48:05 -07:00
YHH 6767b6baff Merge pull request #13514 from esengine/docs/studio-2.43.0-notes
docs(release): studio 2.43.0 notes
2026-10-16 17:43:42 -07:00
esengine bbe3163ad8 perf(sessionstore): read the sidecars of a cold session folder on a bounded pool 2026-10-16 17:43:16 -07:00
esengine 65e973a63d fix(desktop): show no session cost before anything has been priced
The cost chip drew a literal "¥" default, so a fresh session read
"本轮 ¥0.00" in a currency nothing had priced, whatever the display
currency was. Leave it out until the first priced round or restored total.
2026-10-16 17:39:34 -07:00
esengine c412db874b docs(release): studio 2.43.0 notes
Gather the 67 pending fragments into release-notes/studio/2.43.0.md,
Chinese then English, and remove them.
2026-10-16 17:34:43 -07:00
esengine 9c29eace57 perf(serve): the sidebar tree no longer resolves or opens every session on each refresh 2026-10-16 17:32:09 -07:00
esengine 042c7fbe9f feat(desktop): name a background job for a person, with its full text on hover and focus 2026-10-16 17:31:39 -07:00
esengine a95d08ddb6 test(boot): regenerate the tool schema baseline for the bash description 2026-10-16 17:31:39 -07:00
esengine b73ac5f285 feat(tools): bash takes an optional description that names a background job 2026-10-16 17:31:39 -07:00
YHH 138167ec7d Merge pull request #13509 from esengine/fix/13472-policy-chevron
fix(desktop): draw the permission picker's chevron with the shared icon
2026-10-16 17:31:19 -07:00
YHH 7b7b98faec Merge pull request #13508 from esengine/feat/13478-goal-retry
feat(goal): retry a Goal paused on its completion check, within a user-set allowance
2026-10-16 17:30:08 -07:00
YHH 9cb5fbace7 Merge pull request #13506 from esengine/feat/remember-choice
feat(desktop): one remember-choice footer for approvals, with where each choice is kept
2026-10-16 17:28:43 -07:00
YHH 87d1aa19b4 Merge pull request #13507 from esengine/feat/13478-plan-approval-switch
feat(studio): a Plan approval switch in Settings
2026-10-16 17:27:51 -07:00
YHH e958985ec1 Merge pull request #13477 from esengine/fix/13023-sidebar-dup-search
fix(desktop): drop the duplicate magnifier beside the session filters
2026-10-16 17:24:38 -07:00
阿稳 e5f440d2c3 fix(web): read the attach watermark inside the prompt-snapshot lock
The polled attach took its pending-prompt snapshot under promptEmitMu but read the broadcaster watermark after that lock was released. A prompt raised in between was numbered at or below the watermark the client then adopted as its cursor, so the next resume skipped it — the original bug in a narrow window.

The watermark is now read in the same critical section as the snapshot, and before it: a prompt raised after that point is numbered above the cursor the client adopts, so the worst case is a prompt named twice rather than one lost. writeEventsReplay reads the watermark once and passes it in, instead of the writer reading it after the lock.

The shell's no-store comment is trimmed to the comment budget so the lint gate passes.
2026-10-17 08:23:07 +08:00
esengine 4c57f2293c fix(desktop): draw the permission picker's chevron with the shared icon
The picker used a 10px text glyph while every sibling picker uses the
StudioIcon down svg, so it rendered smaller and below the centre line.
2026-10-16 17:19:39 -07:00
YHH c982081998 Merge pull request #13503 from esengine/feat/13385-resource-templates
feat(mcp): let the resource tool read addresses a server's declared templates build
2026-10-16 17:14:26 -07:00
YHH 7260e9b303 Merge pull request #13505 from esengine/fix/13493-slash-hints-locale
fix(control): localize slash command argument hints
2026-10-16 17:12:02 -07:00
esengine 22cacc9001 docs(release): shorten the note 2026-10-16 17:09:22 -07:00
YHH 97bbdea635 Merge pull request #13489 from esengine/test/syntax-wrapped-differential
test(shellsafe): differential test for read-only commands wrapped in shell syntax and quoting
2026-10-16 17:06:55 -07:00
esengine 227ca9aa00 feat(goal): retry a Goal paused on its completion check, within a user-set allowance 2026-10-16 17:03:54 -07:00
esengine bc9b0a7429 feat(studio): a Plan approval switch in Settings 2026-10-16 16:49:41 -07:00
esengine 1a1f7c7834 feat(mcp): resource templates, plus a pinned test for the server+uri subject 2026-10-16 16:48:39 -07:00
esengine 1c36b1ab7d fix(control): localize slash command argument hints
The argument completion of /goal, /memory, /mcp, /skills, /plugins, /theme,
/currency, /reasoning-language, /ask-timeout and /feedback returned English
literals; read them from the i18n catalog like /language and /effort do.
2026-10-16 16:47:02 -07:00
esengine c2b66a05fa feat(desktop): one remember-choice footer for approvals, with where each choice is kept 2026-10-16 16:44:03 -07:00
YHH 656ebacea5 Merge pull request #13501 from esengine/test/view-keys-palette-timeout
test(desktop): give the palette test the same ten seconds the other lazy-chunk tests get
2026-10-16 16:36:15 -07:00
esengine febabc561a feat(mcp): the resource tool also admits addresses a declared resource template builds 2026-10-16 16:29:11 -07:00
esengine 04b43991a6 docs(release): do not imply the name filter is always visible 2026-10-16 16:27:43 -07:00
YHH 18a6ee58db Merge pull request #13495 from esengine/feat/card-grammar-slice1
feat(desktop): draw a brought-to-the-end result as the same Line as the Execution group
2026-10-16 16:25:24 -07:00
esengine 74ceafaf16 test(desktop): give the palette test the same ten seconds the other lazy-chunk tests get 2026-10-16 16:23:26 -07:00
YHH e0cd5e5d97 Merge pull request #13457 from esengine/feat/remove-timeline-line
feat(desktop): remove the timeline rail from the conversation
2026-10-16 16:23:24 -07:00
esengine c4009946fd test(desktop): drop the guard for the magnifier that is gone 2026-10-16 16:22:26 -07:00
YHH 739d22e0fe Merge pull request #13484 from esengine/fix/network-probe-codes
fix(i18n): word the network test steps from codes so the English window stays English
2026-10-16 16:19:37 -07:00
YHH f7bc5e1e16 Merge pull request #13487 from esengine/feat/13478-egress-always
feat(sandbox): offer always-allow on the egress card, writing the host to the user's allowed_domains
2026-10-16 16:19:02 -07:00
YHH 8dd7b6dee3 Merge pull request #13485 from esengine/feat/13385-mcp-resource-tool
feat(mcp): a read_mcp_resource tool for resources a server lists, off by default and user-file only
2026-10-16 16:18:05 -07:00
YHH 0d7a0aedc7 Merge pull request #13479 from esengine/feat/13478-plan-auto-approve
feat(plan): let the user's own config start a submitted plan without the approval click
2026-10-16 16:16:39 -07:00
YHH 9350f7f125 Merge pull request #13482 from esengine/fix/differential-vanishing-file
test(shellsafe): tolerate git's background maintenance in the read-only differential snapshot
2026-10-16 16:15:34 -07:00
阿稳 24ab1a0a4f Merge remote-tracking branch 'origin/studio' into fix/v2.42.0-dev 2026-10-17 07:04:54 +08:00
esengine dd1d63b3ce feat(desktop): an opened step's detail is a bordered panel, not a left rule 2026-10-16 15:54:06 -07:00
esengine 0b1c62be41 feat(desktop): a low-risk allowed guardian review and a remembered fact are rows 2026-10-16 15:29:57 -07:00
esengine ec08aa36b1 feat(desktop): one shell for the cards the reader reads or acts on 2026-10-16 14:44:21 -07:00
esengine 10472be8d4 feat(desktop): draw host notices as a one-line bar, severity in the glyph ink only 2026-10-16 13:58:00 -07:00
esengine 9400099593 feat(desktop): draw a brought-to-the-end result as the same Line as the Execution group 2026-10-16 13:26:25 -07:00
YHH 99e0c42d37 Merge pull request #13494 from esengine/fix/a11y-focus-rings
fix(a11y): keep Tab inside modal dialogs and show focus on the session delete button
2026-10-16 12:47:51 -07:00
esengine 6924986399 fix(a11y): keep Tab inside modal dialogs and show focus on the session delete button 2026-10-16 12:20:10 -07:00
YHH 4244fead38 Merge pull request #13492 from esengine/perf/pane-rerender
perf(desktop): keep hidden panes from re-rendering on a tab switch
2026-10-16 11:53:20 -07:00
esengine 288416be16 perf(desktop): keep hidden panes from re-rendering on a tab switch 2026-10-16 11:41:32 -07:00
YHH df9ac7c6bc Merge pull request #13488 from xxoingr/test/worktree-branch-checkout-crlf
test(worktree): compare a branch checkout's content, not its line ending
2026-10-16 11:24:14 -07:00
YHH 17b3541ff1 Merge pull request #13486 from xxoingr/test/plugin-legacy-cache-audit-windows
test(plugin): deny cache-dir writes through an ACL on Windows
2026-10-16 11:23:02 -07:00
xxoingr 144d2ff802 test(storage): let the state-path guard walk past an in-tree temp folder
TestEveryTopLevelStatePathIsAnOwnedEntry walks every package under
internal/ and failed the moment WalkDir could not open an entry. The
serve, control and config tests take their extra folders from their own
package directory (tempAside), so when go test runs packages in
parallel the guard can list one of those folders and find it gone a
moment later:

  open .../internal/frontend/serve/extra-3867033970: no such file or directory

The config package's state-root walk already tolerates this through
vanishedMidWalk, including the sharing-violation and access-denied
errors Windows gives for a directory being deleted. Move that helper to
testenv as VanishedMidWalk, unchanged, and use it from both walks.
2026-10-17 02:14:32 +08:00
esengine 48f0e7c207 test(shellsafe): differential test for read-only commands wrapped in shell syntax and quoting 2026-10-16 11:12:09 -07:00
xxoingr 2fd609387e test(worktree): compare a branch checkout's content, not its line ending
TestCreateFromBranchKeepsSourceAndSeparatesTasks required the checked
out README to be exactly "base\n". Git for Windows ships core.autocrlf
true in its system config, so the worktree holds "base\r\n" and the
test failed on Windows CI. Trim it as the sibling dirty-source test in
worktree_test.go already does; the check still tells the selected
base apart from the current head and the dirty source.
2026-10-17 02:01:30 +08:00
esengine 0f5fc69554 feat(sandbox): offer always-allow on the egress card, writing the host to the user's allowed_domains 2026-10-16 11:00:29 -07:00
xxoingr b4f819872f test(plugin): deny cache-dir writes through an ACL on Windows
TestAuditLegacyCacheUpgradeReportsOnlySuccess blocks the legacy-key
upgrade write by chmod-ing the cache dir to 0555. On Windows that only
sets the read-only attribute, which does not stop new files in a
directory, so the upgrade reached disk and the test failed at its own
fixture check on every Windows CI run since it landed.

Deny write to Everyone with icacls there instead, the mechanism
internal/contract/config's makeDirReadOnly already uses.
2026-10-17 01:56:49 +08:00
YHH 01d1e7cfb1 Merge pull request #13432 from imcreazy/fix/host-tool-suspension
fix(boot): keep the host tool groups out of the schema when no helper can run them
2026-10-16 10:45:46 -07:00
esengine da480c3181 feat(mcp): a read_mcp_resource tool for resources a server lists, off by default and user-file only 2026-10-16 10:39:19 -07:00
esengine 7cf009fbf0 fix(i18n): word the network test steps from codes so the English window stays English 2026-10-16 10:28:54 -07:00
YHH 1c4e89b0aa Merge pull request #13459 from SivanCola/codex/fix-studio-reference-enter
fix(studio): confirm @ references before sending / 修复目录引用回车误发送
2026-10-16 10:21:00 -07:00
YHH 566f48044c Merge pull request #13481 from esengine/test/debt-4
test(evidence): cover child evidence merge, background leases and the unreviewed baseline
2026-10-16 10:20:31 -07:00
esengine e53d5e348f test(history): close the shared catalog before resetting it in the session-search test 2026-10-16 10:19:14 -07:00
esengine 022dd7faee test(shellsafe): tolerate git's background maintenance in the read-only differential snapshot 2026-10-16 10:15:19 -07:00
YHH ee10c06d63 Merge pull request #13480 from esengine/fix/narrow-model-list-header
fix(desktop): keep the model list heading on one line at phone widths
2026-10-16 10:13:29 -07:00
esengine cab7fb6afb test(evidence): cover child evidence merge, background leases and the unreviewed baseline 2026-10-16 10:08:06 -07:00
esengine 3ff71f0882 fix(desktop): keep the model list heading on one line at phone widths 2026-10-16 09:58:51 -07:00
SivanCola 46a139b533 fix(studio): publish completion selection with candidates
Problem: Studio CI caught ArrowDown selection returning to the default row
before Enter could confirm the selected reference.

Root cause: candidates rendered before a passive effect reset selection and
keyboard ownership. That later update could overwrite navigation after the
rows had already committed.

Fix: store the completion answer, active row, and keyboard ownership in one
state value. Publish each answer with its default selection and remove the
deferred reset. Guard navigation against an answer that has become empty.

Verification: four deterministic reference/slash publication and early
navigation regressions fail on the old hook. The PR merge snapshot with this
patch passes 616 frontend files / 5,132 tests; 92 completion/composer cases
pass with --repeats 10. Typecheck, build, census and census verification,
go vet, make lint, make check, and builtin/boot tests pass. Chromium confirms
ArrowDown plus Enter accepts the selected reference and slash command.
2026-10-17 00:56:20 +08:00
esengine f3079d585d fix(i18n): English wording for the plan-approval refusals 2026-10-16 09:48:56 -07:00
esengine 82d939bf94 feat(plan): let the user's own config start a submitted plan without the approval click 2026-10-16 09:46:29 -07:00
YHH ac59488c0c Merge pull request #13474 from esengine/test/debt-3
test(evidence): cover completion adjudication and path evidence
2026-10-16 09:33:23 -07:00
esengine 6773367d05 fix(desktop): drop the duplicate magnifier beside the session filters 2026-10-16 09:30:37 -07:00
YHH 6f5e7a1a6d Merge pull request #13473 from esengine/fix/upgrade-page-name-collisions
fix(upgrade): refuse a page whose entries would land on one another
2026-10-16 09:28:26 -07:00
YHH 3260a68023 Merge pull request #13468 from esengine/feat/11376-s4-peer-tools
feat(peers): list_peers and send_peer_message tools for the model
2026-10-16 09:27:31 -07:00
SivanCola daa4cf4044 test(serve): verify exact references through the completion route
Problem: Review requested proof that production completion removes exact
reference candidates independently of the frontend MockPort fixture.

Root cause: The frontend interaction tests and the existing control unit
test did not exercise the registered GET /complete route together with its
controller data, scoped filesystem lookup, and UTF-16 boundary.

Fix: Add seven real HTTP cases using the production handler and disposable
workspace files. Cover partial paths, exact filenames, prose and emoji
prefixes, escaped nested paths, retaining a genuine longer alternative,
and an exact final alternative. No production filtering behavior changes.

Verification: The completion HTTP tests and full serve package pass, along
with go vet, make lint, make check, and the builtin/boot pre-commit suites.
Removing only the existing control.dropTyped call via a temporary Go build
overlay makes six HTTP subtests fail on the retained identity insertion;
this checks regression sensitivity and is not a production defect claim.
2026-10-17 00:24:16 +08:00
esengine 8e6aad3ee0 test(evidence): cover completion adjudication and path evidence 2026-10-16 09:22:55 -07:00
YHH 5b93b29c97 Merge pull request #13434 from imcreazy/fix/crashreport-pid-reuse
fix(crashreport): tell a recycled pid from the reader that wrote the dump
2026-10-16 09:22:46 -07:00
esengine dfd8d1a89c fix(upgrade): refuse a page whose entries would land on one another 2026-10-16 09:18:09 -07:00
esengine 47a4aad04e docs(release-notes): note for #13457 2026-10-16 09:11:28 -07:00
esengine bdaf57e287 feat(desktop): remove the timeline rail from the conversation 2026-10-16 09:11:28 -07:00
YHH 9082368925 Merge pull request #13431 from imcreazy/fix/serve-dir-flag
fix(serve): take the project root from --dir, as other verbs do
2026-10-16 09:09:05 -07:00
YHH 2dffa4d0ed Merge pull request #13465 from esengine/chore/coverage-floors
test(shellsafe): run what the classifier calls a read; uniq treats a word after its file as an output
2026-10-16 09:07:34 -07:00
YHH b148ae453d Merge pull request #13454 from esengine/feat/read-video-frames
feat(tools): read_video samples frames from a video with ffmpeg
2026-10-16 09:05:26 -07:00
esengine 95ecd55391 test(permission): pin the generic to/text subject rule 2026-10-16 08:59:15 -07:00
esengine 440fc18a62 feat(peers): list_peers and send_peer_message tools for the model (S4a of #11376) 2026-10-16 08:56:03 -07:00
YHH b806b594d0 Merge pull request #13469 from esengine/feat/12040-provider-draft
feat(providers): fold the web search, thinking and continuation switches into the connection draft
2026-10-16 08:51:01 -07:00
YHH acc368ee2a Merge pull request #13466 from esengine/fix/peer-frame-tag-casing
fix(peers): the message frame cannot be closed or reopened by a differently cased or spaced tag
2026-10-16 08:50:09 -07:00
esengine 6ca0c2cd53 fix(skill): memoize slash-list discovery for two seconds 2026-10-16 08:43:10 -07:00
imcreazy 40bd3f06b8 fix(crashreport): tell a recycled pid from the reader that wrote the dump 2026-10-16 23:28:39 +08:00
imcreazy da4bb5886d fix(boot): keep the host tool groups out of the schema when no helper can run them 2026-10-16 23:28:04 +08:00
imcreazy 063ad81319 fix(serve): take the project root from --dir, as other verbs do 2026-10-16 23:27:26 +08:00
esengine f7e19e9ee5 feat(providers): fold the web search, thinking and continuation switches into the connection draft 2026-10-16 08:23:17 -07:00
esengine a0301e55fc test(shellsafe): run the git commands the classifier calls reads against a real repository 2026-10-16 08:12:26 -07:00
esengine d02933aeaf fix(peers): the message frame cannot be closed or reopened by a differently cased or spaced tag 2026-10-16 08:07:38 -07:00
esengine 5c33fb2e06 test(shellsafe): run what the classifier calls a read; uniq treats a word after its file as an output 2026-10-16 08:04:01 -07:00
阿稳 144d1817ad Merge remote-tracking branch 'origin/studio' into fix/v2.42.0-dev
Brings the three Web fixes onto the current studio line: the hosted page's own-fetch stale check, the pending approval/ask handed to an attaching polled client, and the no-store shell.

The one conflict, internal/frontend/serve/web_entry_test.go, was both sides appending a test at the same point; both are kept.
2026-10-16 23:03:16 +08:00
esengine ff224380d2 test(shellsafe): run what the classifier calls a read; uniq treats a word after its file as an output 2026-10-16 08:03:15 -07:00
YHH c3c19e0748 Merge pull request #13273 from SivanCola/codex/13264-session-worktree
feat(studio): 会话 worktree 配置与统一聊天区菜单 / session workspace setup
2026-10-16 08:00:39 -07:00
YHH 82697031ca Merge pull request #13464 from esengine/test/control-permission-rules
test: cover permission rule saving, network settings and bash path evidence
2026-10-16 07:57:55 -07:00
SivanCola c99dcf42bf test(studio): pin exact reference Enter behavior
Problem: Review requested coverage for Enter after a manually completed
reference, including the case where another candidate is still available.

Root cause: The kernel already removes an insertion equal to the typed
token, but MockPort kept that row and manufactured an extra confirmation
step in development fixtures.

Fix: Keep MockPort's candidate filtering aligned with the kernel and add
four composer regressions. A full path with no remaining candidates sends
in one Enter. An open menu containing a genuine alternative still confirms
that alternative before submission, as required by the interaction contract.

Verification: The three exact-path cases failed against the old fixture.
All 5099 frontend tests, typecheck, build, make check, go vet, and make lint
pass. The existing kernel dropTyped regression passes. Real-browser checks
confirm single-Enter submission for exact paths at wide/light and phone/dark
sizes. The builtin and boot pre-commit suites pass.
2026-10-16 22:54:44 +08:00
YHH 76b326c602 Merge pull request #13463 from esengine/test/control-mcp-install
test(control): cover MCP install guards and import
2026-10-16 07:54:26 -07:00
esengine a691b52eb9 test: cover permission rule saving, network settings and bash path evidence 2026-10-16 07:46:29 -07:00
esengine 38f8a56f1b test(control): cover MCP install guards and import 2026-10-16 07:42:26 -07:00
YHH adc41fdd97 Merge pull request #13462 from esengine/test/safety-control-debt
test: cover the inbox edit verbs, completion reports and write inspection
2026-10-16 07:39:54 -07:00
YHH 94d1976713 Merge pull request #13461 from esengine/feat/pane-fold-notice
feat(desktop): say which session a full window folded out of the tab bar
2026-10-16 07:34:19 -07:00
YHH 95d7cb2cf6 Merge pull request #13460 from esengine/feat/11376-s3-peers-ui
feat(desktop): messages between sessions in Studio (S3 of #11376)
2026-10-16 07:33:37 -07:00
esengine 92d084515c feat(tools): read_video samples frames from a video with ffmpeg
A read-only tool that turns a video into a few time-labelled pictures for a
model that reads images. The container is named from the file's own bytes and
ffmpeg is forced to it with file-only protocols; failures carry typed codes.
It is reached through use_capability and stays out of the schema prefix (#13399).
2026-10-16 07:31:37 -07:00
esengine f33caaca90 test: cover the inbox edit verbs, completion reports and write inspection 2026-10-16 07:28:32 -07:00
阿稳 8d49317e5d fix(web): hand pending prompts to late clients and stop false stale reports
The polled transport attached past the watermark and dropped what came back, so a page opened after a prompt was raised never saw the approval or ask the run was waiting on. An attach now carries the pending prompt to that client alone, and the client reads the frames it is sent.

A hosted page checked for a newer build through the global fetch, which remoteHub has already replaced with a tunnel to the kernel; it compared its own build against the kernel's and reported itself behind forever. The check now reads through the page's own fetch, bound before the swap.

The shell names which build is current and was served with no cache policy, so a reused copy left an open page behind and reloading landed on that same copy. It is now served no-store; the content-hashed bundles under /assets keep their long cache.
2026-10-16 22:22:53 +08:00
YHH 3765035e3d Merge pull request #13455 from esengine/feat/shellsafe-git-readonly
feat(shellsafe): classify read-only git listings as reads
2026-10-16 07:22:10 -07:00
esengine f82277b80d feat(desktop): say which session a full window folded out of the tab bar
With an open-session limit set, opening one more session reuses or closes an
idle pane. A calm note now names the conversation, the limit, and that it is
still in the list; a note is a toast tone with no report button (#13419).
2026-10-16 07:17:56 -07:00
esengine db902db79d refactor(desktop): session-coordination settings groups in their own component 2026-10-16 07:16:11 -07:00
SivanCola f5b06287a1 fix(studio): confirm reference completion before sending
Problem: Pressing Enter while an @ file or directory candidate was visible
could submit an unfinished prompt instead of confirming the reference.

Root cause: The menu highlighted its first item but only owned Enter after
explicit navigation. Directory acceptance also shared the descent path.

Fix: Let the visible selection own Enter and distinguish confirmation from
Tab descent. Finish accepted references with a separator, preserve existing
whitespace and trailing text, and clear the old completion before drafting
continues. Update both locale hints.

Verification: Twelve new composer regressions reproduce the old behavior
and cover files, directories, nested Tab descent, pointer acceptance,
escaped paths, send preferences, Shift keys, IME, and Escape. The full
frontend suite passes (609 files, 5095 tests), alongside typecheck, build,
UI census, make check, go vet, and make lint. Browser interaction was
verified with the local MockPort workspace.
2026-10-16 22:14:53 +08:00
esengine ae30efbfca feat(desktop): messages between sessions in Studio (S3 of #11376) 2026-10-16 07:13:42 -07:00
esengine 23eafa84f5 fix(shellsafe): git config reads one key and never a credential; remote show needs -n 2026-10-16 06:55:36 -07:00
esengine 07a5c0d8d3 feat(shellsafe): classify read-only git listings as reads 2026-10-16 06:38:49 -07:00
YHH 1fbb650324 Merge pull request #13450 from esengine/feat/shellsafe-gh-readonly
feat(shellsafe): classify read-only gh calls as reads
2026-10-16 06:20:23 -07:00
YHH e3be160d52 Merge branch 'studio' into feat/shellsafe-gh-readonly 2026-10-16 06:04:38 -07:00
YHH eaff7c8ae2 Merge pull request #13430 from esengine/feat/11376-s2-peer-send
feat(peers): send messages to another session, /peer and HTTP verbs
2026-10-16 05:59:00 -07:00
YHH 7f37c01a91 Merge pull request #13445 from esengine/feat/tool-result-to-end
feat(desktop): bring a tool call's result to the end of the transcript
2026-10-16 05:56:04 -07:00
esengine 7a41081c4f feat(desktop): bring a tool call's result to the end of the transcript
A button on a finished tool card repeats that call's own recorded card in a
section at the end of the transcript, as a view only: nothing is stored or
sent, and the original stays where it happened (#13394).
2026-10-16 05:44:38 -07:00
esengine 7dace9cfb0 Merge studio into feat/11376-s2-peer-send 2026-10-16 05:43:03 -07:00
YHH a4cf9d0591 Merge pull request #13437 from chuiwenwei/fix/sessionstore-unreadable-sidecar-not-absent
fix(sessionstore): an unreadable sidecar is not an absent one
2026-10-16 05:40:45 -07:00
YHH 4c549631c5 Merge pull request #13448 from esengine/fix/e2ebench-windows-stubs
test(e2ebench): skip the shell-stub tests on Windows
2026-10-16 05:39:31 -07:00
esengine 42a1d24662 fix(shellsafe): a gh filter that loads jq modules is not a read 2026-10-16 05:39:12 -07:00
esengine 783fef7409 fix(shellsafe): a gh filter that can reach the process environment is not a read 2026-10-16 05:36:44 -07:00
esengine f5116c49fa docs(release-notes): shorten the note for #13450 2026-10-16 05:33:11 -07:00
esengine 423c906b25 docs(release-notes): note for #13450 2026-10-16 05:32:48 -07:00
esengine 82e8118db2 feat(shellsafe): classify read-only gh calls as reads 2026-10-16 05:31:41 -07:00
esengine 0836d7a2c6 test(e2ebench): skip the shell-stub tests on Windows 2026-10-16 05:18:27 -07:00
Will 6ac611bdf1 fix(sessioninbox): the lock-free read may not adopt another run's queue
The transaction-free fallback loaded the disk manifest without the RunID
isolation the locked path applies, so a queue another run (or a previous run)
left behind could be dispatched while the lock was momentarily unavailable.
Refuse a foreign manifest with ErrForeignRun, which the dispatcher already maps
to a retry, and give the frontend a coded refusal for it.
2026-10-16 20:16:21 +08:00
YHH 06a4b4622a Merge pull request #13447 from esengine/fix/13441-notice-english
fix(i18n): give the fifteen untranslated notices English and guard the table
2026-10-16 05:13:39 -07:00
YHH 1a1b953233 Merge pull request #13443 from esengine/fix/provider-key-origin
fix(providers): a draft address on another origin never borrows the saved key
2026-10-16 05:01:43 -07:00
YHH 7c406be221 Merge pull request #13440 from esengine/fix/import-keeps-source-titles
fix(sessionstore): an imported 1.x conversation keeps the title 1.x showed
2026-10-16 04:59:11 -07:00
esengine b456bd34e1 fix(i18n): give the fifteen untranslated notices English and guard the table 2026-10-16 04:57:09 -07:00
YHH b7b7687e17 Merge pull request #13442 from esengine/fix/13433-host-exit-keeps-reason
fix(host): a failing exit keeps its crash file with the code and the reason
2026-10-16 04:47:16 -07:00
esengine 7eeebe89be fix(peers): a sent message carries no process writer id, which can exceed the id limit 2026-10-16 04:42:45 -07:00
YHH c929e444b9 Merge pull request #13427 from chuiwenwei/fix/plugin-cache-upgrade-not-silently-unpersisted
fix(plugin): a legacy cache upgrade is not claimed unless it reached disk
2026-10-16 04:40:09 -07:00
YHH 6b383ad920 Merge pull request #13423 from esengine/feat/cli-ships-page
feat(release): the CLI archives carry the web page
2026-10-16 04:38:19 -07:00
YHH 8cb8af0c14 Merge pull request #13428 from chuiwenwei/fix/e2ebench-unmeasured-run-not-accounted
fix(e2ebench): report a suite run whose metrics never landed as unmeasured
2026-10-16 04:38:17 -07:00
esengine 8cf0b5e94f fix(host): a failing exit keeps its crash file with the code and the reason 2026-10-16 04:36:41 -07:00
esengine c0aad054f4 fix(providers): a draft address on another origin never borrows the saved key 2026-10-16 04:33:13 -07:00
YHH d952d8c7fd Merge pull request #13426 from chuiwenwei/fix/sessionstore-unreadable-checkpoint-blocks-rewrite
fix(sessionstore): refuse a degraded rewrite when the checkpoint cannot be read
2026-10-16 04:32:46 -07:00
YHH 1e312b66d8 Merge pull request #13425 from chuiwenwei/fix/stats-flush-reports-write-failure
fix(stats): Flush reports the first append that failed
2026-10-16 04:32:12 -07:00
esengine eb384283d1 fix(sessionstore): an imported 1.x conversation keeps the title 1.x showed 2026-10-16 04:29:55 -07:00
Will 457c68e30d fix(sessioninbox): surface a queue read failure instead of an empty one
NextQueued returns (InboxItemMeta, bool, error) and, when the disk
transaction is unavailable, reads the published manifest without the lock
(commits land by atomic rename, so that snapshot is complete). The
dispatcher maps a read error to inboxDispatchRetry instead of reporting
the inbox idle.

Narrowed per review: the permanent 1s long stop (armInboxDispatchLongStop,
its constant, its arming and its stop/reset wiring) is removed, so the
retry schedule past the existing bounded burst is exactly what it was
before this branch. The dispatcher audit case is rewritten to assert the
in-scope contract - a failed queue read schedules a retry and does not
report idle, and the durable item survives - rather than delivery after
the burst was exhausted, which was the removed policy.
2026-10-16 19:29:33 +08:00
YHH 5829f2a1c5 Merge pull request #13422 from esengine/feat/upgrade-refreshes-page
feat(cli): upgrade keeps the page beside the binary in step with the kernel
2026-10-16 04:25:52 -07:00
Will 71c7cacf55 fix(sessioninbox): report a queue that could not be read instead of an empty one
NextQueued discarded beginDiskTransactionLocked's error and answered from
the in-memory snapshot, so a transaction that could not run — another
process holding the lock, EACCES, ENOSPC, a transient EIO — looked exactly
like an empty queue. dispatchInboxOnce read that as inboxDispatchIdle and
stopped with the durable item still queued, permanently.

NextQueued now reports that failure as an error, and before it will claim
the queue is empty it falls back to reading the published manifest without
the transaction: commits land by atomic rename, so that snapshot is
complete, and repair work stays behind the lock. A genuinely empty or
paused queue is still idle.

The bounded burst (three attempts, ~750ms) used to abandon work its own
scans had seen. Past the burst the dispatcher now parks on a slow
production timer that keeps re-checking until the item advances or the
queue reads empty; reset and Close cancel the pending timer.

A read error maps to inboxDispatchRetry, so an unreadable queue retries
instead of ending dispatch.
2026-10-16 19:07:03 +08:00
esengine 8370d9cf45 feat(peers): send messages to another session, /peer and HTTP verbs (S2 of #11376) 2026-10-16 04:05:54 -07:00
esengine bfba90b356 feat(cli): upgrade keeps the page beside the binary in step with the kernel
When an install already has frontend-next/dist beside the binary, upgrade
reads the page out of the verified archive, validates it in memory, swaps it
in before the binary and puts it back if the binary does not land (#13406).
2026-10-16 04:04:18 -07:00
Will 2a3756b9e5 fix(sessionstore): an unreadable sidecar is not an absent one
ListSessionOrder keeps a row whose branch-meta sidecar cannot be read, so one
broken sibling cannot hide a folder, but every column of that row is then a zero
value. recoveryArchiveLineage consumed that row as 'not a recovery copy of this
conversation' and SetSessionLineageArchived reported success while a copy of the
row stayed active and listed on its own. The lineage walk now reads each listing
row's sidecar itself and refuses the transaction, so the archive endpoint
reports the read failure instead of a partial success.

ListBranches dropped a branch whose sidecar could not be decoded while a missing
sidecar built defaults and kept it; interruptedTurnContinuedOnRecoveryBranch
read that absence as 'the turn did not continue on a recovery branch' and
stripped the interrupted turn's messages. An unreadable sidecar is now handled
exactly like a missing one.
2026-10-16 19:00:23 +08:00
YHH 95c4c6da28 Merge pull request #13419 from esengine/feat/tab-limit-setting
feat(studio): a setting for how many session tabs stay open before one is folded away
2026-10-16 03:59:44 -07:00
YHH cc66ec38d3 Merge pull request #13418 from esengine/feat/nav-to-top-bar
feat(desktop): move the pane views to the window bar and drop the view strip
2026-10-16 03:58:34 -07:00
YHH 5d4676a277 Merge pull request #13416 from esengine/fix/13254-status-running-excludes-finishing
fix(control): report a turn as running only while it executes, not while its TurnDone is delivered
2026-10-16 03:57:58 -07:00
YHH 93c13cf4e7 Merge pull request #13424 from esengine/fix/linux-folder-panel
fix(desktop): a Linux folder panel that cannot be drawn asks for the path instead of doing nothing
2026-10-16 03:51:57 -07:00
SivanCola 3687254d05 docs(studio): describe narrow composer focus behaviour
Problem: release notes did not mention the focus behaviour shared by all
narrow composer toolbars, making the compact empty state look accidental.

Root cause: the behaviour and pointer stability rationale were documented
only in the internal style contract.

Fix: add matching Chinese and English release-note entries explaining that
empty narrow toolbars remain compact on focus and expand for draft text,
attachments or an open menu, keeping pointer clicks on the same button.

Verification: 12 release-note rendering and Markdown reference tests passed;
make check and git diff --check passed. Documentation-only change.
2026-10-16 18:50:20 +08:00
YHH 7180fc96fc Merge pull request #13420 from esengine/fix/findpage-symlinked-exe
fix(serve): find the page beside the real executable of a link
2026-10-16 03:40:41 -07:00
esengine 3959932434 feat(release): the CLI archives carry the web page
The cli job builds the page once and packs it beside the executable under
frontend-next/dist, where serve.FindPage looks, through a packer and a checker
that are run by the job and by tests (#13406).
2026-10-16 03:39:02 -07:00
esengine bee7a23b66 fix(desktop): a Linux folder panel that cannot be drawn asks for the path instead of doing nothing 2026-10-16 03:38:01 -07:00
esengine cb195c983d feat(studio): a setting for how many session tabs stay open before one is folded away 2026-10-16 03:29:38 -07:00
SivanCola 1f30e8e747 fix(studio): align composer menu density with the application
Problem: the five composer menus appeared oversized beside the application's
compact toolbar and other menus.

Root cause: the shared composer menu style imposed 15px labels, 13px notes,
380px panels, 20px corners and generous spacing on every menu. Workspace
toggle and note borders also produced adjacent divider lines.

Fix: use 13px labels and 11px notes, 12px corners and 8px panel insets; choose
280-340px widths by content. Tighten rows, headings, search, chips, checks
and the workspace switch together, leaving one workspace note divider.
Keep all changes scoped to composer menus and update their style contract
and bilingual release note.

Verification: 22 related suites / 226 tests; production build; make lint,
make check and git diff --check. In-app browser checks cover all five menus
in light/dark themes, 390px and 320px viewport bounds, model/branch search,
Escape dismissal and focus restoration. Mock data only.
2026-10-16 18:29:00 +08:00
YHH a1f63d7964 Merge pull request #13417 from esengine/feat/11376-s1-peer-hold
feat(peermail): hold what other sessions send for the user, and deliver it only once approved
2026-10-16 03:28:12 -07:00
esengine d72352b23d fix(serve): find the page beside the real executable of a link
FindPage now also looks beside the file an executable link resolves to,
after the directory it was invoked from, so a package manager that links the
binary onto the PATH still finds the page next to it (#13406).
2026-10-16 03:27:24 -07:00
SivanCola 450a59d0f7 merge: sync studio and preserve inline composer workspace controls
Problem: the workspace PR conflicted with the current studio composer, and
restoring its toolbar slot exposed narrow-pane overlap and pointer failures.

Root cause: the new side-question control shares the same toolbar; a fixed
model minimum could overrun its flex group. Focus-dependent phone folding
also moved buttons between pointer press and release.

Fix: retain both worktree setup and the upstream side-question button; allow
model shrinking and internal wrapping at the narrowest widths. Keep empty
phone toolbar geometry stable on focus and extend browser guards to cover
both workspace variants, pointer opening and nested button overlap.

Verification: 5,021 frontend tests; affected suites 126 tests after CSS edits;
production and perf builds; make lint, make check and diff whitespace checks;
hoverradius, branch-menu, modelrows and extended narrow browser guards;
light/dark worktree selection, Escape/focus, menu bounds and first send.
2026-10-16 18:17:31 +08:00
esengine 38ebf5f677 feat(desktop): move the pane views to the window bar and drop the view strip
Run analysis and Workbench become icons on the window bar for the focused
pane; the Conversation / Run analysis / Workbench row, the plan peek and
their styles are removed (#13369).
2026-10-16 03:14:10 -07:00
SivanCola 340bbd24b6 fix(studio): restore inline workspace controls and shared pill styling
Problem: workspace and branch controls were moved outside the composer, and
the footer-only 8px override broke the shared toolbar radius browser guard.

Root cause: the workspace slot bypassed the existing branch toolbar layout
and overrode the common mode button geometry.

Fix: restore both controls to the original toolbar slot, reuse branch layout
and pill styling, remove the footer overrides and keep runtime statistics
below the card. Cover new and existing conversations in the browser guard,
load the production menu stylesheet in the perf fixture and align the docs.

Verification: reproduced both layout assertions and the light/dark radius
failure before the fix; 4,831 frontend tests passed; production build,
make lint and make check passed; hoverradius, branch-menu, modelrows and
narrow browser guards passed.
2026-10-16 18:12:21 +08:00
esengine 5cec67c0d4 feat(peermail): hold what other sessions send for the user, and deliver it only once approved 2026-10-16 03:10:54 -07:00
YHH 25dcf4d60f Merge pull request #13411 from esengine/feat/11376-s0-peermail-spool
feat(peermail): the spool, the live record and the forbidden-read directory for messages between sessions
2026-10-16 02:55:05 -07:00
esengine 448e7fe468 fix(control): report a turn as running only while it executes, not while its TurnDone is delivered 2026-10-16 02:46:28 -07:00
YHH c6f134a4c7 Merge pull request #13415 from esengine/feat/13384-write-lease-toggle
feat(studio): a switch for how sessions in one project wait on each other
2026-10-16 02:29:16 -07:00
esengine cb138521d5 feat(peermail): the spool, the live record and the forbidden-read directory for messages between sessions 2026-10-16 02:24:00 -07:00
YHH 1ea7d64cf3 Merge pull request #13413 from esengine/fix/import-registers-workspaces
fix(migration): list the projects a recovered session was routed back into
2026-10-16 02:17:58 -07:00
esengine c79454f8ef feat(studio): a switch for how sessions in one project wait on each other 2026-10-16 02:09:28 -07:00
esengine e0bbc694d7 fix(migration): list the projects a recovered session was routed back into 2026-10-16 02:03:14 -07:00
YHH 8c35e9c8b2 Merge pull request #13262 from xxoingr/fix/cli-stop-offering-light-preset
fix(cli): stop offering the retired light execution setting
2026-10-16 01:58:41 -07:00
YHH b60a5cfe0e Merge pull request #13408 from esengine/feat/12040-last-check-dot
feat(providers): the list remembers how each source's last test ended
2026-10-16 01:56:02 -07:00
YHH 1bccebf836 Merge pull request #13409 from esengine/fix/13406-readable-page-not-built
fix(serve): tell a browser what to do when this server has no web page
2026-10-16 01:37:03 -07:00
esengine df2a1f6769 fix(serve): tell a browser what to do when this server has no web page 2026-10-16 01:25:02 -07:00
YHH caeef8eb94 Merge pull request #13407 from esengine/fix/13402-open-rows
fix(serve): a session open in a pane keeps its titled row whatever the list leaves out
2026-10-16 01:17:46 -07:00
esengine 0b8457466e feat(providers): the list remembers how each source's last test ended 2026-10-16 01:14:36 -07:00
esengine ece69f0930 feat(providers): the list remembers how each source's last test ended 2026-10-16 01:12:47 -07:00
esengine 064f04c1e9 fix(serve): a session open in a pane keeps its titled row whatever the list leaves out 2026-10-16 01:05:51 -07:00
YHH 2332e65698 Merge pull request #13405 from esengine/fix/12040-draft-aware-check
fix(providers): test the address, key and protocol on the form, not only the saved ones
2026-10-16 00:59:20 -07:00
YHH b94404c2f2 Merge pull request #13404 from esengine/feat/feedback-mine-filter
feat(desktop): filter my feedback by progress and new replies
2026-10-16 00:59:15 -07:00
YHH c32febd274 Merge pull request #13240 from chuiwenwei/fix/memory-suppression-audit-symmetry
fix(session): audit every automatic-recall suppression identically
2026-10-16 00:51:24 -07:00
YHH 02c7d24ec4 Merge pull request #13239 from chuiwenwei/fix/checkpoint-turn-reuse-after-unreadable
fix(checkpoint): keep turn numbering above unreadable checkpoint files
2026-10-16 00:49:21 -07:00
YHH fc65474e6b Merge pull request #13261 from xxoingr/test/boot-thought-pause-after-receipt
test(boot): start the scripted thought's pause after the host takes it
2026-10-16 00:46:38 -07:00
YHH 040e48f927 Merge pull request #13260 from xxoingr/fix/filelock-free-lock-after-deadline
fix(filelock): take a free lock even after the caller's deadline has passed
2026-10-16 00:44:03 -07:00
YHH 9765c5db5e Merge pull request #13401 from esengine/feat/12040-typed-connection-check
feat(studio): ask for protocol, address and key before the source name
2026-10-16 00:40:16 -07:00
YHH 9c36cb3a3b Merge pull request #13400 from esengine/feat/side-question-composer
feat(desktop): move the side question entry into the composer toolbar
2026-10-16 00:40:07 -07:00
esengine f4010fc6b6 fix(providers): test the address, key and protocol on the form, not only the saved ones 2026-10-16 00:36:13 -07:00
esengine e778a376b5 feat(desktop): filter my feedback by progress and new replies
A sticky bar of groups (all, new replies, needs your reply, open, closed)
with counts sits at the top of My feedback; rows that do not match are
hidden rather than unmounted so open threads and reply drafts survive (#13388).
2026-10-16 00:33:51 -07:00
esengine de77acf72d feat(desktop): move the side question entry into the composer toolbar
The side question becomes an icon after the attach button, with a tooltip
and a pressed state, instead of a text button on the view strip (#13369).
2026-10-16 00:26:15 -07:00
esengine e2c861d525 feat(studio): ask for protocol, address and key before the source name 2026-10-16 00:19:17 -07:00
YHH 115de56961 Merge pull request #13389 from esengine/feat/4783-job-detail
feat(studio): a running background task can be opened to read its output
2026-10-16 00:18:46 -07:00
YHH 2350eb91b1 Merge pull request #13398 from esengine/feat/13111-origin-enum
fix(agent): label a sub-agent's report with the origin of what it fetched
2026-10-16 00:12:34 -07:00
YHH 3c3b000d81 Merge pull request #13397 from esengine/fix/13395-claim-wording
fix(delegation): say what a writer without write_paths claims under the optimistic write lease
2026-10-16 00:09:16 -07:00
YHH 67baf20bd2 Merge pull request #13396 from esengine/design/pane-nav
feat(desktop): show the goal in the composer plan fold and add view shortcuts
2026-10-16 00:06:04 -07:00
esengine f4a14f3325 feat(studio): a running background task can be opened to read its output 2026-10-16 00:05:48 -07:00
YHH c6446343b8 Merge pull request #13393 from esengine/feat/11942-cross-session-search
feat(history): search conversation text from the sidebar
2026-10-16 00:05:21 -07:00
esengine d5544f8368 fix(agent): label a sub-agent's report with the origin of what it fetched 2026-10-16 00:02:09 -07:00
esengine b634815e3a fix(delegation): say what a writer without write_paths claims under the optimistic write lease 2026-10-15 23:59:14 -07:00
esengine 7d21a467c4 feat(desktop): show the goal in the composer plan fold and add view shortcuts
The composer's plan fold now carries the /goal text when there is no plan,
and the three pane views get Ctrl/Cmd 1-3 shortcuts and palette entries.
Prerequisite for removing the top plan peek and view strip (#13369).
2026-10-15 23:49:21 -07:00
esengine 8ae2737bf8 feat(history): search conversation text from the sidebar 2026-10-15 23:44:36 -07:00
YHH 74f8239944 Merge pull request #13391 from esengine/feat/12254-cancel-one-call
feat(agent): stop one running tool call without ending the turn
2026-10-15 23:38:44 -07:00
esengine 22ba1cdf2d feat(agent): stop one running tool call without ending the turn 2026-10-15 23:06:05 -07:00
YHH 438f1e7d4a Merge pull request #11299 from Guan0923/codex/short-user-bubble
feat(studio): create conversation branches from final replies
2026-10-15 22:58:01 -07:00
YHH 82a0084226 Merge pull request #13387 from esengine/feat/11962-ask-interface-size
feat(studio): ask once whether the interface is too small on a wide display at 100% scaling
2026-10-15 22:54:09 -07:00
YHH d75669c7c6 Merge pull request #13386 from esengine/fix/13377-archived-open
fix(serve): an open archived session no longer returns as an unlisted new-session row
2026-10-15 22:27:53 -07:00
esengine f8e132334a feat(studio): ask once whether the interface is too small on a wide display at 100% scaling 2026-10-15 22:25:54 -07:00
esengine e14e031993 fix(serve): an open archived session no longer returns as an unlisted new-session row 2026-10-15 22:15:22 -07:00
Guan09 ad01fab3d6 fix(studio): preserve BranchAt checkpoints and source settings 2026-10-16 13:14:18 +08:00
Guan09 80d7b978c0 fix(studio): scope fork UI and preserve conversation checkpoints 2026-10-16 13:13:16 +08:00
Guan09 83b530f0d3 feat(studio): 调整消息操作并支持从最终答复创建对话分支 2026-10-16 13:13:16 +08:00
YHH 27f0dd00fc Merge pull request #13383 from esengine/fix/13345-tree-index
perf(sessionstore): remember the session listing so a restart does not open every sidecar
2026-10-15 22:05:03 -07:00
esengine 70a21569fd test(sessionstore): use the current idioms in the listing index tests 2026-10-15 21:53:59 -07:00
esengine d9a3e7b930 docs(sessionstore): shorten the listing comment 2026-10-15 21:51:08 -07:00
esengine a440eed706 docs: shorten the listing index note 2026-10-15 21:51:08 -07:00
esengine ec66acdf93 perf(sessionstore): remember the session listing so a restart does not open every sidecar 2026-10-15 21:51:08 -07:00
YHH d51242c956 Merge pull request #13382 from esengine/fix/13379-ask-error-style
fix(studio): give the ask card's delivery error room and colour
2026-10-15 21:43:17 -07:00
YHH e64d1e0b49 Merge pull request #13381 from esengine/fix/12883-empty-skill
fix(skill): a review skill chosen with no task reviews the pending changes by default
2026-10-15 21:36:41 -07:00
esengine 678a7f6eb5 fix(studio): give the ask card's delivery error room and colour 2026-10-15 21:34:30 -07:00
YHH 15507b8e22 Merge pull request #13380 from esengine/fix/13148-fallback-notice
fix(agent): say why a fold that stopped matching is no longer used
2026-10-15 21:33:59 -07:00
esengine d76f5e1594 test(control): drop an unused helper 2026-10-15 21:24:55 -07:00
esengine c1c5676e69 refactor(control): the typed subagent slash moves to its own method 2026-10-15 21:23:53 -07:00
esengine b1e369773c fix(skill): a review skill chosen with no task reviews the pending changes by default 2026-10-15 21:23:14 -07:00
esengine f02c20db16 fix(agent): say why a fold that stopped matching is no longer used 2026-10-15 21:22:55 -07:00
YHH f47ee0f2fb Merge pull request #13378 from esengine/fix/13345-tree-retry
fix(studio): the sidebar offers a retry when the first read is slow, and a retry does not queue
2026-10-15 21:18:24 -07:00
esengine 6c9e696290 style(studio): keep the retry rule within the stylesheet budget 2026-10-15 21:07:10 -07:00
esengine c57dc18a7a docs(studio): shorten the sidebar retry note 2026-10-15 21:05:25 -07:00
esengine 2ca0e9b771 fix(studio): the sidebar offers a retry when the first read is slow, and a retry does not queue 2026-10-15 21:05:25 -07:00
YHH 21f226e608 Merge pull request #13376 from esengine/fix/kept-failures-effect
test(boot): hold the failed-result retention bound at the provider boundary
2026-10-15 21:03:56 -07:00
YHH e9b5b44c1d Merge pull request #13374 from esengine/feat/13125-granted-root-images
feat(studio): conversation pictures load from folders the user granted the workspace
2026-10-15 20:58:38 -07:00
YHH c1150171e3 Merge pull request #13373 from esengine/fix/13368-user-images
fix(studio): a tall picture sent with a message no longer spills out of its thumbnail
2026-10-15 20:46:54 -07:00
esengine 1b55821b6f test(boot): hold the failed-result retention bound at the provider boundary
#13366 bounded the failed tool results a fold keeps, with component tests. This
adds the effect test through the real Build: 60 turns of failing commands fold
seven times, and the request right after a fold must not carry more failed
results than the retention budget plus the recent tail allow (4 with the bound,
9 without it, where the 50% ceiling is the only thing that clears them).

Refs #13148
2026-10-15 20:45:48 -07:00
esengine 5c7992e840 docs(studio): shorten the user picture note 2026-10-15 20:36:54 -07:00
esengine 8325582049 fix(studio): a tall picture sent with a message no longer spills out of its thumbnail 2026-10-15 20:36:33 -07:00
esengine 02107977f4 feat(studio): conversation pictures load from folders the user granted the workspace 2026-10-15 20:33:56 -07:00
esengine 4215adc58a feat(serve): /workspace/image can read from a folder the user granted the workspace 2026-10-15 20:33:56 -07:00
YHH d06ffdddd5 Merge pull request #13366 from esengine/fix/kept-failures-budget
fix(agent): bound the failed tool results a fold keeps verbatim
2026-10-15 20:33:30 -07:00
YHH 1a140858c5 Merge pull request #13367 from esengine/feat/update-download-mode
feat(update): a Download update mode that fetches but never installs or restarts
2026-10-15 20:26:45 -07:00
Will b96b977897 fix(e2ebench): report a suite run whose metrics never landed as unmeasured
runSegments read only the final metrics file. When a child was killed or
timed out it folded the missing record in as an accounted zero, deleted the
<metrics>.partial snapshot the sink had been writing, and left Unaccounted
unset, so every published total omitted what the run spent.

Read the sidecar when the final record is absent, keep the file it came from,
set Partial, and mark the run Unaccounted when neither exists.
renderMeterAccounting no longer prices a run whose harness reported no tokens
against the meter, which invented a -100% divergence.
2026-10-16 11:24:20 +08:00
Will e795d822f6 fix(plugin): stop reporting a legacy cache-key upgrade that did not persist
LoadCachedSchemaForSpec rewrote a legacy-keyed entry in memory, discarded the
SaveCachedSchema error, and returned the hit with the new CacheKey. With a
read-only or full cache dir the file still held the legacy key, so boot was
handed a key that a later read cannot reproduce and pinned the session's MCP
tool identity to a key with no on-disk counterpart
(internal/assembly/boot/mcp_registration.go:76).

Keep the hit but claim the upgraded key only once the rewrite reached disk; on
failure the returned object keeps the legacy key the file holds, which matches
the package's best-effort, silent-degradation policy. A successful upgrade is
unchanged, and no caller can now observe a key the file disagrees with.
2026-10-16 11:20:39 +08:00
Will 9f33c8c45e fix(sessionstore): refuse a degraded image rewrite when the checkpoint is unreadable
checkpointImages reported "no such image" for a checkpoint it could not
inspect, so refuseDegradedCheckpointRewrite read a stat failure, a read
failure, a non-regular file, or a file past the replay ceiling as "nothing to
protect" and let a transcript missing an image replace the only copy of that
image — the exact case where the guard cannot know.

Return the inspection error from checkpointImages, and have the guard fail
closed under ErrSessionImagesUnavailable for any checkpoint that exists but
cannot be read whole. A genuinely missing checkpoint still proceeds: there is
no second copy to protect. The restore path stays best-effort and now logs why
it could not inspect the checkpoint.
2026-10-16 11:20:20 +08:00
Will 6858c06de7 fix(stats): Flush reports the first append that failed
recordDispatcher.run discarded Writer.Append's error, so Flush — the only
success/failure signal the stats pipeline has — returned nil even when every
queued append failed. The dispatcher now keeps the first failure since the last
flush sentinel and hands it to the waiter through that sentinel, so a caller
that gates a deterministic read on Flush cannot mistake a failed write for a
durable one.

The failure is consumed by the flush that reports it, so a later flush over a
recovered directory returns nil, while a still-broken one keeps reporting. A
full queue may still drop a record; that stays documented and unchanged.

Tests: the audit red test plus controls for a healthy flush persisting records
and for failure-then-convergence.
2026-10-16 11:20:05 +08:00
esengine e715e2eac3 fix(agent): bound the failed tool results a fold keeps verbatim
A fold keeps failed tool results since the latest digest. The projection places
them right after that digest, so the next fold read last fold's survivors as
"since the latest digest" and kept them again: retention grew by every round's
failures and only stopped when the candidate crossed the 50% checkpoint ceiling.

Failed results now have their own retention budget (5% of the window, like kept
user turns), newest first; the rest fold into the digest, whose coverage guard
still names them. [[keep]] messages stay outside the budget.

Refs #13148
2026-10-15 20:18:53 -07:00
esengine 4342f7033f feat(studio): register the restart notice actions 2026-10-15 20:10:13 -07:00
esengine fad7beb5f8 feat(studio): the restart notice uses the calm surface; harness can stage an update 2026-10-15 20:10:13 -07:00
esengine b08c7b0ea9 docs(studio): shorten the download mode note 2026-10-15 20:10:13 -07:00
esengine 23618027e5 feat(studio): the Download update mode in settings and the restart notice 2026-10-15 20:10:13 -07:00
esengine 1ade11a727 feat(studio): the update watch downloads in download mode and reports the release waiting 2026-10-15 20:10:13 -07:00
esengine 5a2df57570 feat(config): a download update mode that fetches but never installs or restarts 2026-10-15 20:10:13 -07:00
YHH ed121465e6 Merge pull request #13364 from esengine/fix/13343-theme-contrast
test(theme): every shipped pack's grey inks read on the surfaces they are set on
2026-10-15 20:09:05 -07:00
YHH 900cf4c064 Merge pull request #13362 from esengine/fix/13354-md-local-images
fix(studio): local pictures in a reply load from the workspace channel or say why not
2026-10-15 19:59:43 -07:00
esengine ad67dd9d1b test(theme): every shipped pack's grey inks read on the surfaces they are set on 2026-10-15 19:58:50 -07:00
esengine 5f4dc69ebf fix(studio): local pictures in a reply load from the workspace channel or say why not 2026-10-15 19:50:23 -07:00
YHH 02aa56aaa8 Merge pull request #13361 from esengine/fix/13358-skill-hint
fix(studio): announce loading only while a slash word is waiting for the list
2026-10-15 19:39:28 -07:00
YHH 1a06a37546 Merge pull request #13360 from esengine/fix/12780-switching-state
fix(studio): the branch chip says which branch it is switching to
2026-10-15 19:37:44 -07:00
esengine e76f82b095 fix(studio): announce loading only while a slash word is waiting for the list 2026-10-15 19:29:19 -07:00
esengine ce3a71736d fix(studio): the branch chip says which branch it is switching to 2026-10-15 19:25:57 -07:00
YHH af7e4166e6 Merge pull request #13357 from esengine/fix/13343-running-actions
fix(studio): a reply's actions wait until the tools under it have finished
2026-10-15 19:22:36 -07:00
YHH fb2bab37ca Merge pull request #13356 from esengine/fix/13353-autoname-reason
fix(serve): say why automatic session naming failed
2026-10-15 19:21:03 -07:00
YHH 6f073db2ab Merge pull request #13355 from esengine/feat/13346-run-elapsed
feat(studio): the running chip says how long the turn has been running
2026-10-15 19:13:37 -07:00
esengine 7cd0830d47 refactor(studio): the empty-conversation hero moves out of Transcript.tsx 2026-10-15 19:11:00 -07:00
esengine 653d49bdb2 fix(studio): a reply's actions wait until the tools under it have finished 2026-10-15 19:08:15 -07:00
esengine 5add43c159 fix(serve): say why automatic session naming failed 2026-10-15 19:04:01 -07:00
esengine 343d100610 docs(studio): shorten the running chip note 2026-10-15 18:59:15 -07:00
esengine 5cd4b0347d test(studio): the run start is unknown until a turn starts in this window 2026-10-15 18:57:20 -07:00
esengine 13404bd977 feat(studio): the running chip says how long the turn has been running 2026-10-15 18:57:03 -07:00
YHH ff55e2dfa2 Merge pull request #13351 from esengine/fix/13350-feedback-shot-zoom
fix(studio): attached feedback screenshots open at full size
2026-10-15 18:54:15 -07:00
esengine ecc8138c11 fix(studio): attached feedback screenshots open at full size 2026-10-15 18:42:58 -07:00
YHH d2020b1309 Merge pull request #13348 from esengine/fix/13220-toast-names-config-file
fix(studio): a refused settings save names the config file that did not parse
2026-10-15 18:38:44 -07:00
YHH 7df661b5ef Merge pull request #13344 from esengine/fix/13293-unproven-gap
fix(agent): stop telling the model that making an unproven change again settles it
2026-10-15 18:34:37 -07:00
esengine 5d79d0f450 fix(studio): a refused settings save names the config file that did not parse 2026-10-15 18:27:08 -07:00
esengine bc2c691ba4 fix(agent): stop telling the model that making an unproven change again settles it 2026-10-15 18:23:53 -07:00
YHH fe1dceced9 Merge pull request #13340 from esengine/test/13295-system-prompt-change-effect
test(boot): a changed system prompt says the saved fold was not reused
2026-10-15 18:11:45 -07:00
esengine 81bb10fae1 test(boot): a changed system prompt says the saved fold was not reused
The covered-prefix hash includes the system message, so editing the system
prompt between two visits retires a saved compaction. #13336 added the notice
at the agent and control layers; this pins it at boot.Build, and pins that an
unchanged prompt stays quiet.

Refs #13295
2026-10-15 16:48:04 -07:00
YHH 55c3d81bbc Merge pull request #13339 from esengine/docs/release-studio-2.42.0
docs(release): Studio 2.42.0 notes
2026-10-15 16:40:16 -07:00
esengine ffd73e115e docs(release): Studio 2.42.0 notes 2026-10-15 16:28:01 -07:00
YHH 1a33ce5692 Merge pull request #13337 from esengine/fix/13335-lease-domain-notice
fix(workspacelease): say which git repository folds two folders into one write domain
2026-10-15 14:06:21 -07:00
esengine 6e2ed58a34 fix(workspacelease): say which git repository folds two folders into one write domain 2026-10-15 13:56:32 -07:00
YHH 2be1dba2da Merge pull request #13336 from esengine/fix/projection-drop-attribution
fix(control): say why a saved fold was not reused when a session is opened
2026-10-15 13:14:19 -07:00
esengine a717691db9 docs(release-notes): shorten the fold-not-reused fragment 2026-10-15 13:01:14 -07:00
esengine dfdbfbd4d8 fix(control): say why a saved fold was not reused when a session is opened 2026-10-15 12:59:32 -07:00
YHH 7b7af1a78c Merge pull request #13334 from esengine/fix/overview-cell-align
fix(studio): overview figures on one row share a baseline
2026-10-15 12:57:08 -07:00
YHH 59526e5156 Merge pull request #13333 from esengine/docs/release-note-gaps-1016
docs(release-notes): fragments for the expired-pin fix and the branch-switch latency
2026-10-15 12:54:14 -07:00
esengine 935200d9e8 fix(studio): overview figures on one row share a baseline 2026-10-15 12:46:41 -07:00
YHH 9006ff804c Merge pull request #13332 from esengine/feat/overview-context
feat(studio): the context window in the session overview
2026-10-15 12:45:42 -07:00
esengine c57cf43aeb docs(release-notes): fragments for the expired-pin fix and the branch-switch latency 2026-10-15 12:43:14 -07:00
esengine a9e2a12927 docs(release-notes): shorten the overview window fragment 2026-10-15 12:30:49 -07:00
esengine 97dee44a3d fix(studio): the overview's hand-over button has its own action value 2026-10-15 12:28:53 -07:00
esengine 2192bfb20c feat(studio): the context window in the session overview, stated as the next request's content 2026-10-15 12:28:09 -07:00
YHH 5516d5a7d8 Merge pull request #13331 from esengine/fix/context-card-guard
test(studio): scope the context-card hover guard to the context anchor
2026-10-15 12:18:39 -07:00
esengine d10871190c test(studio): scope the context-card hover guard to the context anchor 2026-10-15 12:09:08 -07:00
YHH ccdd8a721f Merge pull request #13330 from esengine/feat/session-overview
feat(studio): a session overview behind the cache meter, each figure beside what it counts
2026-10-15 12:03:58 -07:00
esengine 941b66d0fc feat(studio): a session overview behind the cache meter, each figure beside what it counts 2026-10-15 11:49:28 -07:00
YHH 008d5c5e35 Merge pull request #13329 from esengine/test/lazy-swap-poll
test(plugin): wait for the registry swap, not just the server
2026-10-15 11:41:33 -07:00
YHH 18abe2b8b0 Merge pull request #13328 from esengine/feat/session-usage-status
feat(serve): /status carries the session's usage by source, from the cost ledger
2026-10-15 11:37:57 -07:00
esengine e43caacac5 test(plugin): wait for the registry swap, not just the server 2026-10-15 11:30:17 -07:00
YHH b3056b2326 Merge pull request #13327 from esengine/fix/scroll-jump-ends
fix(studio): the jump buttons go straight to the ends; Shift+click steps through expanded blocks
2026-10-15 11:12:16 -07:00
esengine 4f2a495578 feat(serve): /status carries the session's usage by source, from the cost ledger 2026-10-15 11:10:37 -07:00
esengine d3e45aff25 fix(studio): the jump buttons go straight to the ends; Shift+click steps through expanded blocks 2026-10-15 10:59:38 -07:00
YHH 0fe09f3a1d Merge pull request #13323 from esengine/fix/bound-taskkill
fix(proc): bound the taskkill a Windows stop depends on
2026-10-15 10:56:47 -07:00
YHH 3d18fee663 Merge pull request #13325 from esengine/fix/steer-resend-dedupe
fix(inbox): the same words sent again while the first copy waits are not another item
2026-10-15 10:54:30 -07:00
esengine ee9e753baf style(tools): range over SplitSeq in the dev server test 2026-10-15 10:47:18 -07:00
esengine da3359c59b fix(inbox): the same words sent again while the first copy waits are not another item 2026-10-15 10:42:29 -07:00
YHH d7f0055d5e Merge pull request #13267 from esengine/feat/13228-browser-tab-rename
feat(studio): rename a built-in browser tab by double-clicking it
2026-10-15 10:31:29 -07:00
YHH f5a010780c Merge pull request #13324 from esengine/fix/skill-update-record-heal
fix(skills): retry a failed update record and let the next update heal it
2026-10-15 10:21:46 -07:00
esengine fbfdf8bdbe feat(studio): rename a built-in browser tab by double-clicking it 2026-10-15 10:20:57 -07:00
esengine b238636ce4 fix(skills): retry a failed update record and let the next update heal it 2026-10-15 10:10:10 -07:00
YHH a6b496de58 Merge pull request #13322 from esengine/fix/job-stop-in-progress
fix(jobs): say when a background job's stop is already under way, and refresh the list after a refused stop
2026-10-15 10:09:03 -07:00
esengine 9edb081dab test(tools): a dev server's process tree ends on Stop and on kill_shell, in both Windows shells 2026-10-15 10:05:54 -07:00
esengine 95ec1dd78b fix(proc): bound the taskkill a stop depends on 2026-10-15 10:02:55 -07:00
esengine 421dd778cd test(proc): a hung taskkill must not hold the stop 2026-10-15 10:01:04 -07:00
esengine 0c199e0c25 fix(jobs): say when a background job's stop is already under way, and refresh the list after a refused stop 2026-10-15 09:54:32 -07:00
YHH 878baaae07 Merge pull request #13321 from esengine/feat/skill-source-update
feat(skills): update an installed skill from its source folder, after previewing the change
2026-10-15 09:53:36 -07:00
esengine 373c1e773c feat(skills): update an installed skill from its source folder, after previewing the change 2026-10-15 09:38:45 -07:00
YHH 9bd7e7f104 Merge pull request #13317 from esengine/feat/skill-source-lock
feat(skills): remember where an installed skill came from, and say whether it is still in step
2026-10-15 09:33:34 -07:00
YHH 824975d344 Merge pull request #13313 from esengine/feat/update-mode
feat(update): an update mode setting, with a background notify tier
2026-10-15 09:29:06 -07:00
esengine 04c74845ea feat(skills): remember where an installed skill came from, and say whether it is still in step 2026-10-15 09:24:32 -07:00
esengine 65192c35a5 test(config): the update mode survives a desktop save 2026-10-15 09:19:20 -07:00
YHH c39c9e2155 Merge pull request #13316 from esengine/docs/release-note-gaps
docs(release-notes): fragments for four merged changes that had none
2026-10-15 09:07:08 -07:00
YHH 8a36ceab41 Merge pull request #13314 from xxoingr/docs/guide-rewind-confirm-key
docs(guide): list the rewind picker's partial-coverage confirmation
2026-10-15 09:04:16 -07:00
YHH b9b482df5e Merge pull request #13315 from esengine/fix/skill-store-grant-refusal
fix(config): the skills folder refuses a write grant with its own identity and the way forward
2026-10-15 09:03:39 -07:00
esengine d2f075edeb docs(release-notes): fragments for four merged changes that had none 2026-10-15 08:57:30 -07:00
SivanCola 1d90810a02 feat(studio): configure session worktrees and unify composer menus
Problem: concurrent tasks need separate code directories rooted at a chosen
branch, and composer configuration menus use inconsistent visual scales.

Root cause: isolated workspaces only started from HEAD and their entry was
outside the new-conversation composer. Menu surfaces had independent styles.

Fix: stage worktree and exact base-ref selection before the first submit,
carry draft attachments through confined roots, preserve session settings,
reject stale preparation and roll back unpublished worktrees on failure.
Keep existing conversations and older servers on the branch control.
Share composer menu surfaces, moderate 15px labels, 13px descriptions and
neutral selection states across mode, workspace, permissions, model and effort.
Move workspace controls below the input card beside runtime statistics, retain
branch labels in narrow panes, and wrap model/effort at the smallest widths.

Verification: 4831 frontend tests; TypeScript and production build; real Git
worktree/source/refusal and attachment confinement tests; serve, control,
builtin and boot suites; go vet, make lint and make check. Browser interaction
and light/dark responsive captures are kept outside the repository.

Fixes #13264
2026-10-15 23:56:52 +08:00
esengine 3336055f25 fix(config): the skills folder refuses a write grant with its own identity and the way forward 2026-10-15 08:53:21 -07:00
xxoingr 65d5a9b8ed docs(guide): list the rewind picker's partial-coverage confirmation
A file restore the checkpoint covers only partly stops for one more
answer, taken with Enter or y (the panel's own hint says so); the key
table in both guides listed neither the step nor y. The new test pins
that step: it does not commit before the answer, Esc steps back without
restoring, and Enter or y commits.
2026-10-15 23:50:55 +08:00
esengine 5e45f2481a feat(update): an update mode setting, with a background notify tier 2026-10-15 08:40:28 -07:00
YHH c8bf792009 Merge pull request #13310 from esengine/fix/scrolljump-quiet
fix(studio): quieter jump-to-top/bottom buttons
2026-10-15 08:29:20 -07:00
YHH 3fd20922ce Merge pull request #13309 from esengine/test/v5-import-markers
test(migration): 24-digit by-id sessions import beside empty legacy markers
2026-10-15 08:25:07 -07:00
YHH 879debe477 Merge pull request #13308 from esengine/test/cancel-hung-gateway
test(openai): cancelling ends a stream wherever the gateway goes silent
2026-10-15 08:22:35 -07:00
esengine bdf9629c4b fix(studio): quieter jump-to-top/bottom buttons 2026-10-15 08:18:28 -07:00
YHH 23fb0e3b3d Merge pull request #13307 from esengine/fix/13302-plan-chip-right
fix(studio): keep the plan chip at the right edge of the tab row
2026-10-15 08:14:42 -07:00
esengine fc0ddd5082 test(migration): 24-digit by-id sessions import beside empty legacy markers 2026-10-15 08:14:13 -07:00
YHH 8d5b0e79f5 Merge pull request #13282 from esengine/feat/13276-model-prices
feat(providers): per-model price entry in the connection editor
2026-10-15 08:13:31 -07:00
esengine 786395c23e test(openai): cancelling ends a stream wherever the gateway goes silent 2026-10-15 08:11:00 -07:00
YHH 8d83e5322f Merge pull request #13306 from esengine/fix/update-stall-fact
fix(update): say when a download stalls and keeps stalling
2026-10-15 08:09:32 -07:00
esengine b610ed563d fix(studio): keep the plan chip at the right edge of the tab row 2026-10-15 08:03:31 -07:00
YHH c671e7aee7 Merge pull request #13298 from esengine/fix/openwith-labels
fix(studio): translate the open-with names and drop the duplicate file manager entry
2026-10-15 07:59:41 -07:00
esengine cf0b55cbf6 fix(update): say when a download stalls and keeps stalling 2026-10-15 07:58:51 -07:00
YHH 3536abdb11 Merge pull request #13287 from esengine/feat/13258-mirror-reply-images
feat(feedback-sync): bring a mirrored reply comment up to date when its images change
2026-10-15 07:57:50 -07:00
esengine 8d76564db6 test(studio): tolerate the model id appearing in its price row 2026-10-15 07:54:25 -07:00
YHH 86b7f399ba Merge branch 'studio' into feat/13276-model-prices 2026-10-15 07:52:04 -07:00
esengine 28e8874cb4 fix(studio): translate the open-with names and drop the duplicate file manager entry 2026-10-15 07:49:37 -07:00
YHH 723f0fabcf Merge pull request #13277 from esengine/feat/13247-shell-args
feat(shell): launcher arguments for a pinned shell (wsl.exe -d <distro> -- /bin/bash)
2026-10-15 07:49:32 -07:00
YHH 81742a513c Merge pull request #13300 from esengine/fix/13293-unproven-ask
fix(agent): tell the turn what discharges a change the host could not read
2026-10-15 07:43:30 -07:00
esengine 369fbf83b4 feat(shell): launcher arguments for a pinned shell (wsl.exe -d <distro> -- /bin/bash) 2026-10-15 07:35:36 -07:00
YHH 465882cad6 Merge pull request #13296 from esengine/fix/legacy-import-24hex-ids
fix(sessionstore): import 1.x Desktop sessions whose ids are 24 digits
2026-10-15 07:34:22 -07:00
esengine ece5895330 fix(agent): tell the turn what discharges a change the host could not read 2026-10-15 07:32:49 -07:00
esengine 1be3ce4c17 fix(sessionstore): import 1.x Desktop sessions whose ids are 24 digits 2026-10-15 07:23:45 -07:00
YHH 6891c67dc7 Merge pull request #13241 from chuiwenwei/fix/sessionstore-torn-checkpoint-replay
fix(sessionstore): keep the turns a torn checkpoint still decodes
2026-10-15 07:22:45 -07:00
YHH 6bcb1b3f6a Merge pull request #13238 from chuiwenwei/fix/context-batch-failed-runs-not-scored
fix(context-retrieval): stop scoring runs that never produced a transcript
2026-10-15 07:19:54 -07:00
YHH cfb6e5436d Merge pull request #13289 from esengine/feat/13284-compaction-remains
feat(compaction): say what a fold still leaves behind when it is a large share of the window
2026-10-15 07:11:31 -07:00
esengine c9d5f416e6 feat(compaction): say what a fold still leaves behind when it is a large share of the window 2026-10-15 07:01:28 -07:00
YHH 41a6830338 Merge pull request #13285 from esengine/fix/feedback-capture-teardown
fix(studio): stop the window capture quietly when its dialog is already gone
2026-10-15 06:52:50 -07:00
esengine a8d4af21e8 feat(feedback-sync): bring a mirrored reply comment up to date when its images change 2026-10-15 06:50:06 -07:00
YHH 9d1e1387fa Merge pull request #13283 from esengine/fix/optimistic-test-userconfig
test(boot): write the optimistic-claims test's user config where the platform reads it
2026-10-15 06:48:24 -07:00
esengine 86acd819a4 fix(studio): stop the window capture quietly when its dialog is already gone 2026-10-15 06:43:17 -07:00
YHH 457f44d28b Merge pull request #13265 from esengine/feat/13227-open-with-header
feat(studio): open the project in other programs from the file panel
2026-10-15 06:40:48 -07:00
esengine 63599d05ec test(boot): write the optimistic-claims test's user config where the platform reads it 2026-10-15 06:37:14 -07:00
YHH 5df01bceb6 Merge pull request #13201 from chuiwenwei/fix/memory-expired-pinned-guidance
fix(memory): keep expired facts out of pinned guidance
2026-10-15 06:36:55 -07:00
esengine 20e70f1e49 feat(providers): per-model price entry in the connection editor 2026-10-15 06:31:54 -07:00
YHH 8deaa510f0 Merge pull request #13281 from esengine/feat/13274-subagent-claims-optimistic
feat(delegation): optimistic claims for sub-agents that declare no write_paths
2026-10-15 06:23:31 -07:00
YHH 9911440dba Merge pull request #13280 from esengine/feat/13212-thinking-preview
feat(studio): optional first-sentence preview beside folded thinking
2026-10-15 06:11:41 -07:00
esengine 30b102ea55 feat(delegation): optimistic claims for sub-agents that declare no write_paths 2026-10-15 06:09:33 -07:00
esengine 236520bc6d feat(studio): optional first-sentence preview beside folded thinking 2026-10-15 06:01:38 -07:00
YHH 0bbc7aa3fe Merge pull request #13279 from esengine/fix/13275-isolated-config-locks
fix(config): keep config edit locks inside an isolated Reasonix home
2026-10-15 05:49:40 -07:00
esengine 143c407f8c fix(config): keep config edit locks inside an isolated Reasonix home 2026-10-15 05:41:12 -07:00
YHH 43b70aeab4 Merge pull request #13272 from esengine/fix/13269-denied-capability-message
fix(agent): say why a write_paths sub-agent may not run a capability, and what to do
2026-10-15 05:18:09 -07:00
esengine ba5ae25730 Merge remote-tracking branch 'origin/studio' into feat/13227-open-with-header
# Conflicts:
#	desktop/frontend-next/src/i18n/en.ts
#	desktop/frontend-next/src/ui/WorkbenchFileBar.tsx
#	desktop/frontend-next/src/ui/WorkbenchPanel.tsx
2026-10-15 05:12:31 -07:00
YHH 4d752dbe46 Merge pull request #13263 from esengine/feat/13255-file-reveal
feat(studio): show the open file in the file manager from its toolbar
2026-10-15 05:09:15 -07:00
esengine d546028843 fix(agent): say why a write_paths sub-agent may not run a capability, and what to do 2026-10-15 05:06:55 -07:00
YHH e89f4b86c3 Merge pull request #13271 from esengine/feat/13264-worktree-base
feat(worktree): create an isolated copy from a chosen branch
2026-10-15 05:00:31 -07:00
YHH f133f0354b Merge pull request #13270 from esengine/feat/13258-reply-images-ui
feat(feedback): replies can carry screenshots
2026-10-15 04:54:48 -07:00
esengine b6fdbb89dd feat(worktree): create an isolated copy from a chosen branch 2026-10-15 04:50:49 -07:00
esengine 856f2fd3f9 feat(feedback): replies can carry screenshots 2026-10-15 04:35:47 -07:00
YHH b1ca562c42 Merge pull request #13257 from esengine/feat/13254-tab-pip-motion
feat(studio): the working session's tab dot breathes
2026-10-15 04:29:24 -07:00
esengine 31afb4a8e6 refactor(studio): the unread mark has one form now that the tab dot carries it 2026-10-15 04:20:23 -07:00
YHH 4ad336d7e7 Merge pull request #13266 from esengine/fix/13259-composer-toolbar
fix(studio): keep the composer toolbar on one line in a narrow conversation column
2026-10-15 04:18:06 -07:00
esengine 349281ede0 fix(studio): keep the composer toolbar on one line in a narrow conversation column 2026-10-15 04:07:13 -07:00
esengine 4974aa9755 feat(studio): open the project in other programs from the file panel 2026-10-15 04:06:24 -07:00
esengine aab5763204 feat(studio): an unread finished session is shown by the tab dot itself 2026-10-15 03:32:17 -07:00
esengine 59996652db feat(studio): show the open file in the file manager from its toolbar 2026-10-15 03:27:56 -07:00
xxoingr c02541014b fix(cli): stop offering the retired light execution setting
agentpreset.Normalize maps "light" and "economy" to balanced, and All()
lists balanced and delivery; light's own policy no longer exists. The CLI
still put light forward as a choice, in seven hand-written strings: the
--preset help of run, tui and serve, the --profile deprecation warning of
each, and parseRuntimeProfile's refusal ("want light, balanced, or
delivery"). The guides went further and described a Light policy (direct-
first planning, targeted verification) that nothing enforces, so a user
who picked it got balanced without being told.

The seven strings now come from agentpreset.All() through livePresets in
preset_flags.go, and the docs (GUIDE, GUIDE.zh-CN, CLI.zh-CN, TOOL_CONTRACT)
offer balanced and delivery, drop the Light policy bullet, and say the
retired names select balanced. light and economy still parse.
2026-10-15 18:27:31 +08:00
xxoingr dcc5616f94 test(boot): start the scripted thought's pause after the host takes it
TestEffectThinkingTimeIsKeptWithTheTurn failed in the race job on studio
(run 38635511666): "thought kept 46 ms, framed 46 ms; want both at least
50". The scripted provider wrote the reasoning chunk into a buffered
channel and began its 60 ms pause at once, while the host times the
thought from when it takes that chunk; a host that reads the first chunk
late measures less than the pause. Returning the stream 30 ms late
reproduces it (29 ms measured).

The channel is now unbuffered, so the pause starts only after the host has
taken the reasoning chunk and the measured thought cannot be shorter than
it.
2026-10-15 18:18:07 +08:00
xxoingr c66e7f5e17 fix(filelock): take a free lock even after the caller's deadline has passed
acquireLocal waited on the in-process token and ctx.Done in one select.
When both were ready (a lock nobody held, and a deadline already spent)
select picked one at random, so half the time Acquire refused a free lock
with the context error. The file-lock half of acquire already tries once
before it looks at ctx; the in-process half now takes an available token
first too. A held lock still fails at once once the deadline has passed.

This is the failure behind the unsealed evidence bundles on Windows CI.
TestPlanCriterionIsVerifiedByItsStepsCommands (studio run 38664267053)
reported "bundle not sealed: failure trusted_state.unwritable, contract
failure """ after 3.09 s: sealShadowBundle's two-second sealWait covers
the contract seal and object writes as well as the lock wait, so slow
writes spent it, and the bundle's own Append then met a free stream lock
with an expired ctx. With the first write slowed by 2.2 s, 1 of 6 turns
ended unsealed with that exact signature before this change, 0 of 6 after.
2026-10-15 18:14:22 +08:00
esengine b44514d8b1 feat(studio): the working session's tab dot breathes 2026-10-15 03:02:04 -07:00
YHH d7ce590b16 Merge pull request #13218 from esengine/fix/13213-stale-page
feat(studio): a hosted page left open across a deploy says it is not the latest build
2026-10-15 03:01:53 -07:00
YHH 92f8237356 Merge branch 'studio' into fix/memory-expired-pinned-guidance 2026-10-15 02:56:05 -07:00
YHH 20c01d470a Merge pull request #13256 from esengine/fix/13013-fold-unseen-changes
fix(agent): do not refuse a fold for changes the summarizer was never shown
2026-10-15 02:39:49 -07:00
esengine ed488806dc fix(agent): do not refuse a fold for changes the summarizer was never shown 2026-10-15 02:29:47 -07:00
YHH 2ca2a9b53c Merge pull request #13216 from esengine/feat/13210-ask-countdown
feat(ask): show the countdown to an ask-timeout skip and stop it when the question is taken over
2026-10-15 01:40:34 -07:00
YHH 8372c30ed1 Merge pull request #13224 from esengine/ci/let-studio-pushes-finish
ci: let a push to studio finish instead of cancelling the run before it
2026-10-15 01:32:30 -07:00
esengine dbf09924f9 feat(ask): show the countdown to an ask-timeout skip and stop it when the question is taken over 2026-10-15 01:29:16 -07:00
YHH a563a06e24 Merge pull request #13243 from esengine/feat/feedback-account-link
feat(feedback): link an install to the signed-in account only when the person asks
2026-10-15 01:24:12 -07:00
esengine e96af1ff8d feat(feedback): link an install to the signed-in account only when the person asks 2026-10-15 01:16:25 -07:00
YHH 201424f7f7 Merge pull request #13234 from par73e/fix/12780-workspace-branch-latency
perf(studio): reduce latency after selecting a Git branch
2026-10-15 00:51:47 -07:00
YHH f8223c51b4 Merge pull request #13225 from esengine/feat/13221-delete-with-copies
feat(studio): deleting a conversation can take its recovery copies along
2026-10-15 00:50:45 -07:00
YHH 0290335f25 Merge pull request #13203 from chuiwenwei/fix/memory-recall-freshness
fix(memory): re-check a delivered fact by reading its own file, not its stat
2026-10-15 00:50:00 -07:00
Will c438c5532c fix(sessionstore): recover only a torn final checkpoint record
Keeping the decoded prefix across ANY decode error dropped every record after
a mid-file break, and that truncated prefix then competed as a checkpoint that
extends the replay. Damage before the last record now refuses the checkpoint.
2026-10-15 15:18:43 +08:00
Will 9044392d84 fix(session): audit every automatic-recall suppression identically
recallTail had three outcomes and only two reached the audit channel: a
carried memory note and a normal recall each recorded a content-free
decision, while the retrieval ablation switch returned silently and left
lastRecall pointing at an earlier turn. A trajectory could not tell
"retrieval switched off" from "recall found nothing" from "suppressed by a
carried note".

All three now record a RecallResult and emit one memory-recall audit. The
identity travels as a typed memory.SuppressionCode on its own field, from
RecallResult through event.MemoryRecallAudit into the trajectory record's
suppression_code. The prose sentence stays exactly as it was, for readers
only: consumers match the typed field and never split the code out of the
text, so wording cannot become load-bearing again. The new field is additive
and omitempty, so existing records and batches decode unchanged.

The ablated turn also records lastRecall, matching the note path: the
diagnostic surface is defined as the last real turn's decision, and that
turn did decide not to retrieve.
2026-10-15 15:13:33 +08:00
Will cd355b6e4a fix(context-retrieval): keep failed runs out of the boundary report
reportBoundaries folded every row into byKey, so a run that never produced a
transcript re-entered the cue-boundary table as a zero measurement after the
funnel, dose and reformulation exits had excluded it. Skip failed rows, count
them, and say scored=0 with the failed count when nothing is left to compare.
2026-10-15 15:12:52 +08:00
Will 0485537024 fix(context-retrieval): stop scoring runs that never produced a transcript
A run that failed before its first model turn was appended as a zero-valued
contextMetrics, so results.jsonl gained an empty row, summarize counted it in
Scored and its stage tables, and batch.json reported it as completed with an
empty task id. Stamp such a run with its task, arm and NoEvidence stage, mark it
failed, and keep it out of every statistic while counting it in the manifest as
failed_runs.
2026-10-15 15:03:53 +08:00
par73e 416dd550d2 perf(studio): reduce latency after selecting a Git branch 2026-10-15 14:56:01 +08:00
Will c8054adf8e fix(checkpoint): keep turn numbering above unreadable checkpoint files
load() dropped a turn file that existed but would not read, so a resumed
session numbered the next turn below it and Begin overwrote the only copy
of that snapshot. The store now reserves those turn numbers in memory:
NextTurn() counts them and UnreadableTurns() names them, while Bounds()
and List() still expose only readable checkpoints. No new on-disk state.
2026-10-15 14:51:40 +08:00
Will a345688087 test(checkpoint): pin turn-number reuse after an unreadable checkpoint
A persisted turn-N.json that cannot be read is dropped by load() exactly
like an absent one, so NextTurn() restarts below it and the next Begin
overwrites the only copy. This test operates on a real truncated file
written by the store's own persist path.
2026-10-15 14:51:37 +08:00
Will ac625731ba fix(sessionstore): keep the turns a torn checkpoint still decodes
checkpointExtendingReplay read the .jsonl checkpoint with the strict loader
and folded a decode error into "this checkpoint does not extend the log".
The in-place append in appendSessionDisplayReadModel is exactly the write a
crash leaves half done, so the torn checkpoint's own intact lines were
discarded with it: resolveReplayedMessages then returned the shortened
replay with err == nil, and the next save rewrote both the checkpoint and
the log from that shorter transcript. Every turn the checkpoint still held
was lost permanently.

Decode tolerantly the way transformAndCopyJsonl already does, and keep the
existing prefix checks, so the tolerant result is adopted only when it
still extends the replayed prefix. A checkpoint that cannot yield a usable
prefix (unreadable, shorter, contradicting) keeps today's "does not extend"
behaviour; there is no third state.
2026-10-15 14:47:15 +08:00
Will ea10a83fd0 fix(memory): track the remembered fact and settle a reloaded change
Two gaps in the delivered-fact re-check this branch added:

- applyWrite kept the pre-reload stamps of the facts the model already
  holds, so a change that one reload had settled was re-detected by every
  later recall: the snapshot reloaded and the whole store was re-tokenized
  on each turn until a recall returned hits. Re-stamp the kept facts
  against the snapshot just loaded, dropping what it found gone, so the
  steady state stays one read of each delivered fact's own file. The
  pre-branch code cleared the set on reload, which is why this is not a
  new promise.

- The remember tool's typed Memory was discarded at the queue: the note
  carries prose and the controller must not parse it back into memory, so
  a fact the model wrote itself was absent from the delivered set and an
  external edit before the next recall served the stale session snapshot.
  memory.Queue now carries the typed facts the tool wrote, remember passes
  result.Memory, and the controller records it as delivered. The model's
  own write still queues no turn-tail note.

Adds the delivery/change matrix (100 cells over delivery x change time x
change shape) with the reload-count companion, and the provider-boundary
regression for the remember path.
2026-10-15 14:36:54 +08:00
Will 2c5ed024f5 fix(memory): re-check a delivered fact by reading its own file, not its stat
Problem: a fact saved through Controller.SaveMemory and then edited outside the
session is still recalled from the stale snapshot on the next turn; the per-turn
re-check that catches external edits compared each recalled fact with a stat, so
a rewrite that preserved the file's byte length and modification time stayed
invisible and the model kept reading the stale body; and the identity read behind
that stat, Store.Read, resolves a name by listing the whole store directory and
parsing every fact in it.

Root cause: the re-check set held only the previous recall's hits. A save queues
a turn-tail note, and a note suppresses recall for that turn, so a just-saved
fact was never a hit and so was never re-checked. Its check also rested on size
plus modification time, which is not semantic equality -- the repository's
context-projection rule says freshness detection must not rest on mtime.

Fix: baseline the facts the previous turn handed the model -- the previous
recall's hits, plus the facts a write note carried -- with a digest of each
fact's own file, read once at the canonical path its scope and slug name. Before
a recall tail is built those files are re-read directly and their digests
compared: different bytes reload the snapshot, identical bytes never do. The
stamp carries no size and no modification time, so no stat result can decide
that a fact is unchanged; the bytes are the semantic version because they are
exactly what the renderer turns into the model-visible fact. Store.Read stays as
the fallback for a fact whose file is not where its name says.

Cost: one read of each delivered fact's own file per recall, plus one when it is
baselined and, on that baseline, one parse of the same file to confirm the stamp
describes the delivered fact; a snapshot reload only when a delivered fact's
bytes differ or its file is gone. A formatting-only external rewrite re-reads the
fact into the snapshot even though the parsed fact is equal -- the safe
direction. A fact edited into relevance that the previous turn never handed over
stays invisible until the session reloads; no full scan, which
docs/SESSION_MEMORY_RETRIEVAL.md now states, along with the no-hit retention and
the identity fallback.

This extends the merged fix in 99fe3dbbf, which covers the recall-hit path only.

Review round 1 fixed two regressions in this baseline:

- A fact edited between the snapshot load and its first recall was tracked with
  the edited file's own digest, so the stamp described bytes the turn never
  carried and SameContent() then called the stale snapshot body unchanged
  forever. stampFact now marks a fact tracked only when the one file it just
  digested re-parses to the very fact being delivered (memory.FactAt + sameFact,
  the comparison the untracked fallback already used); otherwise it records the
  fact untracked and the identity read decides. The probe stays on that one file,
  so no listing and no second scan come back.

- recordDelivered overwrote the delivered set on every recall, so a turn that hit
  nothing erased the facts the previous turn was still holding and the next
  recall had nothing left to re-check. It now keeps the previous set when this
  recall returned no hits, while still appending the facts a write note carried.

Verification: a same-size/preserved-mtime rewrite is asserted first at the
Compose boundary (red on the stat-based check) and then at the true provider
boundary, through the real Build stack with a recording provider that shows the
refreshed body in the request the executor actually sends. The tracked path's
freedom from directory listing is asserted by arming the memory package's
read-dir seam to fail while stamping and while re-checking; FactAt is pinned to
the same single file. Both new tests go red with the stat-based conclusion
restored behind the same API and green with it removed.
TestRecallReloadsAFactEditedBeforeItsFirstRecall (seed, load, rewrite, Compose
twice) and TestRecallKeepsCheckingAfterATurnWithNoHits (recall A, an unrelated
no-hit turn, edit A, ask again) are red on the pre-fix behaviour and green now.
Each review fix was reverted alone with both tests kept: the first test goes red
and the second passes, and the reverse for the other. Go tests, vet, gofmt,
golangci-lint (0 issues) and make check (repolint: clean).

Refs #12948
2026-10-15 14:28:17 +08:00
YHH 61337d9940 Merge pull request #13226 from esengine/fix/13217-retry-inconclusive-open
fix(git): give a session whose git did not answer one second attempt at its repository
2026-10-14 23:15:59 -07:00
esengine d83661f9b0 fix(git): give a session whose git did not answer one second attempt at its repository 2026-10-14 23:04:02 -07:00
YHH b7eba48e91 Merge pull request #13223 from esengine/fix/13221-delete-with-copies
fix(studio): a refused settings save says where to see and repair the broken config
2026-10-14 23:03:54 -07:00
YHH d97c576e03 Merge pull request #13222 from esengine/fix/13217-git-absence-reason
fix(git): say why a folder with a .git has no repository identity
2026-10-14 22:48:32 -07:00
esengine ddc48fd74b fix(studio): a refused settings save says where to see and repair the broken config 2026-10-14 22:47:46 -07:00
esengine 35ba5eb42d ci: let a push to studio finish instead of cancelling the run before it 2026-10-14 22:46:24 -07:00
esengine d8dbd38070 feat(studio): deleting a conversation can take its recovery copies along 2026-10-14 22:46:17 -07:00
YHH 1d1d8730ff Merge branch 'studio' into fix/memory-expired-pinned-guidance 2026-10-14 22:44:52 -07:00
esengine 38e7d7a628 fix(git): say why a folder with a .git has no repository identity 2026-10-14 22:38:53 -07:00
esengine adb00dd7fa feat(studio): a hosted page left open across a deploy says it is not the latest build 2026-10-14 22:19:52 -07:00
YHH a20d34351f Merge pull request #13211 from esengine/test/request-cost-budget
test(serve): budget the plugin package parses a hot endpoint may cost
2026-10-14 21:44:22 -07:00
esengine 2e8634d735 test(serve): budget the plugin package parses a hot endpoint may cost 2026-10-14 21:33:05 -07:00
YHH b58734ee4e Merge pull request #13209 from esengine/perf/complete-args-loads
perf(control): completing command arguments loads each config once
2026-10-14 21:31:14 -07:00
YHH 87823024e6 Merge pull request #13208 from esengine/fix/13204-close-unknown-runtime
fix(serve): closing a runtime the hub no longer holds is typed, and the port treats it as closed
2026-10-14 21:25:54 -07:00
YHH 557a387518 Merge pull request #13206 from esengine/feat/13108-task-slots
fix(mcp): promoted task jobs do not hold the inline task slots
2026-10-14 21:22:43 -07:00
YHH 0437ca8982 Merge pull request #13207 from esengine/perf/complete-abort
perf(studio): abandon a completion request a newer keystroke has made stale
2026-10-14 21:21:38 -07:00
esengine 8feb1adb9b perf(control): completing command arguments loads each config once 2026-10-14 21:19:00 -07:00
esengine 2a3d9b7d61 fix(serve): closing a runtime the hub no longer holds is typed, and the port treats it as closed 2026-10-14 21:17:23 -07:00
esengine 2b191c3dc5 perf(studio): abandon a completion request a newer keystroke has made stale 2026-10-14 21:12:15 -07:00
esengine 28ccd2db41 fix(mcp): promoted task jobs do not hold the inline task slots 2026-10-14 21:07:33 -07:00
YHH f87b34184a Merge pull request #13200 from chuiwenwei/fix/memory-cross-scope-identity
fix(memory): identify the cross-scope name refusal and hand back both ids
2026-10-14 21:05:42 -07:00
YHH e598d482e7 Merge pull request #13205 from esengine/perf/13197-complete-loads
perf(control): completing a command name reads no package, config or memory data
2026-10-14 20:59:18 -07:00
esengine 38632c72d7 perf(control): completing a command name reads no package, config or memory data 2026-10-14 20:49:53 -07:00
YHH 16936dc139 Merge pull request #13199 from esengine/feat/13195-menu-autoname
feat(studio): auto-name a session from the sidebar menu
2026-10-14 20:49:01 -07:00
YHH c2ebf7bd56 Merge pull request #13202 from esengine/feat/13108-mcp-tasks-job
feat(mcp): continue a task that outran its timeout as a background job
2026-10-14 20:48:11 -07:00
esengine efb2418dfa feat(mcp): continue a task that outran its timeout as a background job 2026-10-14 20:41:05 -07:00
esengine d0d73fcc0f feat(studio): auto-name a session from the sidebar menu 2026-10-14 20:39:27 -07:00
YHH b47f0e45d2 Merge pull request #13198 from esengine/fix/13194-flow-top-feather
fix(studio): fade the tab strip's lower edge over a wallpaper
2026-10-14 20:37:05 -07:00
esengine 1cd7705536 fix(studio): fade the tab strip's lower edge over a wallpaper 2026-10-14 20:27:51 -07:00
YHH 95888d14fd Merge pull request #13193 from esengine/feat/13108-mcp-tasks-sync
feat(mcp): follow a tool call the server answers as a task to its result
2026-10-14 20:01:58 -07:00
YHH e506bf7de2 Merge pull request #13190 from esengine/feat/13110-skill-dir-install
feat(skill): read and show the specification's license, compatibility and metadata
2026-10-14 19:55:55 -07:00
esengine 091995c737 fix(skill): bound the served license, compatibility and metadata 2026-10-14 19:40:29 -07:00
YHH 4234059fa6 Merge pull request #13192 from esengine/fix/13048-feedback-entry
fix(studio): draw the sidebar's feedback entry in the accent colour
2026-10-14 19:39:54 -07:00
Will d2464b59c4 fix(memory): keep expired facts out of pinned guidance
An explicit expiry is a hard boundary: the fact index and automatic recall drop
the fact past it, and the memory tool paths report it as expired. Pinned guidance
did not check it, so an expired body kept riding the stable prefix, an expired
project fact kept shadowing the live global guidance it used to override, and an
expired body kept consuming the pinned budget that bounds what the prefix sends.

Both places now skip facts that are past their expiry, so the prefix, the shadow
rule and the budget agree with the index and recall. This covers facts that are
already expired when the session loads them; withdrawing a pinned body that
crosses its expiry mid-session is a separate prefix question.
2026-10-15 10:37:42 +08:00
Will bbda70c670 fix(memory): identify the cross-scope name refusal and hand back both ids
An unqualified save whose name was active in two scopes was refused with a bare
sentence. A code caller could not tell that refusal from a write failure, and
the model received neither the two ids the name could have meant nor a way to
say which fact it wanted.

The refusal now wraps ErrNameActiveInTwoScopes, so errors.Is separates a
cross-scope name collision from a write failure, and its sentence renders that
code, both active ids with their scopes, and the two ways out: update the fact
you meant by its stable id, or save with a scope-qualified name. The remember
tool returns this error verbatim, and the agent renders it as the model-facing
tool result, so the identity and both ids reach the model without a second,
drifting sentence.

Tests cover the identity and both ids at the store and at the tool, the refusal
leaving both facts at their own bytes and revision, and the two unambiguous
saves (stable id, scope-qualified name) still succeeding. A neighbouring test
pins that a name active in exactly one scope is still updated, not refused.
2026-10-15 10:37:42 +08:00
Will e4f6eb117b fix(memory): refuse an unqualified save whose name is active in two scopes
An unqualified name that was active in another scope was archived after the save
was published, so a failure there left the same name active twice, and the
archiving itself removed a fact the caller never named.

The collision is now reported before anything is written, and the post-commit
archiving is gone.
2026-10-15 10:37:42 +08:00
esengine ad37cd5302 feat(mcp): follow a tool call the server answers as a task to its result 2026-10-14 19:37:41 -07:00
esengine bcddb2963b fix(studio): draw the sidebar's feedback entry in the accent colour 2026-10-14 19:30:25 -07:00
YHH 0e41cd7947 Merge pull request #13189 from esengine/fix/trace-fixture-flake
test(serve): the trace fixtures do not compare two more measured clocks
2026-10-14 19:29:05 -07:00
esengine 02cd4622d9 feat(skill): read and show the specification's license, compatibility and metadata 2026-10-14 19:20:31 -07:00
esengine 29bca265b3 test(serve): the trace fixtures do not compare two more measured clocks 2026-10-14 19:19:39 -07:00
YHH b1c2bc6756 Merge pull request #13187 from esengine/fix/13177-branch-stale-boundary
fix(control): refuse a running-turn branch whose recorded boundary names another prompt
2026-10-14 19:03:08 -07:00
YHH 361e56c298 Merge pull request #13186 from esengine/perf/13176-tree-canonical
perf(serve): do not canonicalise every listed session path in /tree
2026-10-14 18:58:21 -07:00
esengine 25c2b4ec91 fix(control): refuse a running-turn branch whose recorded boundary names another prompt 2026-10-14 18:53:18 -07:00
YHH c05f72c582 Merge pull request #13185 from esengine/feat/13177-branch-closed-turn-while-running
feat(studio): branch a conversation from its latest finished reply while it runs
2026-10-14 18:49:38 -07:00
esengine 0392ffed05 perf(serve): do not canonicalise every listed session path in /tree 2026-10-14 18:49:13 -07:00
YHH c442b018c4 Merge pull request #13183 from esengine/fix/13180-open-error-class
fix(serve): a file that cannot be opened is not reported as missing
2026-10-14 18:40:50 -07:00
esengine e9da355450 feat(studio): branch a conversation from its latest finished reply while it runs 2026-10-14 18:39:33 -07:00
YHH acee6497d3 Merge pull request #13182 from esengine/fix/13179-daily-desc
fix(studio): list the newest day first in the daily usage table
2026-10-14 18:38:56 -07:00
YHH abac8621e9 Merge pull request #13181 from esengine/fix/13178-context-card-hover
fix(studio): keep the context card open while the pointer crosses to it
2026-10-14 18:34:00 -07:00
esengine a39b4b1cac fix(serve): a file that cannot be opened is not reported as missing 2026-10-14 18:31:25 -07:00
esengine 6a3cd375cb fix(studio): list the newest day first in the daily usage table 2026-10-14 18:29:13 -07:00
esengine dffb4787e6 fix(studio): keep the context card open while the pointer crosses to it 2026-10-14 18:24:33 -07:00
YHH 9862aa5f84 Merge pull request #13175 from kevin9327/fix/gitstatus-rename-numstat
fix(gitstatus): count lines on renamed and copied paths
2026-10-14 18:11:12 -07:00
kevin9327 281caed006 fix(gitstatus): count lines on renamed and copied paths
git diff --numstat -z writes a rename or copy as the counts, a trailing
tab, then the old and new paths as their own NUL fields. Trimming that
record removed the tab, so the parser treated it as a short line and
dropped it. Status and Summary then reported no line counts for the
change. The counts stay on the new path, which is the name status lists.
2026-10-15 00:14:07 +00:00
kevin9327 1023ea7bcb test(gitstatus): cover rename and copy numstat records
git diff --numstat -z emits a rename or copy as the counts, a tab, NUL,
the old path, NUL, and the new path. Status and Summary need those counts
on the destination, beside an ordinary edit in the same diff.
2026-10-15 00:14:07 +00:00
2220 changed files with 134605 additions and 7533 deletions

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
name: acp-conformance
# The agent is driven over stdio by the official ACP TypeScript SDK, and every
# message it writes is held to the schema that SDK ships. Not a required check:
# it runs when the ACP frontend or the harness changes, and on request.
on:
pull_request:
branches: [main-v2, studio]
paths:
- "internal/frontend/acp/**"
- "tools/acp-conformance/**"
- ".github/workflows/acp-conformance.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: acp-conformance-${{ github.ref }}
cancel-in-progress: true
jobs:
conformance:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: "22"
- run: make acp-conformance
+8 -2
View File
@@ -15,7 +15,7 @@ permissions:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Cheap path gate for pull requests. PRs confined to docs/release-notes
@@ -88,7 +88,7 @@ jobs:
with:
go-version-file: go.mod
cache: true
- run: node --test scripts/linux-install-smoke.test.mjs scripts/studio-artifacts.test.mjs scripts/ci-platform-scope.test.mjs scripts/cli-archive-build.test.mjs scripts/release-credits.test.mjs scripts/update-contributors.test.mjs scripts/update-acknowledgments.test.mjs scripts/markdown-refs.test.mjs scripts/studio-release-notes.test.mjs scripts/publish-cli-pointer.test.mjs scripts/studio-release-flags.test.mjs scripts/studio-notes-publish.test.mjs scripts/withdraw-version.test.mjs scripts/brew-cask-guard.test.mjs scripts/feedback-sync.test.mjs npm/publish.test.mjs
- run: node --test scripts/linux-install-smoke.test.mjs scripts/studio-artifacts.test.mjs scripts/ci-platform-scope.test.mjs scripts/cli-archive-build.test.mjs scripts/cli-archive-contents.test.mjs scripts/release-credits.test.mjs scripts/update-contributors.test.mjs scripts/update-acknowledgments.test.mjs scripts/markdown-refs.test.mjs scripts/studio-release-notes.test.mjs scripts/publish-cli-pointer.test.mjs scripts/studio-release-flags.test.mjs scripts/studio-notes-publish.test.mjs scripts/withdraw-version.test.mjs scripts/brew-cask-guard.test.mjs scripts/feedback-sync.test.mjs npm/publish.test.mjs
# The ruleset requires the per-OS check names (test (ubuntu-latest) etc.).
# A matrix job skipped at job level reports no per-leg checks at all, so
@@ -205,6 +205,12 @@ jobs:
WINDOWS_SANDBOX_WAIT_MS: "20000"
run: go test -count=1 -p 4 -timeout=18m ./internal/runtime/agent/... ./internal/platform/appidentity/... ./internal/assembly/boot/... ./internal/state/checkpoint/... ./internal/frontend/cli/... ./internal/session/control/... ./internal/base/filelock/... ./internal/base/fileutil/... ./internal/ext/hook/... ./internal/state/instruction/... ./internal/ext/mcplaunch/... ./internal/platform/notify/... ./internal/base/proc/... ./internal/platform/remote/... ./internal/platform/repair/... ./internal/safety/sandbox/... ./internal/base/sysproxy/... ./internal/state/workspacelease/... ./cmd/...
# Worktree rollback is absent from the broad Windows PR smoke list.
- name: test (Windows worktree rollback)
if: env.RUN_STEPS == 'true' && runner.os == 'Windows' && github.event_name == 'pull_request'
timeout-minutes: 3
run: go test -count=1 -timeout=2m -run '^TestDiscardUnpublished.*OnWindows$|^TestCreateFromDetachedHEADAndOccupiedBranch$' ./internal/platform/worktree
# The general Windows PR smoke list intentionally omits internal/contract/tool.
# Keep the session-temp portability contract covered without widening the
# leg to every tool test: two real PowerShell launches must share the
+3 -3
View File
@@ -43,20 +43,20 @@ jobs:
if: matrix.branch != ''
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Initialize CodeQL
uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.language == 'go' && 'autobuild' || 'none' }}
- name: Perform CodeQL Analysis
if: matrix.branch == ''
uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
category: "/language:${{ matrix.language }}"
# Results from a checked-out line are filed under that line's ref, not the
# default branch the schedule happened to run from.
- name: Perform CodeQL Analysis (${{ matrix.branch }})
if: matrix.branch != ''
uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
category: "/language:${{ matrix.language }}"
ref: refs/heads/${{ matrix.branch }}
+30 -13
View File
@@ -389,6 +389,14 @@ jobs:
version="${{ needs.resolve.outputs.version }}"
bash scripts/linux-install-smoke.sh "dist/ReasonixStudio-linux-$arch.deb" "$arch" "${version#v}"
- name: Verify the AppImage
if: runner.os == 'Linux'
shell: bash
run: |
platform="${{ matrix.platform }}"
arch="${platform#linux/}"
bash scripts/verify-linux-appimage.sh "dist/ReasonixStudio-linux-$arch.AppImage" "$arch"
# With signing on, this leg only hands the bundle on: the signing jobs
# run nothing but the signer, and windows-package packages in between.
- name: Upload the unsigned Windows bundle for signing
@@ -900,12 +908,31 @@ jobs:
go-version-file: go.mod
cache: true
# The page every archive carries beside the executable, built once here
# rather than once per target: serve.FindPage looks for
# frontend-next/dist next to the binary.
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 10
run_install: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: "24"
cache: pnpm
cache-dependency-path: desktop/frontend-next/pnpm-lock.yaml
- name: Build the page
working-directory: desktop/frontend-next
run: pnpm install --frozen-lockfile && pnpm build
# Every target the release line claims to support, from one runner: the
# CLI is CGO-free, so none of them needs a toolchain of its own.
- name: Cross-compile and archive
env:
VERSION: ${{ needs.resolve.outputs.version }}
SHA: ${{ needs.resolve.outputs.sha }}
PAGE_DIR: desktop/frontend-next/dist
run: |
set -euo pipefail
mkdir -p dist
@@ -917,11 +944,7 @@ jobs:
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -trimpath \
-ldflags "-s -w -X main.version=$VERSION -X main.gitCommit=${SHA:0:12} -X main.buildTimeUTC=$built -X $pkg.linkedVersion=$VERSION -X $pkg.linkedRevision=$SHA" \
-o "reasonix$ext" ./cmd/reasonix
if [ "$os" = windows ]; then
zip -qj "dist/reasonix-$os-$arch.zip" "reasonix$ext"
else
tar czf "dist/reasonix-$os-$arch.tar.gz" "reasonix$ext"
fi
scripts/package-cli-archive.sh "$os" "$arch" "reasonix$ext" "$PAGE_DIR" dist
rm -f "reasonix$ext"
done
# The digest list the remote verifies against. Resolved on the
@@ -933,13 +956,7 @@ jobs:
# A release that published the archives without the digest list is worse
# than one that published neither: the routes resolve SHA256SUMS first.
- name: Check the set is complete
run: |
set -euo pipefail
for want in reasonix-darwin-amd64.tar.gz reasonix-darwin-arm64.tar.gz \
reasonix-linux-amd64.tar.gz reasonix-linux-arm64.tar.gz \
reasonix-windows-amd64.zip reasonix-windows-arm64.zip SHA256SUMS; do
[ -f "dist/$want" ] || { echo "::error::no dist/$want"; exit 1; }
done
run: python3 scripts/check-cli-archives.py dist
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
@@ -1190,7 +1207,7 @@ jobs:
fi
{
printf '%s\n\n' '---'
printf "**macOS** 已用 Developer ID 签名并公证,打开时不需要清除隔离属性。%s**Linux** Debian 系从 \`.deb\` 安装,Fedora、RHEL、openSUSE 等从 \`.rpm\` 安装(\`sudo dnf install ./ReasonixStudio-linux-amd64.rpm\`)。x86_64 用文件名带 amd64 的包,aarch64(统信 UOS、麒麟等)用带 arm64 的包。\n\n" "$windows"
printf "**macOS** 已用 Developer ID 签名并公证,打开时不需要清除隔离属性。%s**Linux** Debian 系从 \`.deb\` 安装,Fedora、RHEL、openSUSE 等从 \`.rpm\` 安装(\`sudo dnf install ./ReasonixStudio-linux-amd64.rpm\`)。x86_64 用文件名带 amd64 的包,aarch64(统信 UOS、麒麟等)用带 arm64 的包。也提供 \`.AppImage\`(只提供下载,不会自更新;需要 FUSE 2,或用 \`--appimage-extract-and-run\` 启动)。\n\n" "$windows"
printf "%s\n" "三个平台都能自更新:Linux 的 \`.deb\` 走自己的包(\`.rpm\` 的自更新尚未提供,请手动下载新包),Windows 运行下一个安装器,macOS 替换自身 bundle。"
} >> "$notes"
assets=()
+106 -3
View File
@@ -16,7 +16,7 @@ permissions:
concurrency:
group: studio-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
frontend:
@@ -141,27 +141,126 @@ jobs:
node perf/stickyfold.mjs
node perf/crumb.mjs
node perf/hoverradius.mjs
node perf/jump-ends.mjs
node perf/modelrows.mjs
node perf/explorersize.mjs
node perf/git-panel.mjs
node perf/session-move-to.mjs
node perf/shell-refused.mjs
node perf/rail-search-hold.mjs
node perf/session-move.mjs
node perf/session-ref.mjs
node perf/browser-full.mjs
node perf/mod-ui.mjs
node perf/codeeditor-size.mjs
node perf/action-icons.mjs
node perf/rowhit.mjs
node perf/tab-pip.mjs
node perf/context-card-hover.mjs
node perf/sessquick.mjs
node perf/sessionrows.mjs
node perf/wheel.mjs
node perf/branch-tooltip.mjs
node perf/branch-menu.mjs
node perf/image-preview.mjs
node perf/user-images.mjs
node perf/toast-anchor.mjs
node perf/addfolder-rest.mjs
node perf/scroll-jump.mjs
node perf/add-project-selects.mjs
node perf/setup-defer.mjs
node perf/search-toggle.mjs
node perf/narrow.mjs
node perf/settings-rows.mjs
node perf/narrow-steps.mjs
node perf/job-names.mjs
node perf/mcp-actions.mjs
node perf/web-access.mjs
node perf/peers-settings.mjs
node perf/provider-ports.mjs
node perf/peer-threads.mjs
node perf/text-size.mjs
node perf/fs-scale.mjs
node perf/composer-feel.mjs
node perf/side-panel.mjs
node perf/card-shell.mjs
node perf/line-cards.mjs
node perf/detail-panel.mjs
node perf/brand-lockup.mjs
node perf/notice-line.mjs
node perf/brought-line.mjs
node perf/modal-focus.mjs
node perf/focus-ring.mjs
node perf/narrow-forms.mjs
node perf/i18n-rendered.mjs
node perf/narrow-rail.mjs
node perf/selfcheck.mjs branch-tooltip
# What a hosted page does over the relay, end to end: the production bundle,
# the real Studio host and kernel, a real Chromium; only the accounts API and
# the relay are stand-ins (tools/relayfake). Event-transport changes are
# judged here, because a unit test of one side cannot see the other.
relay-harness:
name: relay harness
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- name: Transport changed?
id: scope
env:
BASE_REF: ${{ github.base_ref }}
run: |
paths="desktop/frontend-next internal/frontend/serve internal/platform/remotecloud internal/platform/account tools/relayfake cmd/reasonix-studio-host"
if [ "$GITHUB_EVENT_NAME" = "pull_request" ] &&
git diff --quiet "origin/$BASE_REF...HEAD" -- $paths; then
echo "run=false" >> "$GITHUB_OUTPUT"
else
echo "run=true" >> "$GITHUB_OUTPUT"
fi
- if: steps.scope.outputs.run == 'true'
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
cache: true
- if: steps.scope.outputs.run == 'true'
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 10
run_install: false
- if: steps.scope.outputs.run == 'true'
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
with:
node-version: "24"
cache: pnpm
cache-dependency-path: desktop/frontend-next/pnpm-lock.yaml
- if: steps.scope.outputs.run == 'true'
name: Build the host, the stand-ins and the page
run: |
go build -o desktop/frontend-next/relay/bin/studio-host ./cmd/reasonix-studio-host
go build -o desktop/frontend-next/relay/bin/relayfake ./tools/relayfake
cd desktop/frontend-next
pnpm install --frozen-lockfile
pnpm exec vite build --outDir dist-relay --emptyOutDir
pnpm exec playwright install --with-deps chromium
- if: steps.scope.outputs.run == 'true'
name: Scenarios (hosted page over the relay; local page on a flapping network)
working-directory: desktop/frontend-next
env:
RELAY_HOST_BIN: ${{ github.workspace }}/desktop/frontend-next/relay/bin/studio-host
RELAY_FAKE_BIN: ${{ github.workspace }}/desktop/frontend-next/relay/bin/relayfake
RELAY_DIST: ${{ github.workspace }}/desktop/frontend-next/dist-relay
run: |
node relay/live.mjs
node relay/storm.mjs
# A pull request with no platform-relevant change (scripts/ci-platform-scope.sh)
# moves the Windows and macOS legs onto an ubuntu runner with every step
# skipped, so the check names still report without a scarce runner. A push to
@@ -267,7 +366,7 @@ jobs:
arm64=false
platform=$(git diff -z --name-only --no-renames "$BASE_SHA" HEAD | bash scripts/ci-platform-scope.sh)
if git diff --name-only --no-renames "$BASE_SHA" HEAD |
grep -qE '^(desktop/electron/|desktop/packaging/|desktop/cmd/update-helper/|desktop/cmd/studio-manifest/|desktop/go\.(mod|sum)$|cmd/reasonix-studio-host/|internal/platform/(update|appupdate)/|go\.(mod|sum)$|scripts/(linux-install-smoke|verify-linux-package|verify-studio-artifacts)\.sh$|scripts/(windows-signing-lib|verify-windows-package|verify-windows-authenticode|install-smoke)\.ps1$|\.github/workflows/(studio|release-studio)\.yml$)'; then
grep -qE '^(desktop/electron/|desktop/packaging/|desktop/cmd/update-helper/|desktop/cmd/studio-manifest/|desktop/go\.(mod|sum)$|cmd/reasonix-studio-host/|internal/platform/(update|appupdate)/|go\.(mod|sum)$|scripts/(linux-install-smoke|verify-linux-package|verify-linux-appimage|verify-studio-artifacts)\.sh$|scripts/(windows-signing-lib|verify-windows-package|verify-windows-authenticode|install-smoke)\.ps1$|\.github/workflows/(studio|release-studio)\.yml$)'; then
arm64=true
fi
fi
@@ -511,6 +610,10 @@ jobs:
if: runner.os == 'Linux'
run: bash scripts/linux-install-smoke.sh "dist/ReasonixStudio-linux-${{ matrix.arch }}.deb" "${{ matrix.arch }}" 0.0.0-ci
- name: The AppImage carries its architecture, the kernel and the page
if: runner.os == 'Linux'
run: bash scripts/verify-linux-appimage.sh "dist/ReasonixStudio-linux-${{ matrix.arch }}.AppImage" "${{ matrix.arch }}"
# Recorded, not asserted: the real bundle layout, so later work argues
# from what electron-builder produced rather than from its documentation.
- name: Record the macOS bundle layout
+1
View File
@@ -95,3 +95,4 @@ scripts/official-theme-art/__pycache__/
# running, which on Windows is every rebuild while Studio is open.
*.exe
*.exe~
/relayfake
+8 -1
View File
@@ -9,7 +9,7 @@ GOEXE := $(shell go env GOEXE)
# One pin for the Makefile and the CI lint job; see .github/workflows/ci.yml.
GOLANGCI_VERSION := $(shell cat .golangci-version)
.PHONY: build vet fmt lint lint-go lint-install lint-cross lint-update coverage-gate coverage-gate-update pricecheck check test studio-test sdk-test sdk-test-race hooks cross clean studio
.PHONY: build vet fmt lint lint-go lint-install lint-cross lint-update coverage-gate coverage-gate-update pricecheck acp-conformance check test studio-test sdk-test sdk-test-race hooks cross clean studio
build:
CGO_ENABLED=0 go build -ldflags "$(LDFLAGS)" -o bin/reasonix$(GOEXE) ./cmd/reasonix
@@ -87,6 +87,13 @@ lint-cross:
test: studio-test sdk-test
go test ./...
# Drives `reasonix acp` with the official ACP TypeScript SDK and holds every
# message it writes to the schema that SDK ships. Needs node and network for
# `npm ci`, which runs without install scripts against a lockfile.
acp-conformance: build
cd tools/acp-conformance && npm ci --ignore-scripts --no-audit --no-fund
cd tools/acp-conformance && REASONIX_BIN=$(CURDIR)/bin/reasonix$(GOEXE) npm test
# The shell is a nested module, so the root `test` target never reaches it.
studio-test:
cd desktop && go test ./...
+13 -2
View File
@@ -93,6 +93,16 @@ Prefer a terminal? Download the `reasonix` command-line tool, run `reasonix setu
All four are the same program underneath. What follows is for advanced users and contributors.
## Use it from DeepSeek Harness
DeepSeek Harness (`dsh`) can hand a task to Reasonix as a subagent over ACP. This repository publishes a plugin index for it:
1. Run `reasonix setup` on the machine that runs `dsh`. In the DSH Web UI turn on Custom plugin markets (Plugins, More) and add this index in the Discover tab: `https://raw.githubusercontent.com/esengine/DeepSeek-Reasonix/studio/integrations/dsh-plugin/market-index.json`
2. Install "Reasonix subagent" from it.
3. Open the plugin's page and turn its switch on. While it is off the model has no `reasonix` tool and may run `reasonix -p` in its own shell, which looks like a delegation and is not one.
Setup details, the permission policy and limits are in [Using Reasonix from DeepSeek Harness](./docs/DSH.md).
## Versions
Reasonix ships on two lines. See the [version roadmap announcement](https://github.com/esengine/DeepSeek-Reasonix/discussions/10748) for the reasoning behind the split.
@@ -151,7 +161,7 @@ pre-releases):
| --- | --- | --- |
| macOS | `.dmg` or `.zip` | Apple Silicon (`arm64`) / Intel (`amd64`) |
| Windows | Installer `-installer.exe` or portable `.zip` | x64 |
| Linux | `.deb` or `.rpm` | x64 (`amd64`) / ARM64 (`arm64`, aarch64) |
| Linux | `.deb`, `.rpm`, or `.AppImage` (download only) | x64 (`amd64`) / ARM64 (`arm64`, aarch64) |
Every package ships with a `.minisig` signature, and the release carries
`SHA256SUMS`. Once installed, Studio updates itself in place.
@@ -240,7 +250,8 @@ For advanced CLI usage and configuration, see the **[CLI reference](./docs/CLI.m
## Documentation
- **Getting started:** [Guide](./docs/GUIDE.md) · [CLI reference](./docs/CLI.md) ·
[Configuration paths](./docs/CONFIG_PATHS.md) · [ACP editor integration](./docs/ACP.md)
[Configuration paths](./docs/CONFIG_PATHS.md) · [ACP editor integration](./docs/ACP.md) ·
[Use from DeepSeek Harness](./docs/DSH.md)
- **Features & troubleshooting:** [Subagent profiles](./docs/SUBAGENT_PROFILES.md) ·
[Context Engine v2](./docs/SESSION_MEMORY_RETRIEVAL.md) ·
[Capability diagnostics](./docs/CAPABILITY_DIAGNOSTICS.md) ·
+12 -2
View File
@@ -91,6 +91,16 @@ Reasonix 是一个开源的 AI 编程助手。程序跑在你的电脑上;AI
四种用法背后是同一套程序。下面的内容写给进阶用户和贡献者。
## 在 DeepSeek Harness 里使用
DeepSeek Harness(`dsh`)可以通过 ACP 把任务交给 Reasonix 作为子智能体去做。本仓库为此发布了一个插件索引:
1. 在运行 `dsh` 的机器上先运行 `reasonix setup`。在 DSH 网页界面打开“自定义插件市场”(插件,更多),再到 Discover 页添加这个索引:`https://raw.githubusercontent.com/esengine/DeepSeek-Reasonix/studio/integrations/dsh-plugin/market-index.json`
2. 从中安装“Reasonix subagent”。
3. 打开这个插件的页面,把它的开关打开。关着的时候模型没有 `reasonix` 工具,可能改在自己的 shell 里直接运行 `reasonix -p`,看起来像委派,其实不是。
配置细节、权限策略和限制见 [在 DeepSeek Harness 中使用 Reasonix](./docs/DSH.md)。
## 版本
Reasonix 分为两条版本线,调整的原因见[版本路线公告](https://github.com/esengine/DeepSeek-Reasonix/discussions/10748)。
@@ -139,7 +149,7 @@ Reasonix 分为两条版本线,调整的原因见[版本路线公告](https://
| --- | --- | --- |
| macOS | `.dmg` 或 `.zip` | Apple Silicon(`arm64`)/ Intel(`amd64`) |
| Windows | 安装器 `-installer.exe` 或便携 `.zip` | x64 |
| Linux | `.deb` 或 `.rpm` | x64(`amd64`)/ ARM64(`arm64`,aarch64) |
| Linux | `.deb`、`.rpm` 或 `.AppImage`(只提供下载) | x64(`amd64`)/ ARM64(`arm64`,aarch64) |
每个安装包都附带 `.minisig` 签名,发布页另有 `SHA256SUMS`。安装后 Studio 会在
应用内自行更新。
@@ -221,7 +231,7 @@ CLI 进阶用法和详细配置见 **[CLI 命令参考](./docs/CLI.zh-CN.md)**
- **开始使用:** [指南](./docs/GUIDE.zh-CN.md) ·
[CLI 命令参考](./docs/CLI.zh-CN.md) · [配置路径](./docs/CONFIG_PATHS.md) ·
[ACP 编辑器接入](./docs/ACP.md)
[ACP 编辑器接入](./docs/ACP.md) · [在 DeepSeek Harness 中使用](./docs/DSH.md)
- **功能与排障:** [子智能体 Profile](./docs/SUBAGENT_PROFILES.md) ·
[Context Engine v2](./docs/SESSION_MEMORY_RETRIEVAL.md) ·
[能力诊断](./docs/CAPABILITY_DIAGNOSTICS.md) ·
+4
View File
@@ -373,6 +373,10 @@ out of how a path is spelled, which cannot tell `internal/auth` from
- sensitive: internal/safety/egress/**
- sensitive: internal/platform/browser/**
- sensitive: internal/platform/computer/**
- sensitive: internal/platform/gitpush/**
- sensitive: internal/session/control/git_push.go
- sensitive: internal/frontend/serve/git_push.go
- sensitive: internal/frontend/serve/host_routes.go
One declaration, two effects: the same list is also the coverage gate's subject.
`make coverage-gate` holds each path to the coverage it already has, because
@@ -0,0 +1,35 @@
# Compaction prefix probe
## Method
1. Measured on 2026-10-17 against the official `https://api.deepseek.com` OpenAI adapter, using the model returned by `/models`: `deepseek-flash`. Thinking was disabled. Inputs were synthetic; no workspace history or credentials are recorded here.
2. Each of three text and three rich-history trials sent a main request to warm the prefix, then called the actual agent summary path, then an independent summary control. Rich history included a synthetic closed `read_file` call, result and reasoning. Warmup outputs were discarded, never executed.
3. A summary had a 1,024-token output cap; warmups had 64. Success means a heading, preservation of the fixture's `ParseDuration` and zero-value constraint, no emitted tool calls, and `finish_reason=stop`. This checks the fixture's contract, not arbitrary-summary factual completeness.
4. First-attempt reuse success counts successful reused summaries / six reused summaries. Fallback rate counts independent requests initiated by the reuse coordinator / six reuse trials; the six explicit independent controls are excluded. Both were 6/6 success and 0/6 fallbacks. Independent controls also succeeded 6/6.
5. The raw result file records provider-reported usage and full stream latency, measured from adapter `Stream` until channel close. Token rows below sum only the three indicated summary requests; they exclude warmup, model listing and any earlier exploratory requests. Cache residency was uncontrolled; prior probes had warmed these synthetic prefixes.
## Results
| History | Shape | N | Prompt | Hit | Miss | Output | Median ms | Estimated USD |
| --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| Text | Reused | 3 | 3,714 | 3,072 | 642 | 636 | 1,713 | 0.000487116 |
| Text | Independent | 3 | 1,218 | 768 | 450 | 644 | 1,610 | 0.000456204 |
| Rich | Reused | 3 | 3,780 | 3,072 | 708 | 742 | 1,774 | 0.000560616 |
| Rich | Independent | 3 | 1,341 | 768 | 573 | 921 | 1,815 | 0.000640854 |
1. Estimates use the [official pricing](https://api-docs.deepseek.com/quick_start/pricing/) checked on the measurement date: off-peak Flash USD per million tokens, hit 0.003, miss 0.15, output 0.6. October 17 was a Saturday. Formula: `(hit*0.003 + miss*0.15 + output*0.6)/1_000_000`. These are token estimates, not account deductions.
2. Reuse hit fractions were 82.7% (text) and 81.3% (rich), versus 63.1% and 57.3% for controls. This small fixture does **not** establish cost savings: retaining the system/catalog increased both total input and input cost. Text total cost increased 6.8%; rich total decreased 12.5% because output was shorter, not because input was cheaper.
3. The six warmups consumed 7,032 prompt and 231 output tokens, estimated USD 0.000346680. All 18 recorded generation calls together cost an estimated USD 0.002491470. No failed-digest retry occurred in these live trials; the deterministic fallback tests establish its behavior and accounting.
4. A rejected nonempty reused answer earns one independent-shape fallback. A separate truncation retry may enlarge the output cap, for at most three logical model calls total. Every actual attempt emits and records its own spend; returned usage is their sum. Empty output, stream errors and cancellation do not earn shape retries.
5. These sequential, six-pair trials establish interoperability for one model, mode and short fixture. They do not estimate production failure probability, thinking-mode behavior, other models, cold-cache cost, or large-history savings.
## Reproduction
1. Provide a test key through an existing secret environment configuration. Do not put credentials in source, command arguments or captured logs. Select a model currently returned by `/models`.
2. Run the opt-in probe; it skips without `DEEPSEEK_API_KEY`. The dedicated build tag avoids enabling unrelated live tests.
```sh
REASONIX_LIVE_MODEL=deepseek-flash go test -tags live_compaction ./internal/runtime/agent -run '^TestLiveCompactionPrefix$' -v -count=1
```
3. This probe exercises actual summary construction and the HTTP adapter. The hermetic `TestEffectCompactionSharesThePreviouslySentPrefix` separately exercises manual, automatic pressure and rich history through `boot.Build`, comparing actual JSON request-prefix and schema bytes. Its sparse-history case also proves an interleaved retained user turn survives the fold.
@@ -0,0 +1,512 @@
[
{
"model": "deepseek-flash",
"rich": false,
"trial": 1,
"results": [
{
"kind": "warm",
"milliseconds": 828,
"digest": false,
"grounded": false,
"tool_calls": 1,
"usage": {
"PromptTokens": 1127,
"CompletionTokens": 38,
"TotalTokens": 1165,
"CacheHitTokens": 896,
"CacheMissTokens": 231,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "tool_calls",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "reuse",
"milliseconds": 2006,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 1238,
"CompletionTokens": 234,
"TotalTokens": 1472,
"CacheHitTokens": 1024,
"CacheMissTokens": 214,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "independent",
"milliseconds": 1817,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 406,
"CompletionTokens": 234,
"TotalTokens": 640,
"CacheHitTokens": 256,
"CacheMissTokens": 150,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
}
]
},
{
"model": "deepseek-flash",
"rich": false,
"trial": 2,
"results": [
{
"kind": "warm",
"milliseconds": 820,
"digest": false,
"grounded": false,
"tool_calls": 1,
"usage": {
"PromptTokens": 1127,
"CompletionTokens": 38,
"TotalTokens": 1165,
"CacheHitTokens": 896,
"CacheMissTokens": 231,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "tool_calls",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "reuse",
"milliseconds": 1633,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 1238,
"CompletionTokens": 187,
"TotalTokens": 1425,
"CacheHitTokens": 1024,
"CacheMissTokens": 214,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "independent",
"milliseconds": 1555,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 406,
"CompletionTokens": 202,
"TotalTokens": 608,
"CacheHitTokens": 256,
"CacheMissTokens": 150,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
}
]
},
{
"model": "deepseek-flash",
"rich": false,
"trial": 3,
"results": [
{
"kind": "warm",
"milliseconds": 905,
"digest": false,
"grounded": false,
"tool_calls": 1,
"usage": {
"PromptTokens": 1127,
"CompletionTokens": 38,
"TotalTokens": 1165,
"CacheHitTokens": 896,
"CacheMissTokens": 231,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "tool_calls",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "reuse",
"milliseconds": 1713,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 1238,
"CompletionTokens": 215,
"TotalTokens": 1453,
"CacheHitTokens": 1024,
"CacheMissTokens": 214,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "independent",
"milliseconds": 1610,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 406,
"CompletionTokens": 208,
"TotalTokens": 614,
"CacheHitTokens": 256,
"CacheMissTokens": 150,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
}
]
},
{
"model": "deepseek-flash",
"rich": true,
"trial": 1,
"results": [
{
"kind": "warm",
"milliseconds": 561,
"digest": false,
"grounded": false,
"tool_calls": 1,
"usage": {
"PromptTokens": 1217,
"CompletionTokens": 39,
"TotalTokens": 1256,
"CacheHitTokens": 1024,
"CacheMissTokens": 193,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "tool_calls",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "reuse",
"milliseconds": 1774,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 1260,
"CompletionTokens": 256,
"TotalTokens": 1516,
"CacheHitTokens": 1024,
"CacheMissTokens": 236,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "independent",
"milliseconds": 2271,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 447,
"CompletionTokens": 381,
"TotalTokens": 828,
"CacheHitTokens": 256,
"CacheMissTokens": 191,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
}
]
},
{
"model": "deepseek-flash",
"rich": true,
"trial": 2,
"results": [
{
"kind": "warm",
"milliseconds": 610,
"digest": false,
"grounded": false,
"tool_calls": 1,
"usage": {
"PromptTokens": 1217,
"CompletionTokens": 39,
"TotalTokens": 1256,
"CacheHitTokens": 1024,
"CacheMissTokens": 193,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "tool_calls",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "reuse",
"milliseconds": 2263,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 1260,
"CompletionTokens": 276,
"TotalTokens": 1536,
"CacheHitTokens": 1024,
"CacheMissTokens": 236,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "independent",
"milliseconds": 1783,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 447,
"CompletionTokens": 242,
"TotalTokens": 689,
"CacheHitTokens": 256,
"CacheMissTokens": 191,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
}
]
},
{
"model": "deepseek-flash",
"rich": true,
"trial": 3,
"results": [
{
"kind": "warm",
"milliseconds": 834,
"digest": false,
"grounded": false,
"tool_calls": 1,
"usage": {
"PromptTokens": 1217,
"CompletionTokens": 39,
"TotalTokens": 1256,
"CacheHitTokens": 1024,
"CacheMissTokens": 193,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "tool_calls",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "reuse",
"milliseconds": 1575,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 1260,
"CompletionTokens": 210,
"TotalTokens": 1470,
"CacheHitTokens": 1024,
"CacheMissTokens": 236,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
},
{
"kind": "independent",
"milliseconds": 1815,
"digest": true,
"grounded": true,
"tool_calls": 0,
"usage": {
"PromptTokens": 447,
"CompletionTokens": 298,
"TotalTokens": 745,
"CacheHitTokens": 256,
"CacheMissTokens": 191,
"CacheWriteTokens": 0,
"CacheWriteBilledTokens": 0,
"ReasoningTokens": 0,
"FinishReason": "stop",
"Estimated": false,
"RequestCount": 1,
"ServerToolRequests": 0,
"ContextPromptTokens": 0,
"ContextCompletionTokens": 0,
"ContextReasoningTokens": 0,
"ContextCacheHitTokens": 0,
"ContextCacheMissTokens": 0
}
}
]
}
]
@@ -0,0 +1,86 @@
package main
import (
"encoding/json"
"os"
"path/filepath"
"strings"
"testing"
)
// runBlockedBatch runs one dry index batch where every arm's runOne fails
// before any model turn: the task's own directory is a regular file, so the
// fixture cannot be built. In production the same early return happens when the
// fixture build, the session load, or the answer-on-disk guard fails.
func runBlockedBatch(t *testing.T) string {
t.Helper()
tk := indexTasks()[0]
root := t.TempDir()
if err := os.WriteFile(filepath.Join(root, tk.ID), []byte("not a directory\n"), 0o644); err != nil {
t.Fatal(err)
}
if code := runExperiment("run-index", experimentIndex, root, true, []contextTask{tk}); code != 0 {
t.Fatalf("runExperiment exit = %d, want 0 (every run failed, but the batch finished)", code)
}
return root
}
func readResultLines(t *testing.T, root string) ([]contextMetrics, []string) {
t.Helper()
raw, err := os.ReadFile(filepath.Join(root, "results.jsonl"))
if err != nil {
t.Fatal(err)
}
var runs []contextMetrics
var lines []string
for text := range strings.SplitSeq(strings.TrimSpace(string(raw)), "\n") {
var m contextMetrics
if err := json.Unmarshal([]byte(text), &m); err != nil {
t.Fatalf("results.jsonl: %v", err)
}
runs = append(runs, m)
lines = append(lines, text)
}
return runs, lines
}
// A run that failed before the model turn produced no measurement. Recording it
// as a zero-valued contextMetrics puts it in the funnel's Scored denominator,
// in "Where it broke", and in the dose curve as a real zero.
func TestBatchDoesNotRecordAFailedRunAsAResult(t *testing.T) {
root := runBlockedBatch(t)
runs, lines := readResultLines(t, root)
if len(runs) == 0 {
t.Fatal("no runs recorded at all")
}
for i, m := range runs {
if m.Task == "" || m.Arm == "" || m.FailureStage == "" {
t.Fatalf("results.jsonl line %d records a run that never ran as a result "+
"(task=%q arm=%q failure_stage=%q):\n %s", i+1, m.Task, m.Arm, m.FailureStage, lines[i])
}
}
}
// The manifest is the artefact that says which runs counted, so a failed run
// must not be added to CompletedRuns or to the task id list.
func TestBatchManifestDoesNotReportFailedRunsAsCompleted(t *testing.T) {
root := runBlockedBatch(t)
var manifest batchManifest
data, err := os.ReadFile(filepath.Join(root, "batch.json"))
if err != nil {
t.Fatal(err)
}
if err := json.Unmarshal(data, &manifest); err != nil {
t.Fatal(err)
}
for _, id := range manifest.TaskIDs {
if id == "" {
t.Fatalf("manifest lists an empty task id: task_ids=%q (completed=%d planned=%d)",
manifest.TaskIDs, manifest.CompletedRuns, manifest.PlannedRuns)
}
}
if manifest.CompletedRuns == manifest.PlannedRuns {
t.Fatalf("manifest reports every planned run completed although none produced evidence: "+
"completed=%d planned=%d task_ids=%q", manifest.CompletedRuns, manifest.PlannedRuns, manifest.TaskIDs)
}
}
+12 -2
View File
@@ -41,6 +41,10 @@ type batchManifest struct {
Arms []string `json:"arms"`
PlannedRuns int `json:"planned_runs"`
CompletedRuns int `json:"completed_runs"`
// FailedRuns counts the planned runs that ended before a transcript existed.
// They are rows in results.jsonl, never part of CompletedRuns, and the field
// is absent when there were none so an intact batch is unchanged.
FailedRuns int `json:"failed_runs,omitempty"`
// Usage totals are absent when nothing reported any: an unmeasured cost must
// not read as a measured zero. UsageReportedRuns stays, because zero there
// is a fact about the batch.
@@ -98,9 +102,15 @@ func sortedKeys(set map[string]bool) []string {
// last, so its digests are of what is already on disk.
func writeBatchManifest(root string, info batchInfo, all []contextMetrics) error {
ids, arms := map[string]bool{}, map[string]bool{}
var prompt, completion, cacheHit, cacheMiss, requests, reported int
var prompt, completion, cacheHit, cacheMiss, requests, reported, failed int
estimated := false
for _, m := range all {
// A failed run has no task, arm or evidence to contribute: it is counted
// as a failure below and is not part of what the batch measured.
if m.Failed {
failed++
continue
}
ids[m.Task] = true
arms[m.Arm] = true
if m.UsageReportedRequests > 0 {
@@ -125,7 +135,7 @@ func writeBatchManifest(root string, info batchInfo, all []contextMetrics) error
GitCommit: commit, GitDirty: dirty,
Model: model, Window: fixtureWindow, Generations: fixtureGenerations,
TaskIDs: sortedKeys(ids), Arms: sortedKeys(arms),
PlannedRuns: info.Planned, CompletedRuns: len(all),
PlannedRuns: info.Planned, CompletedRuns: len(all) - failed, FailedRuns: failed,
UsageReportedRuns: reported, UsageReportedRequests: requests,
PromptTokens: prompt, CompletionTokens: completion,
CacheHitTokens: cacheHit, CacheMissTokens: cacheMiss, UsageEstimated: estimated,
@@ -0,0 +1,69 @@
package main
import (
"strings"
"testing"
)
// boundaryRuns builds the input reportBoundaries reads: one scored run for an
// index task's cue side, and one failed run for another index task's cue side.
// The runs are constructed because the report is a pure function of the slice;
// the batch path that produces them is covered by the failed-batch tests.
func boundaryRuns(t *testing.T) (all []contextMetrics, scoredTask, failedTask string) {
t.Helper()
index := indexTasks()
if len(index) < 2 {
t.Fatalf("need at least two index tasks, have %d", len(index))
}
scored, failed := index[0], index[1]
cue, noCue := boundaryPair(scored.CueTier)
if cue == "" || noCue == "" {
t.Fatalf("task %s has an empty boundary pair (%q, %q)", scored.ID, cue, noCue)
}
failedCue, _ := boundaryPair(failed.CueTier)
if failedCue == "" {
t.Fatalf("task %s has no cue side", failed.ID)
}
all = []contextMetrics{
{Task: scored.ID, Arm: "index-" + cue, AnswerRecovered: true, SearchCalls: 1, RecallReturnedTokens: 318},
{Task: scored.ID, Arm: "index-" + noCue, AnswerRecovered: false},
{Task: failed.ID, Arm: "index-" + failedCue, Failed: true, FailureStage: stageNoEvidence},
}
return all, scored.ID, failed.ID
}
// TestBoundaryReportExcludesFailedRuns: a run that never produced a transcript
// must not appear in the cue-boundary table, which was the last reporting exit
// that still folded it in as a zero measurement.
func TestBoundaryReportExcludesFailedRuns(t *testing.T) {
all, scoredTask, failedTask := boundaryRuns(t)
out := captureStdout(t, func() { reportBoundaries(all) })
if strings.Contains(out, failedTask) {
t.Fatalf("the boundary table printed the failed task %q as a measurement:\n%s", failedTask, out)
}
if !strings.Contains(out, scoredTask) {
t.Fatalf("the boundary table dropped the scored task %q, so the exclusion is not specific to failures:\n%s", scoredTask, out)
}
if !strings.Contains(out, "cue-present") || !strings.Contains(out, "cue-absent") {
t.Fatalf("the pooled comparison disappeared:\n%s", out)
}
}
// TestBoundaryReportSaysNothingToCompareWhenEveryRunFailed: with no scored run
// the report must say so, rather than printing a comparison of zeros.
func TestBoundaryReportSaysNothingToCompareWhenEveryRunFailed(t *testing.T) {
all, _, _ := boundaryRuns(t)
failedOnly := make([]contextMetrics, 0, len(all))
for _, m := range all {
m.Failed = true
m.FailureStage = stageNoEvidence
failedOnly = append(failedOnly, m)
}
out := captureStdout(t, func() { reportBoundaries(failedOnly) })
if !strings.Contains(out, "scored=0") || !strings.Contains(out, "failed=") {
t.Fatalf("an all-failed batch did not report scored=0 with a failed count:\n%s", out)
}
if strings.Contains(out, "cue-present") || strings.Contains(out, "cue-absent") {
t.Fatalf("an all-failed batch still printed a pooled comparison of zeros:\n%s", out)
}
}
+16 -2
View File
@@ -18,7 +18,8 @@ import (
// canonical position, and never the model's prose. "I will search the history"
// is not a search; a recall call with a query is.
// failure stages, in funnel order. Exactly one is reported per run.
// failure stages, in funnel order. Exactly one is reported per run, except for
// NoEvidence: that stage belongs to a run with no measurement at all.
const (
stageReadMissed = "NoSearch" // never asked, and never read the target either
stageSearchMiss = "SearchMiss" // searched, target never came back
@@ -26,6 +27,7 @@ const (
stageAnswerWrong = "ReadButAnswerWrong" // opened it and still answered wrong
stageRecovered = "Recovered"
stageContaminated = "Contaminated"
stageNoEvidence = "NoEvidence"
// Routing is judged by model round, not by the linear order of tool events:
// two calls in one round are one parallel fan-out, and calling that
@@ -116,6 +118,12 @@ type contextMetrics struct {
FailureStage string `json:"failure_stage"`
TimeoutReason string `json:"timeout_reason,omitempty"`
// Failed marks a run that ended before a transcript existed: it has no score
// and no place in the statistics. The row stays in results.jsonl with its
// task, arm and stage, so a failure is counted rather than dropped.
Failed bool `json:"failed,omitempty"`
Reason string `json:"reason,omitempty"`
// UnexpectedWorkTools are investigation tools used instead of recall.
// Reaching for the workspace is behaviour, not noise: how a model routes
// its uncertainty when memory is missing is part of what is measured.
@@ -462,6 +470,12 @@ type funnel struct {
func summarize(arm string, runs []contextMetrics) funnel {
f := funnel{Arm: arm, Runs: len(runs), Stages: map[string]int{}, Routes: map[string]int{}}
for _, r := range runs {
// A run that never produced a transcript is not a scored run and has no
// stage to place: counting it would put an empty name in the funnel, the
// stage table and the routes.
if r.Failed {
continue
}
if r.Contaminated {
f.Contaminated++
f.Stages[r.FailureStage]++
@@ -631,7 +645,7 @@ func reportStopping(all []contextMetrics) string {
var extraRounds, extraTokens []float64
sufficient, answeredNext := 0, 0
for _, m := range all {
if m.Contaminated {
if m.Failed || m.Contaminated {
continue
}
classes[m.StoppingClass]++
+1 -1
View File
@@ -121,7 +121,7 @@ var doseMetrics = []struct {
func reportDoseResponse(all []contextMetrics) string {
valid := map[string]map[string]contextMetrics{}
for _, m := range all {
if m.Contaminated || m.FailureStage == "RunError" {
if m.Failed || m.Contaminated || m.FailureStage == "RunError" {
continue
}
scale := strings.TrimPrefix(m.Arm, "index-")
@@ -0,0 +1,306 @@
package main
import (
"encoding/json"
"os"
"path/filepath"
"reflect"
"strconv"
"strings"
"testing"
)
// blockTask makes one task fail before its first model turn: its own directory
// is a regular file, so buildFixture cannot create the session under it. It is
// the same early exit as a failed fixture build, session load, or
// answer-on-disk guard, and it needs no provider.
func blockTask(t *testing.T, root, id string) {
t.Helper()
if err := os.WriteFile(filepath.Join(root, id), []byte("not a directory\n"), 0o644); err != nil {
t.Fatal(err)
}
}
// mixedTaskPair is one task whose runs all fail and one whose runs all succeed.
// Both are drawn from the corpus, so the batch is the real pipeline.
func mixedTaskPair() (blocked, ok contextTask) {
blocked, ok = indexTasks()[0], indexTasks()[1]
for _, t := range indexTasks() {
if t.Role == roleEfficiency && len(armsFor(t)) == 2 {
ok = t
break
}
}
return blocked, ok
}
// runBlockedExperiment runs one dry index batch over the given tasks, with the
// named task failing before any model turn, and returns the batch directory, the
// runs, the manifest, and everything the run printed.
func runBlockedExperiment(t *testing.T, tasks []contextTask, blocked ...string) (string, []contextMetrics, batchManifest, string) {
t.Helper()
root := t.TempDir()
for _, id := range blocked {
blockTask(t, root, id)
}
out := captureStdout(t, func() {
if code := runExperiment("run-index", experimentIndex, root, true, tasks); code != 0 {
t.Errorf("runExperiment exit = %d, want 0 (the batch finished)", code)
}
})
runs, _ := readResultLines(t, root)
manifest, _ := readManifest(t, root)
return root, runs, manifest, out
}
// captureStdout reads everything the function prints. os.Pipe is unbuffered, so
// the reader must run beside the call.
func captureStdout(t *testing.T, f func()) string {
t.Helper()
r, w, err := os.Pipe()
if err != nil {
t.Fatal(err)
}
old := os.Stdout
os.Stdout = w
done := make(chan string, 1)
go func() {
var b strings.Builder
buf := make([]byte, 4096)
for {
n, err := r.Read(buf)
b.Write(buf[:n])
if err != nil {
break
}
}
done <- b.String()
}()
f()
os.Stdout = old
w.Close()
text := <-done
r.Close()
return text
}
// funnelScored reads the "runs=N" column of the named arm's funnel line out of
// the printed tables, so the assertion is on the number a reader sees.
func funnelScored(t *testing.T, out, arm string) int {
t.Helper()
for line := range strings.SplitSeq(out, "\n") {
fields := strings.Fields(line)
if len(fields) < 2 || fields[0] != arm || !strings.HasPrefix(fields[1], "runs=") {
continue
}
n, err := strconv.Atoi(strings.TrimPrefix(fields[1], "runs="))
if err != nil {
t.Fatalf("funnel line for %s: %v\n%s", arm, err, line)
}
return n
}
t.Fatalf("no funnel line for arm %s:\n%s", arm, out)
return 0
}
// The batch report states both counts on one line, so a reader of the scrollback
// sees the scored set and the failures without counting funnel rows.
func reportCounts(t *testing.T, out string) (scored, failed int) {
t.Helper()
for line := range strings.SplitSeq(out, "\n") {
if !strings.Contains(line, " scored=") || !strings.Contains(line, " failed=") {
continue
}
for f := range strings.FieldsSeq(line) {
switch {
case strings.HasPrefix(f, "scored="):
scored, _ = strconv.Atoi(strings.TrimPrefix(f, "scored="))
case strings.HasPrefix(f, "failed="):
failed, _ = strconv.Atoi(strings.TrimPrefix(f, "failed="))
}
}
return scored, failed
}
t.Fatalf("no line reports scored= and failed=:\n%s", out)
return 0, 0
}
// A batch that mixes a task that never ran with one that did must read as its
// successful runs only: the failed task leaves Scored, the funnel, and the
// completed count, and is reported as a failure with its identity instead.
// Every assertion here is a number, not the absence of an empty row.
func TestMixedBatchCountsOnlyTheRunThatProducedEvidence(t *testing.T) {
blocked, ok := mixedTaskPair()
_, runs, manifest, out := runBlockedExperiment(t, []contextTask{blocked, ok}, blocked.ID)
wantScored, wantFailed := len(armsFor(ok)), len(armsFor(blocked))
if manifest.CompletedRuns != wantScored || manifest.FailedRuns != wantFailed {
t.Fatalf("manifest completed=%d failed=%d, want %d and %d (planned=%d)",
manifest.CompletedRuns, manifest.FailedRuns, wantScored, wantFailed, manifest.PlannedRuns)
}
if len(runs) != manifest.CompletedRuns+manifest.FailedRuns {
t.Fatalf("results.jsonl has %d rows but completed=%d failed=%d",
len(runs), manifest.CompletedRuns, manifest.FailedRuns)
}
for _, id := range manifest.TaskIDs {
if id == blocked.ID {
t.Fatalf("task_ids lists %s, which produced no evidence: %v", blocked.ID, manifest.TaskIDs)
}
}
scored, failures := 0, 0
for _, m := range runs {
if m.Failed {
failures++
if m.Task != blocked.ID || m.FailureStage == "" || m.Reason == "" {
t.Fatalf("failed row lost its identity or stage: %+v", m)
}
continue
}
scored++
if m.Task != ok.ID {
t.Fatalf("a run scored from the wrong task: %+v", m)
}
}
if scored != wantScored || failures != wantFailed {
t.Fatalf("rows scored=%d failed=%d, want %d and %d", scored, failures, wantScored, wantFailed)
}
// Each arm's funnel holds exactly the successful task's runs, and the two
// scored counts agree with each other and with the manifest.
total := 0
for _, arm := range armsFor(ok) {
total += funnelScored(t, out, arm.name)
}
if total != manifest.CompletedRuns {
t.Fatalf("funnels scored %d runs, manifest completed_runs = %d:\n%s", total, manifest.CompletedRuns, out)
}
if gotScored, gotFailed := reportCounts(t, out); gotScored != manifest.CompletedRuns || gotFailed != manifest.FailedRuns {
t.Fatalf("report says scored=%d failed=%d, manifest says %d and %d",
gotScored, gotFailed, manifest.CompletedRuns, manifest.FailedRuns)
}
if strings.Contains(out, "## Where it broke") && strings.Contains(out, "=-\n") {
t.Fatalf("the stage table kept an empty stage:\n%s", out)
}
}
// A batch where every run fails must not read as an empty success: zero scored
// runs, a nonzero failed count, and both stated.
func TestAllFailedBatchReportsZeroScoredAndNonzeroFailed(t *testing.T) {
blocked, _ := mixedTaskPair()
_, runs, manifest, out := runBlockedExperiment(t, []contextTask{blocked}, blocked.ID)
if manifest.CompletedRuns != 0 {
t.Fatalf("completed_runs = %d, want 0 (nothing produced evidence)", manifest.CompletedRuns)
}
if manifest.FailedRuns != manifest.PlannedRuns || manifest.FailedRuns == 0 {
t.Fatalf("failed_runs = %d, planned_runs = %d: every planned run failed",
manifest.FailedRuns, manifest.PlannedRuns)
}
if len(manifest.TaskIDs) != 0 {
t.Fatalf("task_ids = %v, want none", manifest.TaskIDs)
}
for i, m := range runs {
if !m.Failed || m.FailureStage == "" || m.Task != blocked.ID {
t.Fatalf("results.jsonl line %d is not a marked failure: %+v", i+1, m)
}
}
total := 0
for _, arm := range armsFor(blocked) {
total += funnelScored(t, out, arm.name)
}
if total != 0 {
t.Fatalf("funnels scored %d runs although nothing ran:\n%s", total, out)
}
if gotScored, gotFailed := reportCounts(t, out); gotScored != 0 || gotFailed != manifest.FailedRuns {
t.Fatalf("report says scored=%d failed=%d, want 0 and %d", gotScored, gotFailed, manifest.FailedRuns)
}
}
// The control: with nothing blocked, a batch is what it always was. Every run
// is completed with a stage, two identical batches write byte-identical results
// and the same manifest header, and the new failure field stays out of it.
func TestAllSuccessfulBatchKeepsItsArtifacts(t *testing.T) {
tasks := indexTasks()
first, runs, manifest, out := runBlockedExperiment(t, tasks)
second, again, repeat, _ := runBlockedExperiment(t, tasks)
if manifest.CompletedRuns != len(runs) || manifest.FailedRuns != 0 {
t.Fatalf("completed=%d failed=%d rows=%d, want every row completed",
manifest.CompletedRuns, manifest.FailedRuns, len(runs))
}
if manifest.CompletedRuns != manifest.PlannedRuns {
t.Fatalf("completed=%d planned=%d, want all planned", manifest.CompletedRuns, manifest.PlannedRuns)
}
for i, m := range runs {
if m.Failed || m.Task == "" || m.Arm == "" || m.FailureStage == "" {
t.Fatalf("results.jsonl line %d is not a completed run: %+v", i+1, m)
}
}
if gotScored, gotFailed := reportCounts(t, out); gotScored != manifest.CompletedRuns || gotFailed != 0 {
t.Fatalf("report says scored=%d failed=%d, want %d and 0", gotScored, gotFailed, manifest.CompletedRuns)
}
if !reflect.DeepEqual(runs, again) {
t.Fatal("two identical successful batches scored differently")
}
// Byte-for-byte on the runs. Trajectories carry per-message wall-clock
// stamps, so they are compared field by field instead.
if got, want := readFile(t, second, "results.jsonl"), readFile(t, first, "results.jsonl"); got != want {
t.Fatalf("an unchanged batch wrote different results.jsonl:\n%s\n---\n%s", want, got)
}
gotTraj, wantTraj := withoutStamps(t, readFile(t, second, "trajectories.jsonl")),
withoutStamps(t, readFile(t, first, "trajectories.jsonl"))
if gotTraj != wantTraj {
t.Fatalf("an unchanged batch wrote different trajectories:\n%s\n---\n%s", wantTraj, gotTraj)
}
repeat.StartedAt, repeat.FinishedAt = manifest.StartedAt, manifest.FinishedAt
repeat.TrajectoriesSHA256 = manifest.TrajectoriesSHA256
if !reflect.DeepEqual(repeat, manifest) {
t.Fatalf("an unchanged batch wrote a different manifest:\n%+v\n---\n%+v", manifest, repeat)
}
if repeat.FailedRuns != 0 {
t.Fatalf("a batch with no failure reports failed_runs=%d", repeat.FailedRuns)
}
}
// withoutStamps drops the createdAt stamp every message carries, which is the
// one field a dry batch cannot reproduce between two runs.
func withoutStamps(t *testing.T, text string) string {
t.Helper()
var b strings.Builder
for line := range strings.SplitSeq(strings.TrimSpace(text), "\n") {
var row map[string]any
if err := json.Unmarshal([]byte(line), &row); err != nil {
t.Fatal(err)
}
stripStamp(row)
out, err := json.Marshal(row)
if err != nil {
t.Fatal(err)
}
b.Write(out)
b.WriteByte('\n')
}
return b.String()
}
func stripStamp(v any) {
switch typed := v.(type) {
case map[string]any:
delete(typed, "createdAt")
delete(typed, "workDurationMs")
for _, child := range typed {
stripStamp(child)
}
case []any:
for _, child := range typed {
stripStamp(child)
}
}
}
func readFile(t *testing.T, root, name string) string {
t.Helper()
data, err := os.ReadFile(filepath.Join(root, name))
if err != nil {
t.Fatal(err)
}
return string(data)
}
@@ -130,7 +130,7 @@ type queryAudit struct {
func auditQueries(runs []contextMetrics) queryAudit {
a := queryAudit{Reformulations: map[string]int{}, MissedProbeTerms: map[string]int{}}
for _, r := range runs {
if r.Contaminated {
if r.Failed || r.Contaminated {
continue
}
a.Runs++
+35 -1
View File
@@ -85,6 +85,7 @@ func runAdversarial(root string) int {
adversarialPrompts[t.Experiment])
if err != nil {
fmt.Fprintf(os.Stderr, "%s: %v\n", id, err)
m = failedMetrics(t, "adversarial", err)
}
verdict := "isolated"
if m.EscapeFoundAnswer {
@@ -173,6 +174,16 @@ func runOne(p provider.Provider, t contextTask, arm ablation.Set, armName, root
return m, runErr
}
// failedMetrics is what a run that never reached a transcript leaves behind. It
// carries the run's identity and the stage that ended it, so the failure stays a
// countable fact; Failed keeps it out of every statistic.
func failedMetrics(t contextTask, armName string, err error) contextMetrics {
return contextMetrics{
Task: t.ID, Arm: armName, Failed: true,
FailureStage: stageNoEvidence, Reason: err.Error(),
}
}
// finalAnswer is the last assistant text the turn produced.
func finalAnswer(msgs []provider.Message) string {
for _, m := range slices.Backward(msgs) {
@@ -250,6 +261,7 @@ func runBoundaries(mode, root string) int {
m, err := runOne(p, t, armFor(side.scale, false), name, root, side.has, false)
if err != nil {
fmt.Fprintf(os.Stderr, "%s [%s]: %v\n", t.ID, name, err)
m = failedMetrics(t, name, err)
}
all = append(all, m)
if side.has {
@@ -349,6 +361,7 @@ func runExperiment(mode, experiment, root string, dry bool, tasks []contextTask)
m, err := runOne(p, t, armFor(arm.scale, arm.searchOff), arm.name, root, cueVisible, dry)
if err != nil {
fmt.Fprintf(os.Stderr, "%s [%s]: %v\n", t.ID, arm.name, err)
m = failedMetrics(t, arm.name, err)
}
byArm[arm.name] = append(byArm[arm.name], m)
all = append(all, m)
@@ -430,11 +443,17 @@ func writeResults(root string, info batchInfo, all []contextMetrics) int {
return 2
}
defer f.Close()
scored, failed := 0, 0
for _, m := range all {
if err := writeJSONLine(f, m); err != nil {
fmt.Fprintln(os.Stderr, err)
return 2
}
if m.Failed {
failed++
} else {
scored++
}
}
if err := writeTrajectories(root, all); err != nil {
fmt.Fprintln(os.Stderr, "write trajectories:", err)
@@ -444,7 +463,10 @@ func writeResults(root string, info batchInfo, all []contextMetrics) int {
fmt.Fprintln(os.Stderr, "write batch manifest:", err)
return 2
}
fmt.Printf("\n%d runs written to %s (with trajectories.jsonl and batch.json)\n", len(all), path)
// Both counts are named: a reader who sees only the batch size cannot tell
// measurements from attempts.
fmt.Printf("\n%d runs written to %s: scored=%d failed=%d (with trajectories.jsonl and batch.json)\n",
len(all), path, scored, failed)
return 0
}
@@ -453,9 +475,21 @@ func writeResults(root string, info batchInfo, all []contextMetrics) int {
// what a four-arm average cannot do.
func reportBoundaries(all []contextMetrics) {
byKey := map[string]contextMetrics{}
scored, failed := 0, 0
for _, m := range all {
if m.Failed {
// No transcript, no boundary to compare: count the failure instead of
// printing the zero it left behind as a measurement.
failed++
continue
}
scored++
byKey[m.Task+"|"+m.Arm] = m
}
if scored == 0 {
fmt.Printf("\n## Across each task's cue boundary\n no scored runs: scored=%d failed=%d (nothing to compare)\n", scored, failed)
return
}
var cueSide, noCueSide []contextMetrics
fmt.Println("\n## Across each task's cue boundary")
fmt.Printf(" %-24s %-16s %-4s %-10s %-9s %-12s %-11s %s\n",
+218
View File
@@ -0,0 +1,218 @@
package main
import (
"context"
"os"
"path/filepath"
"strings"
"testing"
"reasonix/internal/base/testenv"
)
// writeKilledAgentStub writes a stand-in for the reasonix binary that leaves
// exactly what a killed child leaves behind: no final metrics record, but the
// in-flight snapshot the metrics sink writes every two seconds.
func writeKilledAgentStub(t *testing.T, dir string) string {
t.Helper()
path := filepath.Join(dir, "stub-agent.sh")
script := "#!/bin/sh\n" +
"metrics=\"\"\n" +
"prev=\"\"\n" +
"for arg in \"$@\"; do\n" +
" if [ \"$prev\" = \"--metrics\" ]; then metrics=\"$arg\"; fi\n" +
" prev=\"$arg\"\n" +
"done\n" +
"printf '%s' '{\"prompt_tokens\":1200,\"completion_tokens\":80,\"steps\":9," +
"\"cost\":0.0123,\"currency\":\"USD\",\"complete\":false}' > \"$metrics.partial\"\n" +
"exit 137\n"
if err := os.WriteFile(path, []byte(script), 0o755); err != nil {
t.Fatalf("write stub: %v", err)
}
return path
}
func killedRun(t *testing.T) result {
t.Helper()
requireShellStub(t)
work := testenv.TempDir(t)
tk := task{ID: "stub-task", Prompt: "do the thing"}
r := result{task: tk}
cfg := suiteConfig{bin: writeKilledAgentStub(t, work)}
if err := runSegments(context.Background(), cfg, tk, work, "", nil, &r); err == nil {
t.Fatal("the stub exits 137; a leg that died must be reported as failed")
}
return r
}
// writeSilentAgentStub writes a stand-in that leaves neither a final record nor
// a snapshot: what it spent is simply gone, so nothing can bound it.
func writeSilentAgentStub(t *testing.T, dir string) string {
t.Helper()
requireShellStub(t)
path := filepath.Join(dir, "silent-agent.sh")
if err := os.WriteFile(path, []byte("#!/bin/sh\nexit 0\n"), 0o755); err != nil {
t.Fatalf("write stub: %v", err)
}
return path
}
// A run recovered from its snapshot is still accounted: its numbers are real and
// stop at the last write, which is exactly what Partial says. Marking it
// Unaccounted would drop them from every total and hide the lower bound.
func TestSuiteSidecarRecoveredRunStaysAccountedAsALowerBound(t *testing.T) {
r := killedRun(t)
if r.Unaccounted || !r.Partial {
t.Fatalf("a run recovered from its snapshot was reported as unmeasured:\n"+
" partial=%v unaccounted=%v, want partial=true unaccounted=false", r.Partial, r.Unaccounted)
}
stats := gatherSuiteStats([]result{r})
if stats.unaccounted != 0 || stats.accounted != 1 || stats.partial != 1 {
t.Fatalf("a recovered run changed category:\n"+
" unaccounted=%d accounted=%d partial=%d", stats.unaccounted, stats.accounted, stats.partial)
}
if stats.pTok != 1200 || stats.cTok != 80 || stats.cost != 0.0123 {
t.Fatalf("the recovered numbers never reached the aggregates:\n"+
" tokens=%d/%d cost=%.4f, want 1200/80 at 0.0123", stats.pTok, stats.cTok, stats.cost)
}
if out := renderBody([]result{r}); !strings.Contains(out, "contributed partial accounting") {
t.Fatalf("the lower-bound hint is unreachable:\n%s", out)
}
}
// A leg that leaves neither record has no surviving evidence at all, so the run
// is unmeasured and must stay out of the totals rather than count as zero.
func TestSuiteRunWithNoRecordAtAllIsUnaccounted(t *testing.T) {
work := testenv.TempDir(t)
tk := task{ID: "silent-task", Prompt: "do the thing"}
r := result{task: tk}
cfg := suiteConfig{bin: writeSilentAgentStub(t, work)}
if err := runSegments(context.Background(), cfg, tk, work, "", nil, &r); err != nil {
t.Fatalf("the stub exits 0; a silent leg must not fail the run: %v", err)
}
if !r.Unaccounted || r.Partial {
t.Fatalf("a run that left no record at all was not marked unmeasured:\n"+
" partial=%v unaccounted=%v, want partial=false unaccounted=true", r.Partial, r.Unaccounted)
}
stats := gatherSuiteStats([]result{r})
if stats.unaccounted != 1 || stats.accounted != 0 {
t.Fatalf("a record-less run was counted as accounted:\n"+
" unaccounted=%d accounted=%d", stats.unaccounted, stats.accounted)
}
if stats.pTok != 0 || stats.cTok != 0 || stats.cost != 0 {
t.Fatalf("a record-less run contributed numbers: tokens=%d/%d cost=%.4f",
stats.pTok, stats.cTok, stats.cost)
}
if out := renderBody([]result{r}); !strings.Contains(out, "Accounting incomplete for 1 of 1 instances") {
t.Fatalf("the record-less run was not disclosed as unaccounted:\n%s", out)
}
}
// The killed child did leave its numbers: the metrics sink snapshots in flight
// into <metrics>.partial. Swebench mode reads that sidecar; the suite path must
// do the same rather than let the directory removal destroy the evidence.
func TestSuiteRunRecoversTheInFlightSnapshotItsChildLeft(t *testing.T) {
r := killedRun(t)
if r.PromptTokens != 1200 || r.CompletionTokens != 80 {
t.Fatalf("the child's in-flight snapshot was dropped:\n"+
" prompt_tokens=%d completion_tokens=%d cost=%.4f partial=%v unaccounted=%v\n"+
" want the 1200/80 the <metrics>.partial sidecar carries",
r.PromptTokens, r.CompletionTokens, r.Cost, r.Partial, r.Unaccounted)
}
}
// The meter-vs-harness divergence line divides one side by the other. Whether a
// run has a harness side is the suite's Unaccounted state, not the token values:
// a run with no record at all has no side, and pricing it against the meter
// invents a divergence and blames the harness for it.
func TestMeterDivergenceDoesNotPriceAMetricslessRun(t *testing.T) {
r := result{task: task{ID: "killed"}, Unaccounted: true,
Meter: &meterUsage{PromptTokens: 1200, CompletionTokens: 80}}
got := renderMeterAccounting([]result{r})
if strings.Contains(got, "self-report divergence") {
t.Fatalf("a run with no harness-side number was priced as a self-report divergence:\n%s", got)
}
}
// A persisted record that says zero tokens is a measurement of zero, not an
// absence: the harness side exists, so it belongs on both sides of the ratio
// even when the number it reports disagrees with the meter.
func TestMeterAccountingKeepsAPersistedZeroOnBothSides(t *testing.T) {
r := result{task: task{ID: "zero"}, Meter: &meterUsage{PromptTokens: 1200, CompletionTokens: 80}}
got := renderMeterAccounting([]result{r})
if !strings.Contains(got, "-100.0% (harness 0 vs meter 1,280 over 1 runs)") {
t.Fatalf("a real zero-token measurement was dropped as if it were missing:\n%s", got)
}
}
func TestCorrectBoundaryMediansExcludeRunsWithNoRecordedSplit(t *testing.T) {
cp := []checkpoint{{Seq: 1, ElapsedMs: 1_000}, {Seq: 2, ElapsedMs: 2_000, Pass: true}}
measured := result{
task: task{ID: "measured"}, Passed: true, WallMs: 200_000, Checkpoints: cp,
FirstCorrectMs: 50_000, PostSolveWasteMs: 150_000,
MutationsBeforeCorrect: 1, RoundsBeforeCorrect: 3, RoundsAfterCorrect: 4,
CallsAfterCorrect: 5, VerifyAfterCorrect: 2,
Trajectory: &trajectorySummary{ModelRounds: 8},
}
// the same run twice, but -trajectories was omitted: no digest, so no split
// was ever taken and the before/after tallies stay at their zero value.
unmeasured := result{
task: task{ID: "unmeasured"}, Passed: true, WallMs: 200_000, Checkpoints: cp,
FirstCorrectMs: 50_000, PostSolveWasteMs: 150_000,
MutationsBeforeCorrect: 1,
}
unmeasured2 := unmeasured
unmeasured2.task = task{ID: "unmeasured-2"}
// The audit read the rendered line as plain text; the renderer emits
// markdown emphasis around each label, so compare with it stripped.
const want = "**rounds before** 3 · **rounds after** 4"
got := renderSolveProfiles([]result{measured, unmeasured, unmeasured2})
if !strings.Contains(got, want) {
t.Fatalf("medians folded in a run whose trajectory was never split:\n%s\n"+
"want %q (the measured run only)", got, want)
}
}
// Control (a): when every run recorded its split, the exclusion must not touch
// a single number — the medians stay the measured ones.
func TestCorrectBoundaryMediansAllMeasuredUnchanged(t *testing.T) {
cp := []checkpoint{{Seq: 1, ElapsedMs: 1_000}, {Seq: 2, ElapsedMs: 2_000, Pass: true}}
mk := func(id string, before, after, verify, mutations int) result {
return result{
task: task{ID: id}, Passed: true, WallMs: 200_000, Checkpoints: cp,
FirstCorrectMs: 50_000, PostSolveWasteMs: 150_000,
RoundsBeforeCorrect: before, RoundsAfterCorrect: after,
VerifyAfterCorrect: verify, MutationsBeforeCorrect: mutations,
Trajectory: &trajectorySummary{ModelRounds: 8},
}
}
got := renderSolveProfiles([]result{mk("a", 2, 6, 1, 0), mk("b", 3, 4, 2, 1), mk("c", 4, 5, 3, 2)})
const want = "**mutations before** 1 · **rounds before** 3 · **rounds after** 5 · **verifications after** 2"
if !strings.Contains(got, want) {
t.Fatalf("all-measured medians changed:\n%s\nwant %q", got, want)
}
}
// Control (b): with -trajectories off no split was ever taken for any run, so
// there is nothing to average. Printing zeros would publish them as
// observations; the report must say the boundary is unmeasured instead.
func TestCorrectBoundaryWithNoRecordedSplitSaysNothingToAverage(t *testing.T) {
cp := []checkpoint{{Seq: 1, ElapsedMs: 1_000}, {Seq: 2, ElapsedMs: 2_000, Pass: true}}
run := func(id string, mutations int) result {
return result{
task: task{ID: id}, Passed: true, WallMs: 200_000, Checkpoints: cp,
FirstCorrectMs: 50_000, PostSolveWasteMs: 150_000,
MutationsBeforeCorrect: mutations,
}
}
got := renderSolveProfiles([]result{run("a", 1), run("b", 3)})
if strings.Contains(got, "rounds before") || strings.Contains(got, "verifications after") {
t.Fatalf("a boundary that was never split printed as a measurement:\n%s", got)
}
if !strings.Contains(got, "**mutations before** 3") {
t.Fatalf("the checkpoint-derived mutation count is measured without a trajectory and must still be printed:\n%s", got)
}
if !strings.Contains(got, "nothing to average") {
t.Fatalf("the report must say the boundary was never measured:\n%s", got)
}
}
+19 -7
View File
@@ -195,7 +195,7 @@ func renderSolveProfiles(results []result) string {
}
line := "**Solve profile**: "
parts := []string{}
regressed, withCorrect := 0, 0
regressed, withCorrect, split := 0, 0, 0
var roundsBefore, roundsAfter, verifyAfter, mutationsBefore []int64
for _, r := range results {
if len(r.Checkpoints) == 0 {
@@ -203,10 +203,16 @@ func renderSolveProfiles(results []result) string {
}
if r.FirstCorrectMs > 0 {
withCorrect++
roundsBefore = append(roundsBefore, int64(r.RoundsBeforeCorrect))
roundsAfter = append(roundsAfter, int64(r.RoundsAfterCorrect))
verifyAfter = append(verifyAfter, int64(r.VerifyAfterCorrect))
// Fold in only runs whose trajectory was read and split (Trajectory
// is set exactly when -trajectories ran): a run without one has no
// measurement, and its zeros are absence, not a zero.
mutationsBefore = append(mutationsBefore, int64(r.MutationsBeforeCorrect))
if r.Trajectory != nil {
split++
roundsBefore = append(roundsBefore, int64(r.RoundsBeforeCorrect))
roundsAfter = append(roundsAfter, int64(r.RoundsAfterCorrect))
verifyAfter = append(verifyAfter, int64(r.VerifyAfterCorrect))
}
}
if r.RegressedAfterCorrect {
regressed++
@@ -247,9 +253,15 @@ func renderSolveProfiles(results []result) string {
ttfum = append(ttfum, r.FirstUsefulMs)
}
}
line += fmt.Sprintf("\n\n**Correct boundary** (medians): **mutations before** %d · **rounds before** %d · **rounds after** %d · **verifications after** %d · **regression-after-correct** %s",
median(mutationsBefore), median(roundsBefore), median(roundsAfter), median(verifyAfter),
pct(regressed, withCorrect))
if split == 0 {
// The split counts are absent; the checkpoint-derived ones are not.
line += fmt.Sprintf("\n\n**Correct boundary**: **mutations before** %d · **regression-after-correct** %s — nothing to average: the runs reached a correct state, but none recorded a trajectory, so the boundary was never split",
median(mutationsBefore), pct(regressed, withCorrect))
} else {
line += fmt.Sprintf("\n\n**Correct boundary** (medians): **mutations before** %d · **rounds before** %d · **rounds after** %d · **verifications after** %d · **regression-after-correct** %s",
median(mutationsBefore), median(roundsBefore), median(roundsAfter), median(verifyAfter),
pct(regressed, withCorrect))
}
if len(ttfum) > 0 {
line += fmt.Sprintf(" · **TTFUM median** %s", dur(median(ttfum)))
}
+9 -5
View File
@@ -172,10 +172,11 @@ func scanMemoryRecall(path string, markers []string, markersInPrefix bool) memor
defer f.Close()
type record struct {
MemoryRecall *struct {
Hits []struct{ ID string } `json:"hits"`
UsedChars int `json:"used_chars"`
Suppressed string `json:"suppressed"`
ShadowHits []struct{ ID string } `json:"shadow_hits"`
Hits []struct{ ID string } `json:"hits"`
UsedChars int `json:"used_chars"`
Suppressed string `json:"suppressed"`
SuppressionCode string `json:"suppression_code"`
ShadowHits []struct{ ID string } `json:"shadow_hits"`
} `json:"memory_recall"`
Event *struct {
Kind string `json:"kind"`
@@ -205,7 +206,10 @@ func scanMemoryRecall(path string, markers []string, markersInPrefix bool) memor
if len(mr.ShadowHits) > 0 && mr.ShadowHits[0].ID == mr.Hits[0].ID {
stats.ShadowAgree++
}
} else if mr.Suppressed != "" {
} else if mr.SuppressionCode != "" || mr.Suppressed != "" {
// The typed code is the identity. A record written before the
// code existed carries only the sentence, whose presence still
// means recall stayed silent.
stats.Suppressed++
}
}
+4 -3
View File
@@ -17,15 +17,16 @@ func TestScanMemoryRecallCountsAndPointOfUse(t *testing.T) {
`{"seq":1,"event":{"kind":"tool_result","tool":{"args":"{\"command\":\"make check-fast --tag=MEMKEY-EARLY\"}"}}}`,
`{"seq":2,"memory_recall":{"hits":[{"id":"a"},{"id":"b"}],"used_chars":420}}`,
`{"seq":3,"event":{"kind":"tool_result","tool":{"args":"{\"path\":\"answer.txt\",\"content\":\"make check-fast --tag=MEMKEY-USED\"}"}}}`,
`{"seq":4,"memory_recall":{"suppressed":"generic user turn"}}`,
`{"seq":4,"memory_recall":{"suppression_code":"generic-turn","suppressed":"generic-turn: generic user turn"}}`,
`{"seq":5,"event":{"kind":"text","text":"done, MEMKEY-TEXT too"}}`,
`{"seq":6,"memory_recall":{"suppressed":"generic user turn"}}`,
}
if err := os.WriteFile(path, []byte(strings.Join(lines, "\n")+"\n"), 0o644); err != nil {
t.Fatal(err)
}
stats := scanMemoryRecall(path, []string{"MEMKEY-USED", "MEMKEY-TEXT", "MEMKEY-EARLY", "MEMKEY-NEVER"}, false)
if stats.RecallEvents != 1 || stats.RecallHits != 2 || stats.RecallChars != 420 || stats.Suppressed != 1 {
t.Fatalf("stats = %+v, want 1 event / 2 hits / 420 chars / 1 suppressed", stats)
if stats.RecallEvents != 1 || stats.RecallHits != 2 || stats.RecallChars != 420 || stats.Suppressed != 2 {
t.Fatalf("stats = %+v, want 1 event / 2 hits / 420 chars / 2 suppressed", stats)
}
// MEMKEY-EARLY appears only BEFORE the recall: not point-of-use evidence.
if stats.MarkersUsed != 2 {
+8 -7
View File
@@ -116,14 +116,15 @@ func renderMeterAccounting(results []result) string {
miss += r.Meter.CacheMissTokens
unmeasured += r.Meter.WithoutUsage
injected += r.Meter.Injected
// A run whose metrics file never landed has no harness number, so it
// stays out of both sides of the comparison; folding its meter tokens
// against a silent zero would invent a divergence.
if !r.Unaccounted {
selfReported++
harnessTokens += r.PromptTokens + r.CompletionTokens
comparableTokens += r.Meter.PromptTokens + r.Meter.CompletionTokens
// Whether the harness has a side to compare is the suite's state, not a
// token count: Unaccounted has no record and Partial stops at its last
// snapshot, so neither side is whole. A persisted zero is a measurement.
if r.Unaccounted || r.Partial {
continue
}
selfReported++
harnessTokens += r.PromptTokens + r.CompletionTokens
comparableTokens += r.Meter.PromptTokens + r.Meter.CompletionTokens
}
if metered == 0 {
return ""
+32 -2
View File
@@ -21,10 +21,17 @@ func runSegments(ctx context.Context, cfg suiteConfig, t task, work, trajDir str
// call on the harness's own token counts, and another found this directory
// by grepping the temp root for its task — moving it only helps unnamed.
metricsDir, err := os.MkdirTemp("", "e2ebench-metrics-")
// A snapshot recovered from the sidecar is the only surviving evidence of
// what that leg spent, so its directory is kept instead of removed.
keepMetrics := false
if err != nil {
metricsDir = work
} else {
defer func() { _ = os.RemoveAll(metricsDir) }()
defer func() {
if !keepMetrics {
_ = os.RemoveAll(metricsDir)
}
}()
}
var runErr error
for _, seg := range segs {
@@ -42,7 +49,17 @@ func runSegments(ctx context.Context, cfg suiteConfig, t task, work, trajDir str
cmd.WaitDelay = 10 * time.Second
runErr = cmd.Run()
if m, err := readMetrics(metricsPath); err == nil {
m, partial, err := legMetrics(metricsPath)
if err != nil {
// The leg left no record at all: nothing survives to say what it
// spent, so the run is unmeasured rather than priced at zero.
r.Unaccounted = true
} else {
// A snapshot is real evidence, so the run stays accounted and only
// Partial says its numbers stop at the last write. It is sticky: a
// complete later leg cannot restore the tail an earlier one lost.
r.Partial = r.Partial || partial || !m.Complete
keepMetrics = keepMetrics || partial
foldSegmentMetrics(r, m, seg.index)
}
// A leg that died takes the run with it: resuming a session the child
@@ -55,6 +72,19 @@ func runSegments(ctx context.Context, cfg suiteConfig, t task, work, trajDir str
return runErr
}
// legMetrics reads one leg's accounting. The final record is authoritative and
// the in-flight snapshot is only read when the final one is absent, so the two
// can never be counted together.
func legMetrics(path string) (m runMetrics, partial bool, err error) {
if m, err = readMetrics(path); err == nil {
return m, false, nil
}
if m, err = readMetrics(path + ".partial"); err == nil {
return m, true, nil
}
return m, false, err
}
// segmentTrajectoryPath keeps one file per leg so a resumed leg cannot truncate
// the record of the one before it.
func segmentTrajectoryPath(dir, id string, seg segment, total int) string {
+214
View File
@@ -0,0 +1,214 @@
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
"testing"
"reasonix/internal/base/testenv"
)
// stubScript builds a stand-in agent that records the --metrics path it was
// given, writes the metrics body it was built with to that path plus suffix,
// and exits with code. A non-empty suffix is what a killed child leaves: the
// in-flight snapshot and no final record.
func stubScript(t *testing.T, name, body, suffix string, code int) string {
t.Helper()
requireShellStub(t)
script := fmt.Sprintf(`#!/bin/sh
metrics=""
prev=""
for arg in "$@"; do
if [ "$prev" = "--metrics" ]; then metrics="$arg"; fi
prev="$arg"
done
printf '%%s' "$metrics" > metrics-path.txt
printf '%%s' '%s' > "$metrics%s"
exit %d
`, body, suffix, code)
path := filepath.Join(t.TempDir(), name)
if err := os.WriteFile(path, []byte(script), 0o755); err != nil {
t.Fatalf("write stub: %v", err)
}
return path
}
// recordedMetricsPath reads back the --metrics path the stub was handed.
func recordedMetricsPath(t *testing.T, work string) string {
t.Helper()
b, err := os.ReadFile(filepath.Join(work, "metrics-path.txt"))
if err != nil {
t.Fatalf("the stub did not record its metrics path: %v", err)
}
got := strings.TrimSpace(string(b))
if got == "" {
t.Fatal("the stub recorded an empty metrics path")
}
return got
}
// twoLegStub writes a stand-in whose legs differ: the first leaves only the
// in-flight snapshot, the second lands its final record. Both exit 0, which is
// what lets the run reach the second leg after the first one stopped short.
func twoLegStub(t *testing.T, name string) string {
t.Helper()
requireShellStub(t)
script := `#!/bin/sh
metrics=""
prev=""
for arg in "$@"; do
if [ "$prev" = "--metrics" ]; then metrics="$arg"; fi
prev="$arg"
done
case "$metrics" in
*-1.json)
printf '%s' '{"prompt_tokens":1200,"completion_tokens":80,"steps":9,"cost":0.0123,"currency":"USD","complete":false}' > "$metrics.partial"
;;
*)
printf '%s' '{"prompt_tokens":300,"completion_tokens":20,"steps":2,"cost":0.001,"currency":"USD","complete":true}' > "$metrics"
;;
esac
exit 0
`
path := filepath.Join(t.TempDir(), name)
if err := os.WriteFile(path, []byte(script), 0o755); err != nil {
t.Fatalf("write stub: %v", err)
}
return path
}
// A run that lands its final metrics record is untouched by the recovery
// path: it stays accounted, keeps its real numbers and is still not partial.
func TestSuiteHealthyRunKeepsItsFinalAccount(t *testing.T) {
work := testenv.TempDir(t)
tk := task{ID: "healthy-task", Prompt: "do the thing"}
body := `{"prompt_tokens":900,"completion_tokens":60,"steps":4,"cost":0.02,` +
`"currency":"USD","complete":true}`
cfg := suiteConfig{bin: stubScript(t, "stub-ok.sh", body, "", 0)}
r := result{task: tk}
if err := runSegments(context.Background(), cfg, tk, work, "", nil, &r); err != nil {
t.Fatalf("a healthy leg must not fail the run: %v", err)
}
stats := gatherSuiteStats([]result{r})
if stats.unaccounted != 0 || stats.accounted != 1 || stats.partial != 0 {
t.Fatalf("a healthy run changed category: unaccounted=%d accounted=%d partial=%d",
stats.unaccounted, stats.accounted, stats.partial)
}
if stats.pTok != 900 || stats.cTok != 60 || stats.cost != 0.02 {
t.Fatalf("a healthy run's numbers changed: tokens=%d/%d cost=%.4f",
stats.pTok, stats.cTok, stats.cost)
}
if r.Partial || r.Unaccounted {
t.Fatalf("a healthy run was flagged: partial=%v unaccounted=%v", r.Partial, r.Unaccounted)
}
// The metrics directory is disposable once the final record was read.
dir := filepath.Dir(recordedMetricsPath(t, work))
if dirExists(dir) {
t.Fatalf("a healthy run left its metrics directory behind: %s", dir)
}
}
// The snapshot a killed child leaves is the only evidence of what it spent, so
// recovering the numbers must not also destroy the file they came from.
func TestSuiteRunKeepsTheSnapshotItRecovered(t *testing.T) {
work := testenv.TempDir(t)
tk := task{ID: "killed-task", Prompt: "do the thing"}
body := `{"prompt_tokens":1200,"completion_tokens":80,"steps":9,"cost":0.0123,` +
`"currency":"USD","complete":false}`
cfg := suiteConfig{bin: stubScript(t, "stub-partial.sh", body, ".partial", 137)}
r := result{task: tk}
if err := runSegments(context.Background(), cfg, tk, work, "", nil, &r); err == nil {
t.Fatal("the stub exits 137; a leg that died must be reported as failed")
}
path := recordedMetricsPath(t, work)
if fileExists(path) {
t.Fatalf("a killed child cannot have written a final record: %s", path)
}
if !fileExists(path + ".partial") {
t.Fatalf("the recovered snapshot was deleted with the metrics directory: %s.partial", path)
}
if r.PromptTokens != 1200 || r.CompletionTokens != 80 {
t.Fatalf("the snapshot was kept but not recovered: tokens=%d/%d",
r.PromptTokens, r.CompletionTokens)
}
// Recovering the numbers must not also mark the run unmeasured: the snapshot
// is evidence, so the run stays accounted and Partial marks it a lower bound.
if r.Unaccounted || !r.Partial {
t.Fatalf("a recovered snapshot was not reported as accounted but partial: partial=%v unaccounted=%v",
r.Partial, r.Unaccounted)
}
}
// A lower bound belongs to the run, not to its last leg: a complete second leg
// cannot restore the tail a killed first leg stopped short of, so once any leg
// ends at a snapshot the whole run stays partial — and still counts.
func TestSuitePartialFirstLegMakesTheWholeRunALowerBound(t *testing.T) {
work := testenv.TempDir(t)
tk := task{ID: "two-leg-partial", Prompt: "do the thing", MaxSteps: 10}
cfg := suiteConfig{bin: twoLegStub(t, "stub-two-leg.sh"), segments: 2}
r := result{task: tk}
if err := runSegments(context.Background(), cfg, tk, work, "", nil, &r); err != nil {
t.Fatalf("both legs exit 0; the run must not fail: %v", err)
}
if r.Segments != 2 {
t.Fatalf("the run did not take both legs: segments=%d", r.Segments)
}
// The second leg's completeness says nothing about the first leg's tail.
if !r.Partial || r.Unaccounted {
t.Fatalf("a complete last leg erased the first leg's lower bound:\n"+
" partial=%v unaccounted=%v, want partial=true unaccounted=false", r.Partial, r.Unaccounted)
}
// Partial bounds the account; it does not exclude it. Both legs are counted.
if r.PromptTokens != 1500 || r.CompletionTokens != 100 {
t.Fatalf("the legs' spend was not folded together: tokens=%d/%d, want 1500/100",
r.PromptTokens, r.CompletionTokens)
}
stats := gatherSuiteStats([]result{r})
if stats.accounted != 1 || stats.unaccounted != 0 || stats.partial != 1 || stats.pTok != 1500 {
t.Fatalf("a two-leg partial run changed category:\n"+
" accounted=%d unaccounted=%d partial=%d pTok=%d, want 1/0/1/1500",
stats.accounted, stats.unaccounted, stats.partial, stats.pTok)
}
if out := renderBody([]result{r}); !strings.Contains(out, "contributed partial accounting") {
t.Fatalf("the run was counted but not disclosed as a lower bound:\n%s", out)
}
}
// TestMeterAccountingSkipsAnUnaccountedRunWithTokens pins the guard: a run the
// suite marked unmeasured stays out of the ratio even when a harness number is
// present, so a run with no record is not priced.
func TestMeterAccountingSkipsAnUnaccountedRunWithTokens(t *testing.T) {
r := result{
task: task{ID: "killed"},
runMetrics: runMetrics{PromptTokens: 100, CompletionTokens: 10},
Unaccounted: true,
Meter: &meterUsage{PromptTokens: 1200, CompletionTokens: 80},
}
got := renderMeterAccounting([]result{r})
if strings.Contains(got, "self-report divergence") {
t.Fatalf("an unaccounted run with a harness number was priced as a self-report divergence:\n%s", got)
}
}
// The same guard has to cover a lower bound: a Partial run's harness side stops
// at its last snapshot while the meter saw the whole leg, so pricing it reads as
// a divergence that is only the missing tail.
func TestMeterAccountingSkipsAPartialRunWithTokens(t *testing.T) {
r := result{
task: task{ID: "lower-bound"},
runMetrics: runMetrics{PromptTokens: 100, CompletionTokens: 10},
Partial: true,
Meter: &meterUsage{PromptTokens: 1200, CompletionTokens: 80},
}
got := renderMeterAccounting([]result{r})
if strings.Contains(got, "self-report divergence") {
t.Fatalf("a partial run's missing tail was priced as a self-report divergence:\n%s", got)
}
// Its meter tokens are still a real measurement, so the totals keep them.
if !strings.Contains(got, "tokens 1,280") {
t.Fatalf("skipping the ratio also dropped the run's metered tokens:\n%s", got)
}
}
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"os/exec"
"strings"
"testing"
)
// The host runs a scheduled child through the small schedulerun package. The
// command line is not part of what it ships, and importing it again for one
// entry point would bring back every command it carries.
func TestTheHostDoesNotCarryTheCommandLine(t *testing.T) {
out, err := exec.Command("go", "list", "-deps", ".").Output()
if err != nil {
t.Skipf("go list is not available: %v", err)
}
for pkg := range strings.FieldsSeq(string(out)) {
if pkg == "reasonix/internal/frontend/cli" {
t.Fatal("the studio host depends on the command line package")
}
}
}
+63 -8
View File
@@ -18,7 +18,9 @@ import (
"os"
"os/signal"
"path/filepath"
"reasonix/internal/ext/modhost"
"strings"
"sync"
"syscall"
"time"
@@ -32,6 +34,7 @@ import (
"reasonix/internal/contract/provider"
"reasonix/internal/contract/surface"
"reasonix/internal/frontend/remotehost"
"reasonix/internal/frontend/schedulerun"
"reasonix/internal/frontend/serve"
"reasonix/internal/frontend/traystate"
"reasonix/internal/platform/account"
@@ -47,6 +50,7 @@ import (
// Kinds register from init, so a binary builds only what it links. Without
// these every Anthropic model answers "unknown kind" at switch time.
_ "reasonix/internal/model/anthropic"
_ "reasonix/internal/model/gemini"
_ "reasonix/internal/model/openai"
_ "reasonix/internal/model/responses"
)
@@ -120,6 +124,10 @@ func main() {
if handled, code := update.MaybeRunTreeHandoff(os.Args[1:]); handled {
os.Exit(code)
}
// A scheduled run is this same binary started by the in-kernel ticker.
if scheduleChildArgs(os.Args[1:]) {
os.Exit(schedulerun.Exec(os.Args[3:]))
}
page := flag.String("page", "", "directory holding the built Studio page")
identity := flag.Bool("instance-id", false, "print the Studio instance this data home belongs to, and exit")
// The shell around this process knows which build it is; this process does
@@ -139,6 +147,8 @@ func main() {
if *stripGrants {
os.Exit(stripPackageGrants(os.Stdout, os.Stderr, *studioApp))
}
// Studio's own binary runs a Claude Code mod's module as Node.
modhost.SetEmbedder(*studioApp, os.Environ())
// Which launches are the same Studio is Reasonix's question, not a shell's:
// the answer is the canonicalized data home, and a shell asks for it rather
// than working it out from an environment it does not resolve.
@@ -156,14 +166,47 @@ func main() {
}
shell := shellIdentity{version: *studioVersion, exe: *studioApp, pid: *studioAppPID, logsDir: logsDirOf(*crashDir)}
releaseFatalLog := crashreport.InstallFatalLog(*crashDir, defaultVersion(shell.version))
code := run(parentLease(os.Stdin), os.Stdout, os.Stderr, *page, shell, driver)
releaseFatalLog()
releaseFatalLog, exitedFatalLog := crashreport.InstallFatalLog(*crashDir, defaultVersion(shell.version))
logs := &lastLine{w: os.Stderr}
code := run(parentLease(os.Stdin), os.Stdout, logs, *page, shell, driver)
if code == 0 {
releaseFatalLog()
} else {
exitedFatalLog(code, logs.last())
}
os.Exit(code)
}
// logsDirOf is the shell's logs directory: the crash directory it passed is
// the "crash" folder inside it.
// lastLine passes everything through and remembers the last line written, which
// is where run says why it is returning a failure code.
type lastLine struct {
w io.Writer
mu sync.Mutex
line string
}
func (l *lastLine) Write(p []byte) (int, error) {
for line := range strings.SplitSeq(strings.TrimRight(string(p), "\r\n"), "\n") {
if strings.HasPrefix(line, "reasonix-studio-host:") {
l.mu.Lock()
l.line = strings.TrimSpace(line)
l.mu.Unlock()
}
}
return l.w.Write(p)
}
func (l *lastLine) last() string {
l.mu.Lock()
defer l.mu.Unlock()
if l.line == "" {
return "no reason was reported"
}
return l.line
}
func logsDirOf(crashDir string) string {
if strings.TrimSpace(crashDir) == "" {
return ""
@@ -216,6 +259,7 @@ func run(lease io.Reader, handshakeTo, logs io.Writer, page string, shell shellI
// After the socket has drained, never before: a pane torn down under a live
// request answers it with a half-closed kernel.
defer hub.Shutdown()
startScheduleTicker(ctx, lease != nil, hub, logs)
bound, err := bind(hub.Handler())
phases.mark(startupBind)
@@ -342,7 +386,7 @@ func assemble(ctx context.Context, logs, handshakeTo io.Writer, shell shellIdent
// This window is the only client of its kernel, so a system notification
// reaches the person who asked for it. Every pane gets the same wrapper,
// not just the one the launch started with.
notifications, notifySet := hostNotifications(cfg)
notifications, notifySet, phoneLink := hostNotifications(cfg)
// One fold behind the status icon: every pane's events on the way through,
// so the tray surface answers from what the panes did rather than from a
// count the shell kept for itself.
@@ -430,7 +474,7 @@ func assemble(ctx context.Context, logs, handshakeTo io.Writer, shell shellIdent
return nil, err
}
hub.StartRecoveryGC(ctx)
startCloudRemote(ctx, cfg, logs, hub)
startCloudRemote(ctx, cfg, logs, hub, phoneLink)
phases.mark(startupBackground)
return hub, nil
}
@@ -448,6 +492,7 @@ func runtimeOptions(root string, sink event.Sink, logs io.Writer, phases *startu
OnPhase: phases.boot,
StatsSource: surface.Desktop,
FeedbackSurface: feedback.SurfaceStudio,
AccountsURL: os.Getenv("REASONIX_ACCOUNTS_URL"),
// A stale default_model must not keep the window from opening to fix it.
OpenOnFallbackModel: true,
@@ -455,7 +500,7 @@ func runtimeOptions(root string, sink event.Sink, logs io.Writer, phases *startu
}
}
func startCloudRemote(ctx context.Context, cfg *config.Config, logs io.Writer, tasks remotecloud.TaskService) {
func startCloudRemote(ctx context.Context, cfg *config.Config, logs io.Writer, tasks remotecloud.TaskService, phones *notify.PhoneLink) {
httpClient, err := netclient.NewHTTPClient(cfg.NetworkProxySpec(), netclient.TransportOptions{})
if err != nil {
fmt.Fprintf(logs, "remote cloud: %v\n", err)
@@ -484,6 +529,12 @@ func startCloudRemote(ctx context.Context, cfg *config.Config, logs io.Writer, t
}
})
}
// Phone notifications leave through this connection, under this Studio's own
// device credential.
phones.Set(host)
if registrar, ok := tasks.(interface{ SetCloudPhones(serve.CloudPhones) }); ok {
registrar.SetCloudPhones(host)
}
go host.Run(ctx)
}
@@ -528,13 +579,17 @@ func hostServeConfig(cfg config.ServeConfig) config.ServeConfig {
// says today, because deciding here would make "notify me" mean "notify me
// after a restart". The shared [notifications] config is the one setting this
// window and the CLI both answer to.
func hostNotifications(cfg *config.Config) (func(event.Sink) event.Sink, *notify.Settings) {
func hostNotifications(cfg *config.Config) (func(event.Sink) event.Sink, *notify.Settings, *notify.PhoneLink) {
set := notify.NewSettings(config.NotificationsConfig{})
if cfg != nil {
set.Store(cfg.Notifications)
}
sender := notify.NewPlatformSender()
return func(sink event.Sink) event.Sink { return notify.NewSink(sink, sender, i18n.M, set) }, set
// One reporter for every runtime, so a burst across panes folds into one
// report; its sender is the account connection, attached once that is up.
link := &notify.PhoneLink{}
phone := notify.NewPhone(link)
return func(sink event.Sink) event.Sink { return notify.NewSink(sink, sender, i18n.M, set).WithPhone(phone) }, set, link
}
// studioTray answers for a shell that can put an icon back whenever the setting
+43 -1
View File
@@ -480,7 +480,7 @@ func TestHostNotificationsCarryTheSharedSettingLive(t *testing.T) {
{Notifications: config.NotificationsConfig{Enabled: true}},
nil,
} {
wrap, set := hostNotifications(cfg)
wrap, set, _ := hostNotifications(cfg)
if got := wrap(plain); got == event.Sink(plain) {
t.Fatalf("runtime was left unwrapped, so the switch could never reach it (cfg %+v)", cfg)
}
@@ -551,3 +551,45 @@ func TestAssembleAppliesTheStartupUpgrades(t *testing.T) {
t.Fatalf("after the window started, the desktop posture is %q, want the shipped auto released", got)
}
}
type phoneReports chan [2]any
func (p phoneReports) NotifyPhones(_ context.Context, kind string, count int) error {
p <- [2]any{kind, count}
return nil
}
// A runtime's own events, through the wrapper every pane gets, reach the account
// connection as a kind and a count and nothing else, and only once the switches
// ask for it.
func TestAnApprovalOnAPaneReachesThePhoneLinkAsATypeAndACount(t *testing.T) {
cfg := &config.Config{Notifications: config.NotificationsConfig{Phone: config.PhoneNotificationsConfig{Enabled: true, Approval: true}}}
wrap, set, link := hostNotifications(cfg)
reports := make(phoneReports, 4)
link.Set(reports)
sink := wrap(serve.NewBroadcaster())
sink.Emit(event.Event{Kind: event.ApprovalRequest, Approval: event.Approval{ID: "1", Tool: "bash", Subject: "git push --force"}})
select {
case got := <-reports:
if got != [2]any{"approval", 1} {
t.Fatalf("reported %v, want a type and a count and no text", got)
}
case <-time.After(2 * time.Second):
t.Fatal("an approval on a pane did not reach the phone link")
}
sink.Emit(event.Event{Kind: event.AskRequest})
select {
case got := <-reports:
t.Fatalf("reported %v for a kind whose switch is off", got)
case <-time.After(100 * time.Millisecond):
}
set.Store(config.NotificationsConfig{})
sink.Emit(event.Event{Kind: event.ApprovalRequest})
select {
case got := <-reports:
t.Fatalf("reported %v after the master switch was turned off", got)
case <-time.After(100 * time.Millisecond):
}
}
@@ -0,0 +1,63 @@
package main
import (
"context"
"fmt"
"io"
"path/filepath"
"reasonix/internal/base/filelock"
"reasonix/internal/frontend/serve"
"reasonix/internal/runtime/schedrun"
"reasonix/internal/runtime/scheduler"
)
// scheduleChildArgs says argv is a supervised scheduled run: the supervisor
// starts this binary as `schedule exec <id>`, and this host has no CLI of its own.
func scheduleChildArgs(args []string) bool {
return len(args) >= 2 && args[0] == "schedule" && args[1] == "exec"
}
// scheduleEligible is when this kernel may start scheduled runs: it has a
// supervised lifetime (a parent that ends it) and something the person can see.
// An orphan, or a kernel nobody can see, never spends on anyone's behalf.
func scheduleEligible(supervised, iconLive bool, panes int) bool {
return supervised && (iconLive || panes > 0)
}
// startScheduleTicker runs the in-kernel driver of scheduled runs. Every kernel
// on the machine may run it; the ticker lock lets one tick at a time.
func startScheduleTicker(ctx context.Context, supervised bool, hub *serve.Hub, logs io.Writer) {
if !supervised {
return
}
loop := &scheduler.Loop{
Eligible: func() bool { return scheduleEligible(supervised, (&studioTray{}).IconLive(), len(hub.Runtimes())) },
Lock: func() (func(), error) {
store, _, err := scheduler.OpenUserStore(nil)
if err != nil {
return nil, err
}
return filelock.TryAcquire(filepath.Join(store.Dir(), "scheduler.lock"))
},
Tick: func(ctx context.Context) (scheduler.Result, error) {
store, policy, err := scheduler.OpenUserStore(nil)
if err != nil {
return scheduler.Result{}, err
}
return (&scheduler.Scheduler{Store: store, Policy: policy, Runner: &schedrun.Supervisor{Store: store, Policy: policy}}).Tick(ctx)
},
Done: func(res scheduler.Result, err error) {
for _, r := range res.Reports {
fmt.Fprintf(logs, "schedule: ran %s: %s %s\n", r.TriggerID, r.State, r.Code)
}
for _, s := range res.Skipped {
fmt.Fprintf(logs, "schedule: skipped %s: %s\n", s.ScheduleID, s.Reason)
}
if err != nil {
fmt.Fprintln(logs, "schedule:", err)
}
},
}
go loop.Run(ctx)
}
@@ -0,0 +1,31 @@
package main
import (
"strings"
"testing"
)
func TestAScheduleChildIsRecognisedByItsArguments(t *testing.T) {
for args, want := range map[string]bool{"schedule exec sch_x/1": true, "schedule exec": true, "schedule list": false, "exec schedule": false, "": false} {
if got := scheduleChildArgs(strings.Fields(args)); got != want {
t.Errorf("%q = %v, want %v", args, got, want)
}
}
}
// An orphan, or a kernel nobody can see, never starts a scheduled run.
func TestSchedulesStartOnlyForASupervisedKernelThatCanBeSeen(t *testing.T) {
cases := []struct {
supervised, icon bool
panes int
want bool
}{
{true, true, 0, true}, {true, false, 1, true}, {true, true, 3, true},
{true, false, 0, false}, {false, true, 2, false}, {false, false, 0, false},
}
for _, c := range cases {
if got := scheduleEligible(c.supervised, c.icon, c.panes); got != c.want {
t.Errorf("%+v = %v", c, got)
}
}
}
+1
View File
@@ -12,6 +12,7 @@ import (
// Blank imports wire compile-time built-ins into their registries.
_ "reasonix/internal/model/anthropic"
_ "reasonix/internal/model/gemini"
_ "reasonix/internal/model/openai"
_ "reasonix/internal/model/responses"
_ "reasonix/internal/tools/builtin"
+12
View File
@@ -84,3 +84,15 @@ did not specify a dark layout. Phone captures confirm no horizontal overflow.
Windows native installer acceptance and hosted CI are separate from these
local results. The production build retains its existing large-chunk warning.
## Workspace preparation / 工作目录准备
The workspace palette and preparation states reuse existing typography and
tokens. Real Git checks cover branches, creation, retry and cancellation; visual
QA passed. Captures remain in
[PR #13598](https://github.com/esengine/DeepSeek-Reasonix/pull/13598).
工作目录面板与准备状态复用现有字号、图标和表面样式;真实 Git 验证了分支搜索、
占用状态、路径展开、创建、成功、失败重试与取消。无残留的 P0/P1/P2 视觉问题,
截图仅保留于 PR。清理失败时保留外部修改,并明确提示保存任务、核对目录后关闭
会话,从源目录新建会话重试;安装包与上游 CI 验收单独记录。
+6 -4
View File
@@ -135,14 +135,16 @@ func releaseAsset(repo, tag, name string, mirrored bool) update.Asset {
}
}
// installable reports whether an artifact installs itself rather than expecting
// the reader to place it: a disk image to drag from, an installer to run, a
// package for dpkg.
// installable reports whether an artifact is a download a person is offered: a
// disk image to drag from, an installer to run, a package for dpkg or rpm, or an
// AppImage to run in place. The AppImage is a download only; no native_packages
// key names it, so no client replaces one.
func installable(name string) bool {
return strings.HasSuffix(name, ".dmg") ||
strings.HasSuffix(name, "-installer.exe") ||
strings.HasSuffix(name, ".deb") ||
strings.HasSuffix(name, ".rpm")
strings.HasSuffix(name, ".rpm") ||
strings.HasSuffix(name, ".AppImage")
}
// macArchiveKeys maps a macOS archive to the platforms it can install. The
+33
View File
@@ -340,3 +340,36 @@ func TestLinuxArm64PackagesAreKeyedBesideAmd64(t *testing.T) {
}
}
}
// An AppImage is a download a person is offered and nothing an updater
// replaces: it must not appear as a platform asset or a native package, and
// adding it must not move any entry a shipped client reads.
func TestAnAppImageIsOfferedButNeverResolvedAsAnUpdate(t *testing.T) {
dir := t.TempDir()
for _, name := range []string{"ReasonixStudio-linux-amd64.deb", "ReasonixStudio-linux-amd64.AppImage", "ReasonixStudio-linux-arm64.AppImage"} {
if err := os.WriteFile(filepath.Join(dir, name), []byte(name), 0o644); err != nil {
t.Fatal(err)
}
}
t.Setenv("GITHUB_REPOSITORY", "esengine/DeepSeek-Reasonix")
if err := run(dir, "v0.1.0", "studio-v0.1.0", "", true); err != nil {
t.Fatalf("run: %v", err)
}
var m update.Manifest
raw, _ := os.ReadFile(filepath.Join(dir, "latest.json"))
if err := json.Unmarshal(raw, &m); err != nil {
t.Fatal(err)
}
for _, name := range []string{"ReasonixStudio-linux-amd64.AppImage", "ReasonixStudio-linux-arm64.AppImage"} {
a, ok := m.Downloads[name]
if !ok || a.Sig != a.URL+".minisig" {
t.Errorf("downloads[%s] = %+v, %v; want a signed download", name, a, ok)
}
}
if len(m.NativePackages) != 1 || !strings.HasSuffix(m.NativePackages["linux-amd64"].URL, "linux-amd64.deb") {
t.Errorf("native packages = %+v, want only the .deb", m.NativePackages)
}
if len(m.Platforms) != 0 {
t.Errorf("platforms = %+v: an AppImage must not resolve as an update", m.Platforms)
}
}
+8
View File
@@ -99,11 +99,19 @@ linux:
target:
- deb
- rpm
# Download only: it does not update itself, and nothing here installs it.
- AppImage
icon: assets/icon.png
category: Development
maintainer: esengine <[email protected]>
artifactName: ReasonixStudio-linux-${arch}.${ext}
appImage:
# Stated rather than inherited: the release vocabulary is the same for every
# Linux file, and canonical-artifact-names.js turns whatever architecture
# spelling electron-builder puts here (x64, x86_64) into amd64 or fails.
artifactName: ReasonixStudio-linux-${arch}.${ext}
deb:
# Named, not defaulted. electron-builder takes the package name from
# package.json's `name` unless told otherwise, which would publish
+10 -2
View File
@@ -15,14 +15,22 @@
"build:dist": "electron-builder",
"smoke": "electron test/smoke.js",
"browser-live": "electron test/browser_live.js",
"browser-resize-live": "electron test/browser_resize_live.js",
"browser-fit-live": "electron test/browser_fit_live.js",
"browser-fit-pages": "electron test/browser_fit_pages.js",
"image-live": "electron test/image_live.js",
"image-pane-live": "electron test/image_pane_live.js",
"sidepanel-live": "electron test/sidepanel_live.js",
"focus-live": "electron test/focus_live.js",
"ime-live": "electron test/ime_live.js",
"freeze-live": "electron test/freeze_live.js",
"windowstate-live": "electron test/windowstate_live.js",
"computer-live": "electron test/computer_live.js"
},
"devDependencies": {
"electron": "44.7.0",
"electron": "44.7.2",
"electron-builder": "^26.15.3",
"playwright": "1.64.0"
"playwright": "1.64.1"
},
"pnpm": {
"onlyBuiltDependencies": [
+14 -14
View File
@@ -9,14 +9,14 @@ importers:
.:
devDependencies:
electron:
specifier: 44.7.0
version: 44.7.0([email protected])
specifier: 44.7.2
version: 44.7.2([email protected])
electron-builder:
specifier: ^26.15.3
version: 26.15.3([email protected])([email protected])
playwright:
specifier: 1.64.0
version: 1.64.0
specifier: 1.64.1
version: 1.64.1
packages:
@@ -374,8 +374,8 @@ packages:
resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==}
engines: {node: '>=8.0.0'}
[email protected].0:
resolution: {integrity: sha512-aUq9/zLAAFYc+a9gy6cd0C3Y/N/RmovLCD8TV8LhIzNhuND6HEgsu96jJz9cbAxvckSPv+Trf2PKEjktoZgFkw==}
[email protected].2:
resolution: {integrity: sha512-u3Pbz0Hi1sSSwBMz2v8LiagsfUG4QURPUe/qphM+g4THKP8o4BYdnuboyhlLO8HIC/KfV5rvltyacbP4jEq9yw==}
engines: {node: '>= 22.12.0'}
hasBin: true
@@ -762,13 +762,13 @@ packages:
resolution: {integrity: sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw==}
engines: {node: '>=16.0.0'}
[email protected].0:
resolution: {integrity: sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg==}
[email protected].1:
resolution: {integrity: sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==}
engines: {node: '>=20'}
hasBin: true
[email protected].0:
resolution: {integrity: sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg==}
[email protected].1:
resolution: {integrity: sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==}
engines: {node: '>=20'}
hasBin: true
@@ -1551,7 +1551,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
[email protected].0([email protected]):
[email protected].2([email protected]):
dependencies:
'@electron-internal/extract-zip': 1.0.5
'@electron/get': 5.1.0([email protected])
@@ -1942,11 +1942,11 @@ snapshots:
pvutils: 1.2.0
tslib: 2.8.1
[email protected].0: {}
[email protected].1: {}
[email protected].0:
[email protected].1:
dependencies:
playwright-core: 1.64.0
playwright-core: 1.64.1
[email protected]:
dependencies:
+156 -11
View File
@@ -3,12 +3,20 @@ const crypto = require("node:crypto");
const { WebContentsView, session } = require("electron");
const { installPaneReload } = require("./reload");
const { guestNavigationAllowed, typed } = require("./browserguard");
const { InputWake } = require("./inputwake");
const { KeyboardKeeper } = require("./keyboard");
// The size a page lays out at while nobody is looking at it: the kernel drives
// pages whether or not the panel is open, and a page sized to nothing reads as
// a phone layout or not at all.
const AGENT_VIEWPORT = { width: 1280, height: 900 };
// How long a page may be held out of the window while its navigation runs. A
// server that accepts the connection and never answers would otherwise keep the
// panel blank, with nothing turning, for as long as it likes; past this the page
// is shown again, loaded or not.
const LEAVE_LIMIT_MS = 4000;
// CSS cannot clip a native view, so the page's corners are rounded here; the
// value is .bview's border-radius in studio.css, whose rect the view fills.
const PAGE_RADIUS = 8;
@@ -30,6 +38,8 @@ class BrowserViews {
// for this run only: a restart, or a different certificate, asks again.
this.trusted = new Set();
this.shown = "";
this.keyboard = new KeyboardKeeper({ win });
this.wake = new InputWake({ win });
// Moves with every show and hide, so a freeze that finishes after one does
// not put away a page shown since.
this.placed = 0;
@@ -106,26 +116,43 @@ class BrowserViews {
}
onEvent(method, params);
});
const entry = { view, onDownload, typed: 0 };
const entry = { view, onDownload, typed: 0, synthUntil: 0, attached: false, panel: null, override: null, scale: 1 };
this.keyboard.watch(contents, () => Date.now() < entry.synthUntil);
this.watchLoads(targetId, entry);
let closed = false;
const close = () => {
if (closed) return;
closed = true;
this.entries.delete(targetId);
if (!this.win.isDestroyed()) this.win.contentView.removeChildView(view);
clearTimeout(entry.returning);
if (entry.attached && !this.win.isDestroyed()) this.win.contentView.removeChildView(view);
entry.attached = false;
if (!contents.isDestroyed()) contents.close();
onClosed();
};
contents.once("destroyed", close);
contents.on("render-process-gone", close);
this.entries.set(targetId, entry);
this.win.contentView.addChildView(view);
this.putAway(view);
// The page loads before the window holds it: a page that finishes loading in a
// view already attached is given the keyboard by the platform, and the
// person's composition in the app page ends with it.
void contents.loadURL(url).catch(() => {});
return {
targetId,
send: (method, params) => contents.debugger.sendCommand(method, params),
send: (method, params) => {
if (method === "Emulation.setDeviceMetricsOverride") return this.emulate(entry, params);
if (method === "Emulation.clearDeviceMetricsOverride") return this.emulate(entry, null);
try {
params = scaleInput(method, params, entry.scale);
} catch (e) {
return Promise.reject(e);
}
// A capture puts the page's emulation back without its scale.
if (method === "Page.captureScreenshot") return contents.debugger.sendCommand(method, params).finally(() => void this.fit(entry, true));
if (!method.startsWith("Input.")) return contents.debugger.sendCommand(method, params);
entry.synthUntil = Date.now() + 250;
return this.wake.run(() => contents.debugger.sendCommand(method, params));
},
close,
mainFrame: () => mainFrame,
};
@@ -146,7 +173,7 @@ class BrowserViews {
// which during a turn is constantly, and nearly always the same rectangle:
// re-adding the view and setting the bounds it already has is work for
// every one of those.
if (this.shown === targetId && sameRect(entry.at, at)) return;
if (this.shown === targetId && sameRect(entry.panel, at)) return;
this.placed++;
for (const [id, other] of this.entries) {
if (id !== targetId) this.putAway(other.view, other);
@@ -155,19 +182,92 @@ class BrowserViews {
// A page that was parked comes back as a view that is attached but whose
// widget never repaints until the window's geometry changes; attaching it
// again is what wakes it, the same as after a minimize.
if (!entry.at) this.win.contentView.removeChildView(entry.view);
if (entry.attached && !entry.at) this.win.contentView.removeChildView(entry.view);
this.win.contentView.addChildView(entry.view);
entry.attached = true;
entry.panel = at;
this.fit(entry);
this.keepKeyboard();
}
// fit puts the view where its page is drawn whole and tells the page how it is
// scaled; a page parked out of sight is not scaled. force sends the scale again
// though it has not changed, for a capture that put the page's emulation back.
fit(entry, force = false) {
if (!entry.panel) return Promise.resolve();
const { at, scale } = placement(entry.panel, entry.override && { width: entry.override.width, height: entry.override.height });
entry.view.setBounds(at);
entry.at = at;
return this.scaled(entry, scale, force);
}
scaled(entry, scale, force = false) {
if (!entry.override || (entry.scale === scale && !force)) return Promise.resolve();
entry.scale = scale;
return this.override(entry).catch(() => {});
}
override(entry) {
return entry.view.webContents.debugger.sendCommand("Emulation.setDeviceMetricsOverride", { ...entry.override, scale: entry.scale });
}
// emulate records the viewport a page was told to lay out in, which the view
// is then fitted to; null is the page going back to the size of its view.
async emulate(entry, params) {
entry.override = sized(params) ? { ...params } : null;
if (!entry.override) {
entry.scale = 1;
if (entry.panel) this.fit(entry);
return entry.view.webContents.debugger.sendCommand("Emulation.clearDeviceMetricsOverride", {});
}
entry.scale = 1;
if (entry.panel) {
const { at, scale } = placement(entry.panel, entry.override);
entry.view.setBounds(at);
entry.at = at;
entry.scale = scale;
}
return this.override(entry);
}
// Attaching a view can leave nobody holding the keyboard, and the platform
// settles that a moment later, so the page is handed it back twice.
keepKeyboard() {
this.keyboard.reclaim();
setTimeout(() => this.keyboard.reclaim(), 150);
}
reattach() {
for (const [id, entry] of this.entries) {
if (this.win.isDestroyed() || entry.view.webContents.isDestroyed()) continue;
if (this.win.isDestroyed() || entry.view.webContents.isDestroyed() || !entry.attached) continue;
this.win.contentView.removeChildView(entry.view);
this.win.contentView.addChildView(entry.view);
if (id !== this.shown) this.putAway(entry.view, entry);
}
this.keepKeyboard();
}
// A navigation that starts in an attached view takes the keyboard from the app
// page when it finishes, and a composition in progress there is committed as
// the raw letters. While the app page holds the keyboard the view is held out of
// the window for the length of the navigation, and put back when it ends; a
// person who is in the page themselves keeps it where it is.
leave(entry) {
if (!entry.attached || this.win.isDestroyed() || this.keyboard.owner !== "app") return;
this.win.contentView.removeChildView(entry.view);
entry.attached = false;
clearTimeout(entry.returning);
entry.returning = setTimeout(() => this.settle(entry), LEAVE_LIMIT_MS);
}
settle(entry) {
clearTimeout(entry.returning);
entry.returning = undefined;
if (entry.attached || this.win.isDestroyed() || entry.view.webContents.isDestroyed()) return;
this.win.contentView.addChildView(entry.view);
entry.attached = true;
if (entry.at) entry.view.setBounds(entry.at);
else this.putAway(entry.view, entry);
}
// freeze answers with a picture of the page on screen, taken before it is put
@@ -202,7 +302,11 @@ class BrowserViews {
putAway(view, entry) {
const { height } = this.win.getContentBounds();
view.setBounds({ x: 1 - AGENT_VIEWPORT.width, y: height - 1, ...AGENT_VIEWPORT });
if (entry) entry.at = null;
if (entry) {
entry.at = null;
entry.panel = null;
void this.scaled(entry, 1);
}
}
control(targetId, action) {
@@ -255,8 +359,11 @@ class BrowserViews {
watchLoads(targetId, entry) {
const contents = entry.view.webContents;
contents.on("did-start-navigation", (details) => {
if (details.isMainFrame && !details.isSameDocument) this.report(targetId, null);
if (!details.isMainFrame || details.isSameDocument) return;
this.report(targetId, null);
this.leave(entry);
});
contents.on("did-stop-loading", () => this.settle(entry));
contents.on("did-fail-load", (_event, code, description, url, isMainFrame) => {
// -3 is ERR_ABORTED: a navigation replaced by another, or stopped. A
// typed address reports through loadTyped, which may still retry it.
@@ -366,6 +473,44 @@ async function loadResult(contents, url) {
}
}
// Where a page's view sits in the rectangle the panel gave it. A page laid out
// in a viewport of its own is shown whole: scaled down to fit and never up,
// centred, with the view sized to exactly what it draws.
const sized = (v) => !!v && Number.isFinite(v.width) && Number.isFinite(v.height) && v.width > 0 && v.height > 0;
function placement(panel, emulated) {
if (!sized(emulated)) return { at: panel, scale: 1 };
const scale = Math.min(1, panel.width / emulated.width, panel.height / emulated.height);
const width = Math.max(1, Math.round(emulated.width * scale));
const height = Math.max(1, Math.round(emulated.height * scale));
const x = panel.x + Math.round((panel.width - width) / 2);
const y = panel.y + Math.round((panel.height - height) / 2);
return { at: { x, y, width, height }, scale };
}
// Input that carries a point. The page reads it in the viewport it was told it
// has, the view draws that viewport scaled, and a point meant for the page lands
// where it is drawn only after the same scaling. The mouse is measured to; the
// rest are not, and a point that silently lands elsewhere is worse than a
// refusal, so they are refused while the page is scaled.
const POINTED_INPUT = new Set([
"Input.dispatchTouchEvent",
"Input.dispatchDragEvent",
"Input.emulateTouchFromMouseEvent",
"Input.synthesizeTapGesture",
"Input.synthesizeScrollGesture",
"Input.synthesizePinchGesture",
]);
function scaleInput(method, params, scale) {
if (scale === 1) return params;
if (method === "Input.dispatchMouseEvent") return { ...params, x: params.x * scale, y: params.y * scale };
if (POINTED_INPUT.has(method)) {
throw Object.assign(new Error(`${method} is not available while the page is scaled to fit the panel`), { code: "input_unscaled" });
}
return params;
}
function sameRect(a, b) {
return !!a && a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
}
@@ -374,4 +519,4 @@ function validRect(rect) {
return rect && [rect.x, rect.y, rect.width, rect.height].every(Number.isFinite) && rect.width > 0 && rect.height > 0;
}
module.exports = { BrowserViews, AGENT_VIEWPORT };
module.exports = { BrowserViews, AGENT_VIEWPORT, LEAVE_LIMIT_MS, placement, scaleInput };
+17
View File
@@ -0,0 +1,17 @@
"use strict";
// A person needs longer than this to read a panel and choose in it. A panel
// that closes sooner was never drawn: on Linux a missing file-chooser portal
// answers the same way as a dismissal, so the page would be told the person
// declined and would offer nothing else.
const UNDRAWN_MS = 400;
// folderAnswer is what the page is told about a folder panel: the path chosen,
// "" for a panel the person closed, and null for a panel that could not be shown,
// which the page answers by asking for the path in words.
function folderAnswer(result, elapsedMs, platform) {
if (!result.canceled && result.filePaths.length > 0) return result.filePaths[0];
return platform === "linux" && elapsedMs < UNDRAWN_MS ? null : "";
}
module.exports = { folderAnswer, UNDRAWN_MS };
+64
View File
@@ -0,0 +1,64 @@
"use strict";
// A page in a minimized Windows window has no surface to hit-test, so the mouse
// input the agent sends it is dropped while the call still answers and typed
// text still lands. Input is therefore sent with the window raised without
// activation, fully transparent and deaf to the mouse, and the window is
// minimized again once the agent has been quiet for a moment.
const SETTLE_MS = 300;
const HOLD_MS = 500;
class InputWake {
constructor({ win, platform = process.platform, settleMs = SETTLE_MS, holdMs = HOLD_MS }) {
this.win = win;
this.enabled = platform === "win32";
this.settleMs = settleMs;
this.holdMs = holdMs;
this.raised = null;
this.running = 0;
this.release = this.release.bind(this);
}
// run performs one input call with the window able to take it.
async run(call) {
this.running++;
clearTimeout(this.timer);
try {
await this.raise();
return await call();
} finally {
if (--this.running === 0) this.timer = setTimeout(this.release, this.holdMs);
}
}
raise() {
const win = this.win;
if (!this.enabled || win.isDestroyed()) return Promise.resolve();
if (this.raised) return this.raised;
if (!win.isMinimized()) return Promise.resolve();
this.raised = new Promise((resolve) => setTimeout(resolve, this.settleMs));
try {
win.setOpacity(0);
win.setIgnoreMouseEvents(true);
win.showInactive();
} catch (err) {
this.release();
throw err;
}
return this.raised;
}
release() {
if (!this.raised) return;
this.raised = null;
const win = this.win;
if (win.isDestroyed()) return;
const theirs = win.isFocused();
win.setIgnoreMouseEvents(false);
win.setOpacity(1);
if (!theirs) win.minimize();
}
}
module.exports = { InputWake, SETTLE_MS, HOLD_MS };
+63
View File
@@ -0,0 +1,63 @@
"use strict";
// Who owns the keyboard while the agent drives a page. A person typing in the
// app page keeps typing there: a page the agent opens, navigates or puts on
// screen is given the keyboard by the platform, and nothing the agent does is a
// reason for it to have it. The one reason that counts is the person's own: a
// click or a key that reached the page from the window, which is theirs to
// have chosen. The agent's own input arrives over the debugging protocol and
// is recognised as such, because it reaches the page the same way a click does.
const PERSON_MS = 400;
class KeyboardKeeper {
constructor({ win, now = Date.now }) {
this.win = win;
this.now = now;
this.owner = win.webContents.isFocused() ? "app" : "none";
win.webContents.on("focus", () => {
this.owner = "app";
});
}
// watch follows one page. synthetic() says whether input reaching it right now
// is the agent's own.
watch(contents, synthetic = () => false) {
let personAt = -Infinity;
contents.on("before-input-event", () => {
personAt = this.now();
});
contents.on("input-event", (_event, input) => {
if (input && input.type === "mouseDown" && !synthetic()) personAt = this.now();
});
contents.on("focus", () => {
if (this.now() - personAt < PERSON_MS) {
this.owner = "view";
return;
}
if (this.owner !== "app" || !this.live()) {
this.owner = "view";
return;
}
// The platform is still handing the page the keyboard while this event is
// delivered, and a focus asked for from inside it is lost; one a turn later
// is not, as long as nothing of the person's has arrived by then.
setTimeout(() => {
if (this.now() - personAt < PERSON_MS || this.owner !== "app" || !this.live()) return;
if (contents.isFocused()) this.win.webContents.focus();
}, 0);
});
}
// reclaim gives the keyboard back to the app page when attaching or moving a
// view left nobody holding it, while the window itself is the one in front.
reclaim() {
if (this.owner === "app" && this.live() && !this.win.webContents.isFocused()) this.win.webContents.focus();
}
live() {
return !this.win.isDestroyed() && this.win.isFocused();
}
}
module.exports = { KeyboardKeeper, PERSON_MS };
+5 -3
View File
@@ -22,6 +22,7 @@ const { reveal, revealWorkspace, revealLogs, openWorkspace, openFile } = require
const { appIcon } = require("./appicon");
const { setUnreadBadge } = require("./badge");
const layout = require("./layout");
const { folderAnswer } = require("./folderpanel");
const { offerCleanup } = require("./legacy");
const { stripPackageGrants, unpaintedWindowCause } = require("./packagegrants");
const { BrowserProtocol } = require("./browserprotocol");
@@ -472,17 +473,18 @@ ipcMain.handle("dialog:save-bytes", (event, name, bytes) =>
// createDirectory is the half that carries meaning: a panel that can only open
// what exists reads as an app that cannot start a project, which is what the
// Wails picker was reported as before it said so. A dismissed panel answers ""
// like the save dialogs, and startIn is dropped when it names nothing.
// like the save dialogs, a panel that could not be drawn answers null, and startIn
// is dropped when it names nothing.
ipcMain.handle("dialog:pick-folder", async (event, startIn) => {
const target = fromWindow(event);
if (!target) return "";
const shownAt = Date.now();
const picked = await dialog.showOpenDialog(target, {
defaultPath: startIn || undefined,
// Tools keep their working folders behind a leading dot, so those are listed too.
properties: ["openDirectory", "createDirectory", "showHiddenFiles"],
});
if (picked.canceled || !picked.filePaths.length) return "";
return picked.filePaths[0];
return folderAnswer(picked, Date.now() - shownAt, process.platform);
});
// Named before any path is derived from it: userData hangs off the app name,
+146
View File
@@ -0,0 +1,146 @@
import assert from "node:assert/strict";
import fs from "node:fs";
import { createRequire } from "node:module";
import os from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../..");
const require = createRequire(import.meta.url);
const { _electron } = require(path.join(root, "desktop/frontend-next/node_modules/playwright"));
const executablePath = process.env.REASONIX_TEST_ELECTRON || require("electron");
const home = fs.mkdtempSync(path.join(os.tmpdir(), "reasonix-attachments-live-"));
const workspace = path.join(home, "workspace");
const nativeBytes = 111 * 1024 * 1024;
const streamBytes = 65 * 1024 * 1024;
const artifacts = process.env.REASONIX_ATTACHMENT_ARTIFACTS;
let app;
let passed = false;
try {
fs.mkdirSync(workspace);
fs.writeFileSync(path.join(home, "config.toml"), [
'default_model = "smoke/smoke-model"', "[desktop]", "welcomed = true",
"[[providers]]", 'name = "smoke"', 'kind = "openai"',
'base_url = "http://127.0.0.1:9/v1"', 'models = ["smoke-model"]',
'default = "smoke-model"', 'api_key_env = "SMOKE_API_KEY"', "",
].join("\n"));
fs.writeFileSync(path.join(home, ".env"), "SMOKE_API_KEY=fixture\n");
const apk = path.join(home, "large.apk");
const file = fs.openSync(apk, "w");
fs.ftruncateSync(file, nativeBytes);
fs.closeSync(file);
app = await _electron.launch({
executablePath,
cwd: workspace,
args: [path.join(root, "desktop/electron"), "--user-data-dir=" + path.join(home, "electron-profile")],
env: {
...process.env, REASONIX_HOME: home, REASONIX_STATE_HOME: home,
REASONIX_CACHE_HOME: path.join(home, "cache"),
REASONIX_STUDIO_HOST: process.env.REASONIX_STUDIO_HOST || path.join(root, "desktop/electron/bin/reasonix-studio-host" + (process.platform === "win32" ? ".exe" : "")),
REASONIX_STUDIO_PAGE: path.join(root, "desktop/frontend-next/dist"),
},
});
let page;
for (let i = 0; i < 200; i++) {
page = app.windows().find(candidate => candidate.url().startsWith("http://127.0.0.1:"));
if (page) break;
await new Promise(resolve => setTimeout(resolve, 200));
}
assert.ok(page, "shell must open its loopback page");
await page.waitForLoadState("domcontentloaded");
await page.setViewportSize({ width: 1440, height: 900 });
await page.locator("#boot").waitFor({ state: "hidden", timeout: 60000 });
const status = await page.evaluate(async root => {
const response = await fetch("/runtimes", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ root }) });
return response.status;
}, workspace);
assert.equal(status, 200);
const project = page.locator(".wsrow").filter({ has: page.locator(".wsname").filter({ hasText: /^workspace$/ }) });
await project.locator("button.wsadd").click();
// A blank pane in this workspace may be reused without creating a runtime.
await page.waitForFunction(() => document.querySelector('.pane[data-active] input[type=file][data-action-change="session.attach"]') && !document.querySelector('.panes[aria-busy="true"]'));
const traffic = [];
page.on("request", request => {
if (/\/(drop|attachments)/.test(request.url())) traffic.push({ method: request.method(), url: request.url(), contentType: request.headers()["content-type"] });
});
const ready = count => page.waitForFunction(n => document.querySelectorAll('.pane[data-active] .shots .shot[data-state="ready"]').length >= n, count);
await page.locator('.pane[data-active] input[type=file][data-action-change="session.attach"]').setInputFiles(apk);
await ready(1);
assert.equal(traffic.length, 1);
assert.ok(traffic[0].url.endsWith("/drop"));
await page.evaluate(() => {
const source = document.createElement("input"); source.type = "file"; source.id = "stream-source"; document.body.append(source);
});
await page.locator("#stream-source").setInputFiles(apk);
for (const [index, kind] of ["paste", "drop"].entries()) {
const answer = page.waitForResponse(response => response.url().endsWith("/drop"));
await page.evaluate(kind => {
const transfer = new DataTransfer(); transfer.items.add(document.querySelector("#stream-source").files[0]);
const target = document.querySelector('.pane[data-active] textarea[data-action-paste="session.attach"]');
const event = kind === "paste" ? new ClipboardEvent("paste", { clipboardData: transfer, bubbles: true }) : new DragEvent("drop", { dataTransfer: transfer, bubbles: true });
target.dispatchEvent(event);
}, kind);
assert.equal((await answer).status(), 200);
await ready(index + 2);
}
assert.equal(traffic.length, 3);
assert.ok(traffic.every(request => request.url.endsWith("/drop")));
assert.equal(new Set(traffic.map(request => request.url)).size, 1);
const uploaded = page.waitForResponse(response => response.url().includes("/attachments/upload"));
await page.evaluate(bytes => {
const source = document.querySelector("#stream-source").files[0];
const file = new File([source.slice(0, bytes)], "stream.apk", { type: "application/vnd.android.package-archive" });
if (window.reasonixHost.pathForFile(file)) throw Error("virtual file unexpectedly has a native path");
const transfer = new DataTransfer(); transfer.items.add(file);
const input = document.querySelector('.pane[data-active] input[type=file][data-action-change="session.attach"]');
input.files = transfer.files;
input.dispatchEvent(new Event("change", { bubbles: true }));
}, streamBytes);
assert.equal((await uploaded).status(), 200);
await ready(4);
const saved = fs.readdirSync(path.join(workspace, ".reasonix/attachments")).find(file => file.endsWith(".apk"));
assert.ok(saved, "streamed attachment must be saved");
assert.equal(fs.statSync(path.join(workspace, ".reasonix/attachments", saved)).size, streamBytes);
assert.equal(traffic.length, 4);
assert.equal(traffic[3].contentType, "application/octet-stream");
const configPath = path.join(home, "config.toml");
fs.appendFileSync(configPath, "\n[attachments]\nmax_stream_bytes = 4\n");
const directory = path.join(workspace, ".reasonix/attachments");
const before = fs.readdirSync(directory).sort();
const refused = page.waitForResponse(response => response.url().includes("/attachments/upload") && response.status() === 413);
await page.evaluate(() => {
const transfer = new DataTransfer();
transfer.items.add(new File(["12345"], "over-limit.apk"));
const input = document.querySelector('.pane[data-active] input[type=file][data-action-change="session.attach"]');
input.files = transfer.files;
input.dispatchEvent(new Event("change", { bubbles: true }));
});
const rejection = await (await refused).json();
assert.equal(rejection.code, "attachment.too_large");
assert.equal(rejection.params.limit_bytes, 4);
assert.equal(rejection.params.limit_source, "user");
const failedChip = page.locator('.pane[data-active] .shot[data-state="failed"]');
await failedChip.locator(".why").waitFor({ state: "visible" });
assert.ok((await failedChip.locator(".why").textContent()).includes("MB"));
assert.deepEqual(fs.readdirSync(directory).sort(), before);
fs.writeFileSync(configPath, fs.readFileSync(configPath, "utf8").replace("max_stream_bytes = 4", "max_stream_bytes = 0"));
const retried = page.waitForResponse(response => response.url().includes("/attachments/upload"));
await failedChip.locator("button.retry").click();
assert.equal((await retried).status(), 200);
await ready(5);
assert.ok(await page.locator('.pane[data-active] textarea[data-action-paste="session.attach"]').isVisible());
const result = { nativeBytes, nativeEntries: ["picker", "paste", "drop"], streamBytes, readyAttachments: 5, limitRejection: rejection, unlimitedRetry: true, traffic };
if (artifacts) {
fs.mkdirSync(artifacts, { recursive: true });
await page.screenshot({ path: path.join(artifacts, "attachments-live.png") });
fs.writeFileSync(path.join(artifacts, "attachments-live.json"), JSON.stringify(result, null, 2) + "\n");
}
console.log(JSON.stringify(result));
passed = true;
} finally {
await app?.evaluate(({ app }) => app.exit(0)).catch(() => {});
await app?.close();
if (passed) fs.rmSync(home, { recursive: true, force: true });
else console.error("Failed run retained fixtures at " + home);
}
+106
View File
@@ -0,0 +1,106 @@
"use strict";
// A page the agent lays out in a viewport of its own (a resize) is shown whole in the panel, not cropped to its
// top-left corner: scaled down to fit and centred, with the agent's clicks still landing where they were aimed.
// Run with `pnpm browser-fit-live`; it needs no network. SHOTS=<dir> also writes pictures of the window.
const fs = require("node:fs");
const path = require("node:path");
const http = require("node:http");
const { execFileSync } = require("node:child_process");
const { app, BrowserWindow } = require("electron");
const { BrowserViews } = require("../src/browserviews");
const { checker } = require("./livekit");
const PAGE = `<!doctype html><title>wide</title><style>body{margin:0;font:20px sans-serif}.bar{display:flex;justify-content:space-between;background:#1a56db;color:#fff;padding:14px;width:1280px;box-sizing:border-box}.c{width:1280px;height:600px;background:linear-gradient(90deg,#fde68a,#a7f3d0);position:relative}.r,.l{position:absolute;top:10px;background:#111;color:#fff;padding:8px}.r{right:10px}.l{left:10px;top:60px}</style><div class=bar><b>LEFT edge</b><b>RIGHT edge</b></div><div class=c><span class=r id=rc onclick="document.title='hit'">right column</span><span class=l id=lc onclick="document.title='hit'">left column</span></div>`;
// Its own profile, so another Electron run on this machine does not hold this one back.
app.setPath("userData", fs.mkdtempSync(path.join(require("node:os").tmpdir(), "rx-fit-live-")));
const { check, failures } = checker();
const wait = (ms) => new Promise((r) => setTimeout(r, ms));
app.whenReady().then(async () => {
const server = http.createServer((_q, s) => { s.writeHead(200, { "Content-Type": "text/html" }); s.end(PAGE); });
await new Promise((r) => server.listen(0, "127.0.0.1", r));
const win = new BrowserWindow({ width: 1000, height: 760, show: true });
await win.loadURL("data:text/html,<body style='margin:0;background:%23ddd;font:14px sans-serif'><div style='position:absolute;left:20px;top:20px'>app chrome</div>");
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const page = views.create({ partition: "fit", url: `http://127.0.0.1:${server.address().port}/`, onEvent() {}, onClosed() {}, onPopup() {}, onDownload() {} });
const view = views.entries.get(page.targetId).view;
await wait(1500);
const evalIn = (expression) => page.send("Runtime.evaluate", { expression, returnByValue: true }).then((r) => r.result.value);
const shot = (name) => {
if (!process.env.SHOTS) return;
fs.mkdirSync(process.env.SHOTS, { recursive: true });
win.focus();
const b = win.getBounds();
execFileSync("screencapture", ["-x", "-R", `${b.x},${b.y},${b.width},${b.height}`, `${process.env.SHOTS}/${name}.png`]);
};
const click = async (id = "rc") => {
await evalIn("document.title='reset'");
const r = JSON.parse(await evalIn(`JSON.stringify(document.getElementById('${id}').getBoundingClientRect())`));
for (const type of ["mouseMoved", "mousePressed", "mouseReleased"]) {
await page.send("Input.dispatchMouseEvent", { type, x: r.x + r.width / 2, y: r.y + r.height / 2, button: "left", clickCount: 1 });
}
await wait(250);
return evalIn("document.title");
};
const panel = { x: 380, y: 60, width: 560, height: 620 };
views.show(page.targetId, panel);
await wait(600);
check("no resize: the page fills the panel as before", JSON.stringify(view.getBounds()) === JSON.stringify(panel));
await page.send("Emulation.setDeviceMetricsOverride", { width: 1280, height: 900, deviceScaleFactor: 0, mobile: false });
await wait(600);
const fit = view.getBounds();
check("a 1280x900 viewport in a 560x620 panel: the view is scaled to 560x394 and centred", fit.width === 560 && fit.height === 394 && fit.x === 380 && fit.y === 173, JSON.stringify(fit));
check("the page still lays out at the viewport it was given", (await evalIn("innerWidth")) === 1280);
check("an agent click aimed at the right column lands on it", (await click()) === "hit");
shot("fit-in-panel");
views.show(page.targetId, { x: 380, y: 60, width: 400, height: 500 });
await wait(600);
const narrower = view.getBounds();
check("a narrower panel re-fits the view", narrower.width === 400 && narrower.height === 281, JSON.stringify(narrower));
check("and the click still lands", (await click()) === "hit");
views.show(page.targetId, { x: 20, y: 20, width: 1400, height: 1000 });
await wait(600);
const roomy = view.getBounds();
check("a panel larger than the viewport shows it at full size, centred, never enlarged", roomy.width === 1280 && roomy.height === 900 && roomy.x === 80 && roomy.y === 70, JSON.stringify(roomy));
check("and the click lands at full size", (await click()) === "hit");
views.hide();
await wait(600);
check("parked, the page is not scaled and the click lands", (await click()) === "hit");
views.show(page.targetId, panel);
await wait(600);
check("shown again it is fitted again", view.getBounds().width === 560 && (await click()) === "hit");
const small = { x: 20, y: 20, width: 900, height: 700 };
views.show(page.targetId, small);
await page.send("Emulation.setDeviceMetricsOverride", { width: 390, height: 600, deviceScaleFactor: 0, mobile: false });
await wait(600);
const phone = view.getBounds();
check("a viewport smaller than the panel is shown at its own size, centred, not in the panel's corner", phone.width === 390 && phone.height === 600 && phone.x === 20 + (900 - 390) / 2 && phone.y === 20 + (700 - 600) / 2, JSON.stringify(phone));
check("and a click on it lands", (await click("lc")) === "hit");
views.show(page.targetId, panel);
await page.send("Emulation.setDeviceMetricsOverride", { width: 1280, height: 900, deviceScaleFactor: 0, mobile: false });
await wait(600);
const taken = await page.send("Page.captureScreenshot", { format: "png" });
const png = Buffer.from(taken.data, "base64");
check("the agent's screenshot is the size of the viewport it asked for", png.readUInt32BE(16) === 1280 && png.readUInt32BE(20) === 900, `${png.readUInt32BE(16)}x${png.readUInt32BE(20)}`);
await wait(600);
check("after the agent takes a screenshot the page is still fitted and a click still lands", (await click()) === "hit");
await page.send("Emulation.setDeviceMetricsOverride", { width: 0, height: 0, deviceScaleFactor: 0, mobile: false });
await wait(600);
check("a zero-sized override is no override: the page fills the panel and a click lands", JSON.stringify(view.getBounds()) === JSON.stringify(panel) && (await evalIn("innerWidth")) === 560 && (await click("lc")) === "hit", JSON.stringify(view.getBounds()));
await page.send("Emulation.clearDeviceMetricsOverride", {});
await wait(600);
check("clearing the viewport gives the page its panel back", JSON.stringify(view.getBounds()) === JSON.stringify(panel) && (await evalIn("innerWidth")) === 560);
shot("cleared");
console.log(failures.length ? `\n${failures.length} failed` : "\nall passed");
app.exit(failures.length ? 1 : 0);
});
@@ -0,0 +1,80 @@
"use strict";
// Local html previews, an oversized image document and a PDF in the built-in browser, each with and without an
// agent viewport: the view must be filled by the page, measured on the pixels, not just sized right.
const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");
const { app, BrowserWindow } = require("electron");
const { BrowserViews } = require("../src/browserviews");
const { checker } = require("./livekit");
app.setPath("userData", fs.mkdtempSync(path.join(os.tmpdir(), "rx-fit-pages-")));
const { check, failures } = checker();
const wait = (ms) => new Promise((r) => setTimeout(r, ms));
const PANEL = { x: 380, y: 60, width: 560, height: 620 };
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rx-pages-"));
function png(w, h, rgb) {
const zlib = require("node:zlib");
const crc = (buf) => { let c, t = []; for (let n = 0; n < 256; n++) { c = n; for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; t[n] = c >>> 0; } let r = 0xffffffff; for (const b of buf) r = t[(r ^ b) & 255] ^ (r >>> 8); return (r ^ 0xffffffff) >>> 0; };
const chunk = (type, data) => { const len = Buffer.alloc(4); len.writeUInt32BE(data.length); const body = Buffer.concat([Buffer.from(type), data]); const c = Buffer.alloc(4); c.writeUInt32BE(crc(body)); return Buffer.concat([len, body, c]); };
const ihdr = Buffer.alloc(13); ihdr.writeUInt32BE(w, 0); ihdr.writeUInt32BE(h, 4); ihdr[8] = 8; ihdr[9] = 2;
const row = Buffer.concat([Buffer.from([0]), Buffer.from(Array.from({ length: w }, () => rgb).flat())]);
return Buffer.concat([Buffer.from("\x89PNG\r\n\x1a\n", "binary"), chunk("IHDR", ihdr), chunk("IDAT", zlib.deflateSync(Buffer.concat(Array.from({ length: h }, () => row)))), chunk("IEND", Buffer.alloc(0))]);
}
fs.writeFileSync(path.join(dir, "big.png"), png(3200, 1800, [37, 99, 235]));
fs.copyFileSync("/tmp/fl/preview.html", path.join(dir, "preview.html"));
fs.copyFileSync("/tmp/fl/page.pdf", path.join(dir, "page.pdf"));
// Share of the view's sampled pixels that are the near-white or light-grey empty background of an unfilled view.
async function emptyShare(view) {
const img = await view.webContents.capturePage();
const { width, height } = img.getSize();
const bm = img.toBitmap();
let empty = 0, blue = 0, n = 0;
for (let y = 2; y < height - 2; y += Math.max(1, Math.floor(height / 40))) {
for (let x = 2; x < width - 2; x += Math.max(1, Math.floor(width / 40))) {
const i = (y * width + x) * 4;
const b = bm[i], g = bm[i + 1], r = bm[i + 2];
n++;
if (Math.min(r, g, b) > 225 && Math.max(r, g, b) - Math.min(r, g, b) < 12) empty++;
if (b > 180 && r < 90 && g < 150) blue++;
}
}
return { share: empty / n, blue: blue / n, width, height };
}
app.whenReady().then(async () => {
const win = new BrowserWindow({ width: 1000, height: 760, show: true });
await win.loadURL("data:text/html,<body style='margin:0;background:%23ddd'>app");
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const cases = [
["local html preview, no override", "preview.html", null],
["local html preview, 1280x900 override", "preview.html", { width: 1280, height: 900 }],
["local html preview, oversized 3200x1800 override", "preview.html", { width: 3200, height: 1800 }],
["3200x1800 image document, no override", "big.png", null],
["3200x1800 image document, 3200x1800 override", "big.png", { width: 3200, height: 1800 }],
["PDF, no override", "page.pdf", null],
["PDF, 1280x900 override", "page.pdf", { width: 1280, height: 900 }],
];
for (const [name, file, override] of cases) {
const page = views.create({ partition: "p" + Math.random(), url: "file://" + path.join(dir, file), onEvent() {}, onClosed() {}, onPopup() {}, onDownload() {} });
const entry = views.entries.get(page.targetId);
await wait(file.endsWith(".pdf") ? 3500 : 1500);
views.show(page.targetId, PANEL);
await wait(500);
if (override) await page.send("Emulation.setDeviceMetricsOverride", { ...override, deviceScaleFactor: 0, mobile: false });
await wait(file.endsWith(".pdf") ? 2500 : 1200);
const at = entry.view.getBounds();
if (process.env.SHOTS) { fs.mkdirSync(process.env.SHOTS, { recursive: true }); fs.writeFileSync(path.join(process.env.SHOTS, name.replace(/[^a-z0-9]+/gi, "-") + ".png"), (await entry.view.webContents.capturePage()).toPNG()); }
const m = await emptyShare(entry.view);
const inside = at.x >= PANEL.x && at.y >= PANEL.y && at.x + at.width <= PANEL.x + PANEL.width && at.y + at.height <= PANEL.y + PANEL.height;
const shown = file.endsWith(".html") ? m.share < 0.15 : m.share < 0.15 && m.blue >= (file.endsWith(".png") ? 0.5 : 0.05);
const detail = `view ${JSON.stringify(at)}, empty ${(m.share * 100).toFixed(0)}%, page-coloured ${(m.blue * 100).toFixed(0)}% of ${m.width}x${m.height}`;
console.log(" measured:", name, detail);
check(`${name}: the view sits inside the panel and the page is drawn in it`, inside && shown, detail);
views.close?.(page.targetId);
}
console.log(failures.length ? `\n${failures.length} failed` : "\nall passed");
app.exit(failures.length ? 1 : 0);
});
+40 -8
View File
@@ -95,15 +95,41 @@ async function main() {
const width = () => guest.getBounds().width;
// Watching the agent browse and reading what it says are one activity: the
// page is beside the conversation from the moment it opens.
const aside = await until("the page beside the conversation", async () => (!beneath() ? guest.getBounds() : null));
await until("the page beside the conversation", async () => (!beneath() ? guest.getBounds() : null));
// The conversation's column settles after the page first appears, so the place
// "beside" is read once the page has stopped moving.
const still = (a, b) => ["x", "y", "width", "height"].every((k) => Math.abs(a[k] - b[k]) <= 1);
let seen = guest.getBounds();
const aside = await until("the page to settle beside the conversation", async () => {
await wait(300);
const now = guest.getBounds();
const steady = still(now, seen);
seen = now;
return steady ? now : null;
});
check("the page is drawn beside the conversation as soon as the agent opens one",
aside.width < win.getContentBounds().width, { aside, content: win.getContentBounds() });
const js = (src) => win.webContents.executeJavaScript(src);
const reserved = () => js(`(() => { const e = document.querySelector('.bview'); if (!e) return null; const b = e.getBoundingClientRect(); return { x: b.left, y: b.top, width: b.width, height: b.height }; })()`);
await until("the browser tab in the pane bar", () => js(`!!document.querySelector('[data-action="pane.view"][data-value="browser"]')`));
await js(`document.querySelector('[data-action="pane.view"][data-value="browser"]').click()`);
const placed = await until("the page drawn full width", async () => (width() > aside.width ? guest.getBounds() : null));
// The browser tab beside the conversation is a switch for that view itself, so
// the page is widened with the browser's own wide control, which is how the
// person makes it the whole pane.
await until("the wide control on the browser panel", () => js(`!!document.querySelector('[data-action="browser.wide"]')`));
await js(`document.querySelector('[data-action="browser.wide"]').click()`);
// A page that is put away is as wide as an agent's viewport, so wide means drawn
// and wider than it was beside the conversation.
await until("the page drawn full width", async () => (!beneath() && width() > aside.width ? guest.getBounds() : null));
// The panel widens over a moment; the rectangle is read once it has stopped.
const same = still;
let last = guest.getBounds();
const placed = await until("the page to stop moving", async () => {
await wait(300);
const now = guest.getBounds();
const still = same(now, last);
last = now;
return still ? now : null;
});
const slot = await reserved();
const close = (a, b) => Math.abs(a - b) <= 1;
// The rectangle itself has to be the pane: with the conversation's column
@@ -123,11 +149,14 @@ async function main() {
process.stdout.write(` (no screenshot: ${err.message})\n`);
}
await js(`document.querySelector('[data-action="pane.view"][data-value="flow"]').click()`);
const back = await until("the page beside the conversation again", async () => (width() < placed.width ? guest.getBounds() : null));
check("leaving the full-width view puts the page back beside the conversation", back.width === aside.width && !beneath(), { back, aside });
await js(`document.querySelector('[data-action="browser.wide"]').click()`);
const back = await until("the page beside the conversation again", async () => (!beneath() && width() < placed.width ? guest.getBounds() : null));
// The column settles a pixel or two after the first measurement, so beside means
// the same place and size to within a few pixels.
check("leaving the full-width view puts the page back beside the conversation", Math.abs(back.width - aside.width) <= 3 && Math.abs(back.x - aside.x) <= 3 && !beneath(), { back, aside });
await js(`document.querySelector('[data-action="pane.dock"]').click()`);
// The browser tab is the switch for the side-by-side view.
await js(`document.querySelector('[data-action="pane.view"][data-value="browser"]').click()`);
await until("the page put away", async () => beneath());
check("turning the side-by-side view off stops drawing the page", beneath());
@@ -144,6 +173,8 @@ async function main() {
// One request per call plus the one that reads the last result.
const calls = act === "network" ? 3 : 2;
await until(`the turn that would ${act}`, async () => requests.length > before + calls, 90000);
// The next turn is submitted only once this one has ended, or it is queued behind it.
await until(`the ${act} turn to end`, async () => ((await js(`!document.querySelector('[data-action="session.stop"]')`)) ? true : null), 30000);
return (requests.at(-1).messages || []).filter((m) => m.role === "tool").map((m) => String(m.content || "")).join("\n");
};
const askFor = async (name) => {
@@ -159,6 +190,7 @@ async function main() {
check("the agent's input reaches the page while the window is minimized", await askFor("韩梅梅"), await greeting());
win.restore();
win.focus();
const cover = new BrowserWindow({ width: 1600, height: 1000, x: 0, y: 0, alwaysOnTop: true });
await cover.loadURL("data:text/html,<h1>cover</h1>");
cover.focus();
@@ -0,0 +1,89 @@
"use strict";
// A page the agent lays out at a viewport wider than the pane has to stay whole for the
// person watching: the view shows all of it, scaled to the pane, not its left part.
const os = require("node:os");
const path = require("node:path");
const fs = require("node:fs");
const { execFileSync } = require("node:child_process");
const { app } = require("electron");
const { checker, listen, scriptedModel, seedHome, settledWindow, until, wait } = require("./livekit");
const PAGE = `<!doctype html><title>Wide</title><body style="margin:0">
<div style="width:100vw;height:100vh;background:linear-gradient(90deg,#e33,#33e);color:#fff;font:48px sans-serif">
<span style="position:absolute;left:12px;top:12px">LEFT</span>
<span style="position:absolute;right:12px;top:12px">RIGHT</span>
<button id="go" style="position:absolute;right:40px;top:300px;font:32px sans-serif" onclick="document.title='clicked'">Go</button></div>`;
const { check, failures } = checker();
const SIZE = { width: 1440, height: 1000 };
async function main() {
const page = await listen((req, res) => {
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
res.end(PAGE);
});
let calls = 0;
const { handler, requests } = scriptedModel((tools) => {
calls++;
if (calls === 1) return { name: "browser_open", arguments: { url: `${page.url}/` } };
if (calls === 2) return { name: "browser_act", arguments: { tab: "t1", steps: [{ action: "resize", ...SIZE }] } };
if (calls === 3) return { name: "browser_read", arguments: { tab: "t1", what: "screenshot" } };
if (calls === 4) {
const ref = (tools.join("\n").match(/button "Go" \[(e\d+)\]/) || [])[1];
return { name: "browser_act", arguments: { tab: "t1", steps: [{ action: "click", ref }] } };
}
return null;
});
const model = await listen(handler);
const home = fs.mkdtempSync(path.join(os.tmpdir(), "rx-resize-live-"));
const workspace = fs.mkdtempSync(path.join(os.tmpdir(), "rx-resize-ws-"));
process.env.REASONIX_HOME = home;
seedHome(home, model.url, workspace);
const { current } = require("../src/main.js");
try {
const win = await settledWindow();
const { client } = current();
const runtimes = await until("a pane", async () => {
const list = await client.json("GET", "/runtimes");
return Array.isArray(list) && list.length ? list : null;
});
await client.request("POST", `${runtimes[0].base}/submit`, { input: "open the wide page and lay it out wide" });
await until("the scripted turn", async () => requests.length >= 5, 60000);
const guests = () => win.contentView.children.filter((v) => v.webContents && v.webContents !== win.webContents);
const guest = await until("a page view", async () => guests()[0]);
await until("the page beside the conversation", async () => (guest.getBounds().x >= 0 ? true : null));
await wait(1500);
const bounds = guest.getBounds();
const inner = await guest.webContents.executeJavaScript("[innerWidth, innerHeight]");
check("the page is laid out at the viewport the agent asked for", inner[0] === SIZE.width && inner[1] === SIZE.height, inner);
const draw = (name) => {
const file = path.join(os.tmpdir(), name);
try {
execFileSync("screencapture", ["-x", "-o", "-l", win.getMediaSourceId().split(":")[1], file]);
process.stdout.write(` screenshot: ${file}\n`);
} catch (err) {
process.stdout.write(` (no screenshot: ${err.message})\n`);
}
};
const shown = await guest.webContents.capturePage();
const size = shown.getSize();
const px = shown.toBitmap();
const at = (x, y) => { const i = (y * size.width + x) * 4; return { b: px[i], g: px[i + 1], r: px[i + 2] }; };
const edge = at(size.width - 6, 6);
check("the right edge of the page is what the view draws at its right edge", edge.b > edge.r, edge);
check("the agent's click on a control at the right of the page landed", (await guest.webContents.getTitle()) === "clicked", await guest.webContents.getTitle());
draw("rx-resize-live.png");
const taken = await guest.webContents.debugger.sendCommand("Page.captureScreenshot", { format: "png" });
const dims = require("electron").nativeImage.createFromBuffer(Buffer.from(taken.data, "base64")).getSize();
process.stdout.write(` agent screenshot ${JSON.stringify(dims)}\n`);
check("a screenshot taken the way the agent takes one shows the page at the size it asked for", dims.width === SIZE.width && dims.height === SIZE.height, dims);
process.stdout.write(` bounds ${JSON.stringify(bounds)} inner ${JSON.stringify(inner)}\n`);
} catch (err) {
check("the run completed", false, String(err && err.message ? err.message : err));
}
process.stdout.write(failures.length ? `${failures.length} check(s) failed\n` : "all checks passed\n");
app.exit(failures.length ? 1 : 0);
}
app.whenReady().then(main);
+141
View File
@@ -0,0 +1,141 @@
"use strict";
// Who owns the keyboard while the agent drives its browser. A person typing in
// the app page must still be typing there after the agent opens a page, shows
// it, clicks in it, types into it or asks for it to come to the front: the
// agent's commands arrive over the debugging protocol, and nothing it sends may
// move the focus out of the page the person is in. Run with `pnpm focus-live`;
// it needs no network and no kernel.
const { app, BrowserWindow } = require("electron");
const { BrowserProtocol } = require("../src/browserprotocol");
const { BrowserViews } = require("../src/browserviews");
const { checker, listen, wait } = require("./livekit");
const APP = `<!doctype html><title>app</title><textarea id="compose" autofocus></textarea>`;
const PAGE = `<!doctype html><title>page</title><input id="name"><button id="go" onclick="document.title='clicked'">Go</button>`;
const { check, failures } = checker();
async function main() {
await app.whenReady();
const page = await listen((_req, res) => {
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
res.end(PAGE);
});
const win = new BrowserWindow({ width: 1000, height: 700, show: true, webPreferences: { contextIsolation: true } });
await win.loadURL("data:text/html;charset=utf-8," + encodeURIComponent(APP));
win.show();
app.focus({ steal: true });
win.focus();
win.webContents.focus();
await wait(800);
if (!win.webContents.isFocused()) {
process.stdout.write(" SKIP this desktop would not give the test window the keyboard, so there is nothing to keep\n");
app.exit(0);
return;
}
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const frames = [];
const waiting = new Map();
const protocol = new BrowserProtocol({
createView: (spec) => views.create(spec),
post: (frame) => {
frames.push(frame);
const id = frame.message && frame.message.id;
if (id !== undefined && waiting.has(id)) waiting.get(id)(frame.message);
},
});
let n = 0;
const send = (message, sessionId) => new Promise((resolve) => {
const id = ++n;
waiting.set(id, resolve);
protocol.receive({ conn: "c", message: JSON.stringify({ id, ...message, ...(sessionId ? { sessionId } : {}) }) });
setTimeout(() => resolve({ timedOut: true }), 4000);
});
const where = async () => ({
app: await win.webContents.executeJavaScript("document.activeElement && document.activeElement.id"),
appFocused: win.webContents.isFocused(),
viewFocused: [...views.entries.values()].some((e) => e.view.webContents.isFocused()),
});
const keepsTheKeyboard = async (what) => {
const w = await where();
check(`${what}: the composer keeps the keyboard`, w.app === "compose" && w.appFocused && !w.viewFocused, w);
};
protocol.receive({ conn: "c", open: "focus-live" });
await keepsTheKeyboard("before the agent does anything");
const created = await send({ method: "Target.createTarget", params: { url: page.url } });
const targetId = created.result.targetId;
const attached = await send({ method: "Target.attachToTarget", params: { targetId } });
const session = attached.result.sessionId;
await wait(1200);
await keepsTheKeyboard("opening a page");
views.show(targetId, { x: 300, y: 100, width: 600, height: 400 });
await wait(500);
await keepsTheKeyboard("showing it over the page");
await send({ method: "Page.bringToFront" }, session);
await wait(300);
await keepsTheKeyboard("asking for the page to come to the front");
await send({ method: "Input.dispatchMouseEvent", params: { type: "mousePressed", x: 40, y: 20, button: "left", clickCount: 1 } }, session);
await send({ method: "Input.dispatchMouseEvent", params: { type: "mouseReleased", x: 40, y: 20, button: "left", clickCount: 1 } }, session);
await wait(300);
await keepsTheKeyboard("a click inside the agent's page");
await send({ method: "Input.insertText", params: { text: "hello" } }, session);
await send({ method: "Input.dispatchKeyEvent", params: { type: "keyDown", key: "a", text: "a" } }, session);
await send({ method: "Input.dispatchKeyEvent", params: { type: "keyUp", key: "a" } }, session);
await wait(300);
await keepsTheKeyboard("typing into the agent's page");
await send({ method: "Runtime.evaluate", params: { expression: "document.querySelector('#name').focus()" } }, session);
await wait(300);
await keepsTheKeyboard("the page focusing one of its own fields");
await send({ method: "Page.navigate", params: { url: page.url + "/next" } }, session);
await wait(1200);
await keepsTheKeyboard("navigating the agent's page");
views.hide();
await wait(300);
await keepsTheKeyboard("putting the page away");
// The other half: a person who clicks into the agent's page is typing there,
// and the agent navigating it again does not take that away from them.
views.show(targetId, { x: 300, y: 100, width: 600, height: 400 });
await wait(500);
const theirs = [...views.entries.values()][0].view.webContents;
// A click that reaches the page from the window, and the focus the platform
// gives the page because of it; sendInputEvent alone does not move focus.
theirs.sendInputEvent({ type: "mouseDown", x: 40, y: 20, button: "left", clickCount: 1 });
theirs.focus();
theirs.sendInputEvent({ type: "mouseUp", x: 40, y: 20, button: "left", clickCount: 1 });
await wait(500);
const chosen = await where();
check("a click of the person's own into the agent's page gives it the keyboard", chosen.viewFocused && !chosen.appFocused, chosen);
await send({ method: "Page.navigate", params: { url: page.url + "/again" } }, session);
await wait(1200);
const stays = await where();
check("and the agent navigating it again does not pull the keyboard back", stays.viewFocused && !stays.appFocused, stays);
win.webContents.focus();
await wait(300);
win.minimize();
await wait(400);
win.restore();
await wait(600);
await keepsTheKeyboard("the window being minimized and restored");
page.server.close();
app.exit(failures.length ? 1 : 0);
}
main().catch((err) => {
process.stdout.write(` FAIL focus-live crashed — ${err && err.stack}\n`);
app.exit(1);
});
+114
View File
@@ -0,0 +1,114 @@
"use strict";
// A local image the agent opens in its browser has to be on screen, not a blank
// panel under the image's own title. The page is opened the way the kernel opens
// one (Target.createTarget on a file: address), shown over the rectangle the
// panel reserves, and what the view actually drew is read back and judged.
// Run with `pnpm image-live`; it needs no network and no kernel.
const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");
const { app, BrowserWindow, nativeImage } = require("electron");
const { BrowserViews } = require("../src/browserviews");
const { BrowserProtocol } = require("../src/browserprotocol");
const { checker, listen, wait } = require("./livekit");
const { check, failures } = checker();
function picture(width, height, file) {
const bitmap = Buffer.alloc(width * height * 4);
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
const at = (y * width + x) * 4;
bitmap[at] = (x * 255) / width;
bitmap[at + 1] = (y * 255) / height;
bitmap[at + 2] = 128;
bitmap[at + 3] = 255;
}
}
fs.writeFileSync(file, nativeImage.createFromBitmap(bitmap, { width, height }).toPNG());
}
// How much of what was drawn is neither the panel's own white nor transparent.
async function inked(view) {
const shot = await view.webContents.capturePage();
const { width, height } = shot.getSize();
if (!width || !height) return { width, height, share: 0 };
const bitmap = shot.toBitmap();
let ink = 0;
for (let i = 0; i < bitmap.length; i += 4) {
const blank = bitmap[i + 3] === 0 || (bitmap[i] > 245 && bitmap[i + 1] > 245 && bitmap[i + 2] > 245);
if (!blank) ink++;
}
return { width, height, share: ink / (bitmap.length / 4) };
}
async function main() {
await app.whenReady();
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rx-image-live-"));
const small = path.join(dir, "small.png");
const large = path.join(dir, "large.png");
const html = path.join(dir, "page.html");
picture(320, 180, small);
picture(3200, 1800, large);
fs.writeFileSync(html, `<!doctype html><title>page</title><body style="margin:0;background:#2a6"><h1>hello</h1>`);
const web = await listen((req, res) => {
res.writeHead(200, { "Content-Type": "image/png" });
res.end(fs.readFileSync(large));
});
const win = new BrowserWindow({ width: 1280, height: 800, show: true });
await win.loadURL("data:text/html;charset=utf-8," + encodeURIComponent("<body style='margin:0'>app"));
await wait(500);
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const waiting = new Map();
const protocol = new BrowserProtocol({
createView: (spec) => views.create(spec),
post: (frame) => {
const id = frame.message && frame.message.id;
if (id !== undefined && waiting.has(id)) waiting.get(id)(frame.message);
},
});
let n = 0;
const send = (message) => new Promise((resolve) => {
const id = ++n;
waiting.set(id, resolve);
protocol.receive({ conn: "c", message: JSON.stringify({ id, ...message }) });
setTimeout(() => resolve({ timedOut: true }), 5000);
});
protocol.receive({ conn: "c", open: "image-live" });
const cases = [
["a small local image", "file://" + (process.platform === "win32" ? "/" : "") + small.replace(/\\/g, "/")],
["a 3200x1800 local image", "file://" + (process.platform === "win32" ? "/" : "") + large.replace(/\\/g, "/")],
["a local html page", "file://" + (process.platform === "win32" ? "/" : "") + html.replace(/\\/g, "/")],
["a 3200x1800 image over http", web.url + "/big.png"],
];
for (const [name, url] of cases) {
const created = await send({ method: "Target.createTarget", params: { url } });
const targetId = created.result && created.result.targetId;
if (!targetId) {
check(`${name}: the agent got a page`, false, created);
continue;
}
await wait(1500);
const view = [...views.entries.values()].find((e) => e.view)?.view;
const entry = views.entries.get(targetId);
views.show(targetId, { x: 300, y: 100, width: 800, height: 500 });
await wait(1200);
const where = entry.view.getBounds();
const drawn = await inked(entry.view);
check(`${name}: it is placed over the reserved rectangle`, where.x === 300 && where.y === 100 && where.width === 800 && where.height === 500, where);
check(`${name}: what the view drew is not blank`, drawn.share > 0.2, drawn);
await send({ method: "Target.closeTarget", params: { targetId } });
await wait(300);
void view;
}
web.server.close();
app.exit(failures.length ? 1 : 0);
}
main().catch((err) => {
process.stdout.write(` FAIL image-live crashed — ${err && err.stack}\n`);
app.exit(1);
});
+78
View File
@@ -0,0 +1,78 @@
"use strict";
// The agent opens a local image in the built-in browser, through the real kernel
// and the real window. The tab has to show the picture: a view over the
// rectangle the panel reserved whose pixels are the image, small or 3200x1800.
// Run with `pnpm image-pane-live`; it needs no network.
const os = require("node:os");
const path = require("node:path");
const fs = require("node:fs");
const { app, nativeImage } = require("electron");
const { checker, scriptedModel, listen, seedHome, settledWindow, until, wait } = require("./livekit");
const { check, failures } = checker();
const script = { url: "" };
function picture(width, height, file) {
const bitmap = Buffer.alloc(width * height * 4);
for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {
const at = (y * width + x) * 4;
bitmap[at] = (x * 255) / width; bitmap[at + 1] = (y * 255) / height; bitmap[at + 2] = 128; bitmap[at + 3] = 255;
}
fs.writeFileSync(file, nativeImage.createFromBitmap(bitmap, { width, height }).toPNG());
}
async function main() {
// The kernel only lets the agent open a local file inside the workspace.
const workspace = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), "rx-image-ws-")));
const small = path.join(workspace, "small.png");
const large = path.join(workspace, "ode_solution.png");
picture(320, 180, small);
picture(3200, 1800, large);
const fileURL = (p) => "file://" + (process.platform === "win32" ? "/" : "") + p.replace(/\\/g, "/");
let calls = 0;
const model = await listen(scriptedModel((tools) => {
if (calls >= 1) return null;
calls++;
return { name: "browser_open", arguments: { url: script.url } };
}).handler);
const home = fs.mkdtempSync(path.join(os.tmpdir(), "rx-image-home-"));
process.env.REASONIX_HOME = home;
seedHome(home, model.url, workspace);
const { current } = require("../src/main.js");
const win = await settledWindow();
const { client } = current();
const runtimes = await until("a pane", async () => {
const list = await client.json("GET", "/runtimes");
return Array.isArray(list) && list.length ? list : null;
});
const base = runtimes[0].base;
const guests = () => win.contentView.children.filter((v) => v.webContents && v.webContents !== win.webContents);
for (const [name, file] of [["a small local image", small], ["a 3200x1800 local image", large]]) {
script.url = fileURL(file);
calls = 0;
const before = guests().length;
await client.request("POST", `${base}/submit`, { input: `show ${name}` });
const guest = await until(`${name}: a page view`, async () => guests()[guests().length - 1], 60000);
await until(`${name}: the page beside the conversation`, async () => (guest.getBounds().x >= 0 ? true : null), 30000).catch(() => null);
await wait(1500);
const b = guest.getBounds();
const shot = await guest.webContents.capturePage();
const size = shot.getSize();
const bitmap = size.width ? shot.toBitmap() : Buffer.alloc(0);
let ink = 0;
for (let i = 0; i < bitmap.length; i += 4) if (!(bitmap[i + 3] === 0 || (bitmap[i] > 245 && bitmap[i + 1] > 245 && bitmap[i + 2] > 245))) ink++;
const share = bitmap.length ? ink / (bitmap.length / 4) : 0;
check(`${name}: the view is on screen, beside the conversation`, b.x >= 0 && b.width > 100 && b.height > 100, b);
check(`${name}: the title is the image's own`, guest.webContents.getTitle().includes(path.basename(file)), guest.webContents.getTitle());
check(`${name}: what the view drew is the picture, not a blank`, share > 0.2, { share, size, bounds: b, scale: require("electron").screen.getPrimaryDisplay().scaleFactor });
void before;
}
app.exit(failures.length ? 1 : 0);
}
app.whenReady().then(main).catch((err) => {
process.stdout.write(` FAIL image-pane-live crashed — ${err && err.stack}\n`);
app.exit(1);
});
+125
View File
@@ -0,0 +1,125 @@
"use strict";
// A person in the middle of an IME composition — the pinyin letters still
// underlined, the candidate list open — must not lose it when the agent's browser
// loads, navigates, reloads or is shown. Losing it is not a lost focus that comes
// back: the composition is committed as the raw letters and the word they were
// spelling is gone. Run with `pnpm ime-live`; it needs no network and no kernel.
const { app, BrowserWindow } = require("electron");
const { BrowserViews, LEAVE_LIMIT_MS } = require("../src/browserviews");
const { BrowserProtocol } = require("../src/browserprotocol");
const { checker, listen, wait } = require("./livekit");
const APP = `<!doctype html><title>app</title><textarea id="compose" autofocus></textarea>
<script>window.__ime = { start: 0, update: 0, end: 0, blur: 0 };
const t = document.getElementById("compose");
t.addEventListener("compositionstart", () => __ime.start++);
t.addEventListener("compositionupdate", () => __ime.update++);
t.addEventListener("compositionend", () => __ime.end++);
t.addEventListener("blur", () => __ime.blur++);</script>`;
const PAGE = `<!doctype html><title>page</title><input id="name"><p>hello</p>`;
const { check, failures } = checker();
async function main() {
await app.whenReady();
const page = await listen((req, res) => {
// A server that takes the connection and never answers.
if (req.url === "/hang") return;
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
res.end(PAGE);
});
const win = new BrowserWindow({ width: 1000, height: 700, show: true });
await win.loadURL("data:text/html;charset=utf-8," + encodeURIComponent(APP));
win.show();
app.focus({ steal: true });
win.focus();
win.webContents.focus();
await wait(800);
if (!win.webContents.isFocused()) {
process.stdout.write(" SKIP this desktop would not give the test window the keyboard, so there is nothing to keep\n");
app.exit(0);
return;
}
const dbg = win.webContents.debugger;
dbg.attach("1.3");
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const waiting = new Map();
const protocol = new BrowserProtocol({
createView: (spec) => views.create(spec),
post: (frame) => {
const id = frame.message && frame.message.id;
if (id !== undefined && waiting.has(id)) waiting.get(id)(frame.message);
},
});
let n = 0;
const send = (message, sessionId) => new Promise((resolve) => {
const id = ++n;
waiting.set(id, resolve);
protocol.receive({ conn: "c", message: JSON.stringify({ id, ...message, ...(sessionId ? { sessionId } : {}) }) });
setTimeout(() => resolve({ timedOut: true }), 4000);
});
const ime = () => win.webContents.executeJavaScript("JSON.stringify({ ...window.__ime, value: document.getElementById('compose').value })").then(JSON.parse);
const compose = async (text) => {
await win.webContents.executeJavaScript("window.__ime.start = window.__ime.update = window.__ime.end = window.__ime.blur = 0; document.getElementById('compose').value = ''; document.getElementById('compose').focus()");
await dbg.sendCommand("Input.imeSetComposition", { text, selectionStart: text.length, selectionEnd: text.length });
await wait(150);
};
const keepsComposing = async (what) => {
const s = await ime();
check(`${what}: the composition is still open`, s.start >= 1 && s.end === 0, s);
};
protocol.receive({ conn: "c", open: "ime-live" });
await compose("nihao");
await keepsComposing("before the agent does anything");
const created = await send({ method: "Target.createTarget", params: { url: page.url } });
const targetId = created.result.targetId;
const session = (await send({ method: "Target.attachToTarget", params: { targetId } })).result.sessionId;
await wait(1500);
await keepsComposing("opening a page");
await compose("zhongwen");
views.show(targetId, { x: 300, y: 100, width: 600, height: 400 });
await wait(600);
await keepsComposing("showing it");
await compose("ceshi");
await send({ method: "Page.navigate", params: { url: page.url + "/next" } }, session);
await wait(1500);
await keepsComposing("navigating it");
await compose("shuaxin");
await send({ method: "Page.reload" }, session);
await wait(1500);
await keepsComposing("reloading it");
await compose("dianji");
await send({ method: "Input.dispatchMouseEvent", params: { type: "mousePressed", x: 40, y: 20, button: "left", clickCount: 1 } }, session);
await send({ method: "Input.dispatchMouseEvent", params: { type: "mouseReleased", x: 40, y: 20, button: "left", clickCount: 1 } }, session);
await send({ method: "Input.insertText", params: { text: "x" } }, session);
await wait(500);
await keepsComposing("the agent clicking and typing in it");
await compose("guaqi");
// Not awaited: the protocol answers a navigation only when the page does.
void send({ method: "Page.navigate", params: { url: page.url + "/hang" } }, session);
await wait(500);
const out = !win.contentView.children.includes([...views.entries.values()][0].view);
check("a navigation that has just started holds the page out of the window", out);
await wait(LEAVE_LIMIT_MS + 1000);
const back = win.contentView.children.includes([...views.entries.values()][0].view);
check("one that never answers does not keep it out for good", back);
await keepsComposing("and the composition is still open while it hangs");
page.server.closeAllConnections?.();
page.server.close();
app.exit(failures.length ? 1 : 0);
}
main().catch((err) => {
process.stdout.write(` FAIL ime-live crashed — ${err && err.stack}\n`);
app.exit(1);
});
@@ -0,0 +1,62 @@
"use strict";
// With the project folder gone, a tool call is refused with the typed cause and the
// window says so above the composer, with a way to choose the folder again.
const os = require("node:os");
const path = require("node:path");
const fs = require("node:fs");
const { execFileSync } = require("node:child_process");
const { app } = require("electron");
const { checker, listen, scriptedModel, seedHome, settledWindow, until, wait } = require("./livekit");
const { check, failures } = checker();
async function main() {
let calls = 0;
const { handler, requests } = scriptedModel(() => {
calls++;
if (calls === 1) return { name: "grep", arguments: { pattern: "hello" } };
return null;
});
const model = await listen(handler);
const home = fs.mkdtempSync(path.join(os.tmpdir(), "rx-root-live-"));
const workspace = fs.mkdtempSync(path.join(os.tmpdir(), "rx-root-ws-"));
process.env.REASONIX_HOME = home;
seedHome(home, model.url, workspace);
const { current } = require("../src/main.js");
try {
const win = await settledWindow();
const { client } = current();
const runtimes = await until("a pane", async () => {
const list = await client.json("GET", "/runtimes");
return Array.isArray(list) && list.length ? list : null;
});
process.chdir(os.tmpdir());
const gone = `${workspace}-moved`;
fs.renameSync(workspace, gone);
await client.request("POST", `${runtimes[0].base}/submit`, { input: "look for hello" });
await until("the scripted turn", async () => requests.length >= 2, 60000);
const result = String((requests[1].messages || []).filter((m) => m.role === "tool").at(-1)?.content || "");
check("the model was told the typed cause, not a bare system error", result.startsWith("root missing: the project folder ") && result.includes("not a permission or argument problem"), result.slice(0, 200));
const js = (src) => win.webContents.executeJavaScript(src);
const banner = await until("the banner above the composer", async () => js(`(() => { const b = document.querySelector('[data-cause="root-missing"]'); return b ? b.textContent : null; })()`), 20000).catch(() => null);
check("the window shows the banner", !!banner, banner);
check("the banner offers to choose the folder again", await js(`!!document.querySelector('[data-action="root-missing.reselect"]')`));
await wait(3000);
process.stdout.write(` page: ${await js("document.body.innerText.slice(0, 300).replace(/\\n/g, ' | ')")}\n`);
const png = path.join(os.tmpdir(), "rx-root-missing-live.png");
try {
execFileSync("screencapture", ["-x", "-o", "-l", win.getMediaSourceId().split(":")[1], png]);
process.stdout.write(` screenshot: ${png}\n`);
} catch (err) {
process.stdout.write(` (no screenshot: ${err.message})\n`);
}
fs.renameSync(gone, workspace);
} catch (err) {
check("the run completed", false, String(err && err.message ? err.message : err));
}
process.stdout.write(failures.length ? `${failures.length} check(s) failed\n` : "all checks passed\n");
app.exit(failures.length ? 1 : 0);
}
app.whenReady().then(main);
+87
View File
@@ -0,0 +1,87 @@
"use strict";
// The side question has to be seen over the built-in browser. The browser is a
// native view drawn above the whole page, so the panel can only be seen if the
// page stops covering the place the panel is. Real kernel, real window: the agent
// opens a page, the person widens it, opens the side question, and what is judged
// is whether the view still covers the panel. Run with `pnpm sidepanel-live`.
const os = require("node:os");
const path = require("node:path");
const fs = require("node:fs");
const { app } = require("electron");
const { checker, scriptedModel, listen, seedHome, settledWindow, until, wait } = require("./livekit");
const { check, failures } = checker();
async function main() {
const page = await listen((_req, res) => {
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
res.end("<!doctype html><title>Greeter</title><body style='margin:0;background:#2a6'><h1>hello</h1>");
});
let calls = 0;
const model = await listen(scriptedModel(() => (calls++ >= 1 ? null : { name: "browser_open", arguments: { url: page.url + "/" } })).handler);
const home = fs.mkdtempSync(path.join(os.tmpdir(), "rx-side-home-"));
const workspace = fs.mkdtempSync(path.join(os.tmpdir(), "rx-side-ws-"));
process.env.REASONIX_HOME = home;
seedHome(home, model.url, workspace);
const { current } = require("../src/main.js");
const win = await settledWindow();
const { client } = current();
const runtimes = await until("a pane", async () => {
const list = await client.json("GET", "/runtimes");
return Array.isArray(list) && list.length ? list : null;
});
const base = runtimes[0].base;
const js = (src) => win.webContents.executeJavaScript(src);
const guests = () => win.contentView.children.filter((v) => v.webContents && v.webContents !== win.webContents);
await client.request("POST", `${base}/submit`, { input: "open the page" });
const guest = await until("a page view", async () => guests()[0], 60000);
await until("the page beside the conversation", async () => (guest.getBounds().x >= 0 ? true : null), 30000);
await until("the wide control", () => js(`!!document.querySelector('[data-action="browser.wide"]')`));
const panelRect = () => js(`(() => { const e = document.querySelector('.sidepanel'); if (!e) return null; const b = e.getBoundingClientRect(); return { x: b.left, y: b.top, width: b.width, height: b.height }; })()`);
const covers = (view, rect) => view.x < rect.x + rect.width && view.x + view.width > rect.x && view.y < rect.y + rect.height && view.y + view.height > rect.y;
for (const [width, height, wide] of [[1440, 900, false], [1440, 900, true], [1100, 760, false], [1100, 760, true], [900, 700, true], [700, 700, true], [1440, 900, "panel-first"], [1100, 760, "panel-first"]]) {
win.setContentSize(width, height);
await wait(900);
const label = `${width}px ${wide === "panel-first" ? "side question open, then the browser widened" : wide ? "widened" : "beside the conversation"}`;
if (wide === true && (await js(`document.querySelector('.pane')?.getAttribute('data-browser-size')`)) !== "wide") {
await js(`document.querySelector('[data-action="browser.wide"]')?.click()`);
await wait(1200);
}
if (wide === false && (await js(`document.querySelector('.pane')?.getAttribute('data-browser-size')`)) === "wide") {
await js(`document.querySelector('[data-action="browser.wide"]')?.click()`);
await wait(1200);
}
if (wide === "panel-first") {
// Back beside the conversation first, then the question, then the widening.
if ((await js(`document.querySelector('.pane')?.getAttribute('data-browser-size')`)) === "wide") {
await js(`document.querySelector('[data-action="browser.wide"]')?.click()`);
await wait(1000);
}
await js(`document.querySelector('[data-action="side.toggle"]').click()`);
await until("the side panel", async () => (await panelRect()) || null, 10000);
await wait(800);
await js(`document.querySelector('[data-action="browser.wide"]')?.click()`);
await wait(1500);
} else {
await js(`document.querySelector('[data-action="side.toggle"]').click()`);
await until("the side panel", async () => (await panelRect()) || null, 10000);
}
await wait(1500);
const panel = await panelRect();
const view = guest.getBounds();
const parked = view.x < 0;
process.stdout.write(` [bounds] ${label}: view=${JSON.stringify(view)} panel=${JSON.stringify(panel)} parked=${parked}\n`);
check(`${label}: the side panel is drawn`, !!panel && panel.width > 100, panel);
check(`${label}: the page does not cover the panel`, parked || !covers(view, panel), { view, panel });
await js(`document.querySelector('[data-action="side.toggle"]').click()`);
await wait(800);
}
app.exit(failures.length ? 1 : 0);
}
app.whenReady().then(main).catch((err) => {
process.stdout.write(` FAIL sidepanel-live crashed — ${err && err.stack}\n`);
app.exit(1);
});
+429 -2
View File
@@ -1,4 +1,4 @@
import { test } from "node:test";
import { test, mock } from "node:test";
import assert from "node:assert/strict";
import { createRequire } from "node:module";
import path from "node:path";
@@ -14,6 +14,7 @@ const { externalTarget } = require("../src/links.js");
const { offerCleanup, ownBundle } = require("../src/legacy.js");
const { stripPackageGrants, readReport, unpaintedWindowCause } = require("../src/packagegrants.js");
const { groundFor, themeSourceFor, GROUND } = require("../src/ground.js");
const { folderAnswer } = require("../src/folderpanel.js");
const { pick, loadPrefs, savePrefs, registerPrefs } = require("../src/prefs.js");
const TOKEN = "a".repeat(64);
@@ -2259,12 +2260,14 @@ test("a parked page is attached again when it is shown, and a page already on sc
const win = {
on() {},
isDestroyed: () => false,
isFocused: () => false,
webContents: Object.assign(new EventEmitter(), { isFocused: () => false }),
getContentBounds: () => ({ width: 1200, height: 800 }),
contentView: { addChildView: () => calls.push("add"), removeChildView: () => calls.push("remove") },
};
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const view = { setBounds: (b) => calls.push("bounds " + b.x), webContents: { isDestroyed: () => false } };
views.entries.set("t1", { view, at: null });
views.entries.set("t1", { view, at: null, attached: true });
const rect = { x: 10, y: 20, width: 600, height: 400 };
views.show("t1", rect);
@@ -2278,6 +2281,115 @@ test("a parked page is attached again when it is shown, and a page already on sc
assert.deepEqual(calls, ["remove", "add", "bounds 10"], "a page put away and shown again is attached again");
});
test("a page laid out wider than the pane is scaled to fit it, and keeps the viewport the agent asked for", async () => {
const Module = require("node:module");
const load = Module._load;
Module._load = function (request, ...rest) {
if (request === "electron") return { WebContentsView: class {}, session: { fromPartition: () => ({}) } };
return load.call(this, request, ...rest);
};
let BrowserViews;
try {
({ BrowserViews } = require("../src/browserviews.js"));
} finally {
Module._load = load;
}
const win = {
on() {},
isDestroyed: () => false,
isFocused: () => false,
webContents: Object.assign(new EventEmitter(), { isFocused: () => false }),
getContentBounds: () => ({ width: 1200, height: 800 }),
contentView: { addChildView() {}, removeChildView() {} },
};
const sent = [];
const view = {
setBounds() {},
webContents: { isDestroyed: () => false, debugger: { sendCommand: async (method, params) => sent.push([method, params]) } },
};
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const entry = { view, at: null, attached: true };
views.entries.set("t1", entry);
views.keepKeyboard = () => {};
entry.override = { width: 1440, height: 1000, deviceScaleFactor: 0, mobile: false };
views.show("t1", { x: 0, y: 0, width: 720, height: 800 });
assert.equal(sent.length, 1);
assert.equal(sent[0][1].scale, 0.5, "a 1440 wide layout in a 720 wide pane is halved");
assert.equal(sent[0][1].width, 1440, "the layout viewport is still the one the agent asked for");
views.show("t1", { x: 0, y: 0, width: 720, height: 800 });
assert.equal(sent.length, 1, "the same pane sends nothing again");
views.show("t1", { x: 0, y: 0, width: 360, height: 800 });
assert.equal(sent.at(-1)[1].scale, 0.25, "a narrower pane scales further");
views.show("t1", { x: 0, y: 0, width: 2000, height: 1200 });
assert.equal(sent.at(-1)[1].scale, 1, "a pane larger than the layout never enlarges it");
const settled = sent.length;
views.fit(entry);
assert.equal(sent.length, settled, "an unchanged scale is not sent again");
views.fit(entry, true);
assert.equal(sent.length, settled + 1, "a capture that dropped the scale gets it back");
assert.equal(sent.at(-1)[1].scale, 1);
entry.override = undefined;
const before = sent.length;
views.show("t1", { x: 0, y: 0, width: 500, height: 800 });
assert.equal(sent.length, before, "with no override there is nothing to fit");
});
test("a page given its own viewport is fitted whole into its panel, centred, and never enlarged", () => {
const Module = require("node:module");
const load = Module._load;
Module._load = function (request, ...rest) {
if (request === "electron") return { WebContentsView: class {}, session: { fromPartition: () => ({}) } };
return load.call(this, request, ...rest);
};
let placement;
try {
({ placement } = require("../src/browserviews.js"));
} finally {
Module._load = load;
}
const panel = { x: 380, y: 60, width: 560, height: 620 };
assert.deepEqual(placement(panel, null), { at: panel, scale: 1 }, "a page without a viewport of its own fills the panel");
for (const none of [{ width: 0, height: 0 }, { width: 0, height: 600 }, { width: 390, height: 0 }, { width: NaN, height: 600 }, { width: 390, height: Infinity }, { width: -1, height: 600 }]) {
assert.deepEqual(placement(panel, none), { at: panel, scale: 1 }, `${JSON.stringify(none)} is no viewport at all`);
}
const wide = placement(panel, { width: 1280, height: 900 });
assert.equal(wide.scale, 0.4375);
assert.deepEqual(wide.at, { x: 380, y: 173, width: 560, height: 394 });
const phone = placement(panel, { width: 390, height: 844 });
assert.ok(phone.scale < 1 && phone.at.height <= panel.height && phone.at.width <= panel.width);
assert.deepEqual(placement({ x: 20, y: 20, width: 1400, height: 1000 }, { width: 1280, height: 900 }), { at: { x: 80, y: 70, width: 1280, height: 900 }, scale: 1 });
});
test("input that carries a point is scaled with the page or refused, never sent to the wrong place", () => {
const Module = require("node:module");
const load = Module._load;
Module._load = function (request, ...rest) {
if (request === "electron") return { WebContentsView: class {}, session: { fromPartition: () => ({}) } };
return load.call(this, request, ...rest);
};
let scaleInput;
try {
({ scaleInput } = require("../src/browserviews.js"));
} finally {
Module._load = load;
}
const mouse = { type: "mousePressed", x: 1200, y: 800, button: "left" };
assert.equal(scaleInput("Input.dispatchMouseEvent", mouse, 1), mouse, "an unscaled page gets the point as it is");
assert.deepEqual(scaleInput("Input.dispatchMouseEvent", mouse, 0.5), { type: "mousePressed", x: 600, y: 400, button: "left" });
for (const method of ["Input.dispatchTouchEvent", "Input.dispatchDragEvent", "Input.emulateTouchFromMouseEvent", "Input.synthesizeTapGesture", "Input.synthesizeScrollGesture", "Input.synthesizePinchGesture"]) {
const params = { x: 10, y: 20, touchPoints: [{ x: 10, y: 20 }] };
assert.equal(scaleInput(method, params, 1), params, `${method} passes on an unscaled page`);
assert.throws(() => scaleInput(method, params, 0.5), { code: "input_unscaled" }, `${method} must not reach a scaled page unscaled`);
}
const key = { type: "keyDown", key: "a" };
assert.equal(scaleInput("Input.dispatchKeyEvent", key, 0.5), key, "keys carry no point");
assert.equal(scaleInput("Input.insertText", { text: "x" }, 0.5).text, "x");
});
test("rewind notice dismissal survives the desktop preference disk round trip", (t) => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rewind-notice-prefs-"));
const file = path.join(dir, "prefs.json");
@@ -2441,3 +2553,318 @@ test("the window capture is scaled down past the upload-friendly width and refus
const blank = captureHandler(() => ({ webContents: { capturePage: async () => fakeImage(0, { empty: true }) } }));
assert.equal(await blank({}), null);
});
test("a folder panel that closes before anyone could read it is reported as never drawn on Linux", () => {
const closed = { canceled: true, filePaths: [] };
assert.equal(folderAnswer(closed, 20, "linux"), null);
assert.equal(folderAnswer(closed, 5000, "linux"), "");
assert.equal(folderAnswer(closed, 20, "darwin"), "");
assert.equal(folderAnswer(closed, 20, "win32"), "");
assert.equal(folderAnswer({ canceled: false, filePaths: ["/home/a/p"] }, 20, "linux"), "/home/a/p");
});
// Who keeps the keyboard while the agent drives a page.
const { KeyboardKeeper, PERSON_MS } = require("../src/keyboard.js");
function keyboardWindow({ appFocused = true, windowFocused = true } = {}) {
const contents = Object.assign(new EventEmitter(), { focused: appFocused, focus() { this.focused = true; this.emit("focus"); }, isFocused() { return this.focused; } });
const win = { webContents: contents, isDestroyed: () => false, isFocused: () => windowFocused };
return { win, contents };
}
function keyboardPage() {
return new EventEmitter();
}
const turn = () => new Promise((resolve) => setTimeout(resolve, 5));
test("a page the agent opens does not take the keyboard from the app page", async () => {
const { win, contents } = keyboardWindow();
const keeper = new KeyboardKeeper({ win });
const page = keyboardPage();
page.isFocused = () => true;
keeper.watch(page);
contents.focused = false;
page.emit("focus");
assert.equal(contents.focused, false, "not from inside the platform's own focus event");
await turn();
assert.equal(contents.focused, true);
assert.equal(keeper.owner, "app");
});
test("a click or a key from the person into the page is theirs to have chosen", () => {
for (const arrive of [(page) => page.emit("before-input-event", {}, { type: "keyDown" }), (page) => page.emit("input-event", {}, { type: "mouseDown" })]) {
const { win, contents } = keyboardWindow();
const keeper = new KeyboardKeeper({ win });
const page = keyboardPage();
keeper.watch(page);
arrive(page);
contents.focused = false;
page.emit("focus");
assert.equal(contents.focused, false);
assert.equal(keeper.owner, "view");
}
});
test("a click the agent itself sent over the protocol is not the person's", async () => {
const { win, contents } = keyboardWindow();
const keeper = new KeyboardKeeper({ win });
const page = keyboardPage();
page.isFocused = () => true;
keeper.watch(page, () => true);
page.emit("input-event", {}, { type: "mouseDown" });
contents.focused = false;
page.emit("focus");
await turn();
assert.equal(contents.focused, true);
});
test("the person's choice stands until they go back to the app page", async () => {
const { win, contents } = keyboardWindow();
const keeper = new KeyboardKeeper({ win });
const page = keyboardPage();
page.isFocused = () => true;
keeper.watch(page);
page.emit("input-event", {}, { type: "mouseDown" });
page.emit("focus");
assert.equal(keeper.owner, "view");
contents.focused = false;
page.emit("focus");
await turn();
assert.equal(contents.focused, false, "the agent navigating again does not pull it back");
contents.focus();
assert.equal(keeper.owner, "app");
});
test("nothing is taken back when the app page did not have the keyboard, or the window is not in front", async () => {
let { win, contents } = keyboardWindow({ appFocused: false });
let keeper = new KeyboardKeeper({ win });
let page = keyboardPage();
page.isFocused = () => true;
keeper.watch(page);
page.emit("focus");
await turn();
assert.equal(contents.focused, false);
({ win, contents } = keyboardWindow({ windowFocused: false }));
keeper = new KeyboardKeeper({ win });
page = keyboardPage();
page.isFocused = () => true;
keeper.watch(page);
contents.focused = false;
page.emit("focus");
await turn();
assert.equal(contents.focused, false);
({ win, contents } = keyboardWindow());
keeper = new KeyboardKeeper({ win });
page = keyboardPage();
page.isFocused = () => true;
keeper.watch(page);
contents.focused = false;
page.emit("focus");
page.emit("before-input-event", {}, { type: "keyDown" });
await turn();
assert.equal(contents.focused, false, "a key from the person in the meantime is theirs");
});
test("reclaim hands the keyboard back only when nobody holds it and the app page owned it", () => {
const { win, contents } = keyboardWindow();
const keeper = new KeyboardKeeper({ win });
contents.focused = false;
keeper.reclaim();
assert.equal(contents.focused, true);
keeper.owner = "view";
contents.focused = false;
keeper.reclaim();
assert.equal(contents.focused, false);
});
test("a person's click is only a click for a moment", () => {
assert.ok(PERSON_MS > 0 && PERSON_MS < 2000);
});
function loadedViews() {
const Module = require("node:module");
const load = Module._load;
Module._load = function (request, ...rest) {
if (request === "electron") return { WebContentsView: class {}, session: { fromPartition: () => ({}) } };
return load.call(this, request, ...rest);
};
let BrowserViews;
let LEAVE_LIMIT_MS;
try {
({ BrowserViews, LEAVE_LIMIT_MS } = require("../src/browserviews.js"));
} finally {
Module._load = load;
}
const calls = [];
const win = {
on() {},
isDestroyed: () => false,
isFocused: () => true,
webContents: Object.assign(new EventEmitter(), { isFocused: () => true }),
getContentBounds: () => ({ width: 1200, height: 800 }),
contentView: { addChildView: () => calls.push("add"), removeChildView: () => calls.push("remove") },
};
const views = new BrowserViews({ win, kernelOrigin: "http://127.0.0.1:1" });
const view = { setBounds: (b) => calls.push("bounds " + b.x), webContents: { isDestroyed: () => false } };
return { views, view, calls, LEAVE_LIMIT_MS };
}
test("a page navigating while the app page holds the keyboard is held out of the window, then put back where it was", () => {
const { views, view, calls } = loadedViews();
const entry = { view, at: { x: 10, y: 20, width: 600, height: 400 }, attached: true };
views.leave(entry);
assert.deepEqual(calls, ["remove"]);
assert.equal(entry.attached, false);
views.settle(entry);
assert.deepEqual(calls, ["remove", "add", "bounds 10"]);
assert.equal(entry.attached, true);
views.settle(entry);
assert.equal(calls.length, 3, "settling a page that is already attached does nothing");
});
test("a parked page comes back parked", () => {
const { views, view, calls } = loadedViews();
const entry = { view, at: null, attached: true };
views.leave(entry);
calls.length = 0;
views.settle(entry);
assert.equal(calls[0], "add");
assert.match(calls[1], /^bounds -?\d+$/);
assert.equal(entry.at, null);
});
test("a page is left where it is when the person, not the app page, holds the keyboard, or when it is not attached", () => {
const { views, view, calls } = loadedViews();
const entry = { view, at: null, attached: true };
views.keyboard.owner = "view";
views.leave(entry);
assert.deepEqual(calls, []);
assert.equal(entry.attached, true);
views.keyboard.owner = "app";
const loading = { view, at: null, attached: false };
views.leave(loading);
assert.deepEqual(calls, []);
});
test("a page still loading is not put back by a window event", () => {
const { views, view, calls } = loadedViews();
views.entries.set("t1", { view, at: null, attached: false });
views.reattach();
assert.deepEqual(calls, []);
});
test("a navigation that never finishes does not keep the page out of the window for good", () => {
mock.timers.enable({ apis: ["setTimeout"] });
try {
const { views, view, calls, LEAVE_LIMIT_MS } = loadedViews();
const entry = { view, at: { x: 10, y: 20, width: 600, height: 400 }, attached: true };
views.leave(entry);
assert.deepEqual(calls, ["remove"]);
mock.timers.tick(LEAVE_LIMIT_MS - 1);
assert.equal(entry.attached, false, "still out just before the limit");
mock.timers.tick(1);
assert.deepEqual(calls, ["remove", "add", "bounds 10"]);
assert.equal(entry.attached, true);
mock.timers.tick(LEAVE_LIMIT_MS * 3);
assert.equal(calls.length, 3, "and it is put back once");
} finally {
mock.timers.reset();
}
});
test("a navigation that does finish cancels the limit, and a second one gets a fresh one", () => {
mock.timers.enable({ apis: ["setTimeout"] });
try {
const { views, view, calls, LEAVE_LIMIT_MS } = loadedViews();
const entry = { view, at: null, attached: true };
views.leave(entry);
mock.timers.tick(LEAVE_LIMIT_MS - 100);
views.settle(entry);
const back = calls.length;
mock.timers.tick(LEAVE_LIMIT_MS * 2);
assert.equal(calls.length, back, "the limit did not fire after the page came back");
views.leave(entry);
mock.timers.tick(LEAVE_LIMIT_MS);
assert.equal(entry.attached, true, "the second navigation was bounded by its own limit");
} finally {
mock.timers.reset();
}
});
// Input to a page in a minimized window.
const { InputWake } = require("../src/inputwake.js");
function wakeWindow({ minimized = true, focused = false } = {}) {
const calls = [];
const win = {
destroyed: false,
isDestroyed() { return this.destroyed; },
isMinimized: () => minimized,
isFocused: () => focused,
setOpacity: (v) => calls.push(`opacity ${v}`),
setIgnoreMouseEvents: (v) => calls.push(`ignore ${v}`),
showInactive: () => { minimized = false; calls.push("showInactive"); },
minimize: () => { minimized = true; calls.push("minimize"); },
};
return { win, calls, focus: () => { focused = true; } };
}
const wakeOf = (win) => new InputWake({ win, platform: "win32", settleMs: 5, holdMs: 20 });
const later = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
test("input to a minimized window is sent with the window raised unseen, then it is minimized again", async () => {
const { win, calls } = wakeWindow();
const sent = [];
await wakeOf(win).run(async () => sent.push([...calls]));
assert.deepEqual(sent[0], ["opacity 0", "ignore true", "showInactive"]);
await later(60);
assert.deepEqual(calls.slice(3), ["ignore false", "opacity 1", "minimize"]);
});
test("several inputs in a row raise the window once", async () => {
const { win, calls } = wakeWindow();
const wake = wakeOf(win);
await Promise.all([wake.run(async () => {}), wake.run(async () => {}), wake.run(async () => {})]);
await later(60);
assert.equal(calls.filter((c) => c === "showInactive").length, 1);
assert.equal(calls.filter((c) => c === "minimize").length, 1);
});
test("a window that is not minimized, or not on Windows, is left alone", async () => {
const open = wakeWindow({ minimized: false });
await wakeOf(open.win).run(async () => {});
const mac = wakeWindow();
await new InputWake({ win: mac.win, platform: "darwin", settleMs: 5, holdMs: 20 }).run(async () => {});
await later(40);
assert.deepEqual([...open.calls, ...mac.calls], []);
});
test("a window the person focused meanwhile is not minimized under them", async () => {
const { win, calls, focus } = wakeWindow();
await wakeOf(win).run(async () => focus());
await later(60);
assert.ok(!calls.includes("minimize"));
assert.deepEqual(calls.slice(-2), ["ignore false", "opacity 1"]);
});
test("a failed input still lets the window go back", async () => {
const { win, calls } = wakeWindow();
await assert.rejects(wakeOf(win).run(async () => { throw new Error("gone"); }), /gone/);
await later(60);
assert.ok(calls.includes("minimize"));
});
test("a window destroyed during the hold is not touched", async () => {
const { win, calls } = wakeWindow();
await wakeOf(win).run(async () => {});
win.destroyed = true;
const before = calls.length;
await later(60);
assert.equal(calls.length, before);
});
test("a window that fails to raise is given its opacity and mouse back", async () => {
const { win, calls } = wakeWindow();
win.showInactive = () => { throw new Error("no window"); };
await assert.rejects(wakeOf(win).run(async () => {}), /no window/);
assert.deepEqual(calls.slice(-3), ["ignore false", "opacity 1", "minimize"]);
});
+3 -1
View File
@@ -1,6 +1,8 @@
node_modules
dist
dist-perf
dist-perf*
*.png
!public/icons/*.png
tsconfig.tsbuildinfo
dist-relay*
relay/bin
+26
View File
@@ -27,3 +27,29 @@ read it, which costs more than the seconds it saves.
`css: true` is load-bearing: the guards under `src/styles` read `app.css`
through `?raw`, and a stubbed stylesheet hands them an empty string, which
passes on nothing.
## Large-file shell regression
From the repository root, install the frontend and Electron dependencies, then
build the host and production page before running the real-shell regression:
```sh
pnpm --dir desktop/frontend-next install --frozen-lockfile
pnpm --dir desktop/electron install --frozen-lockfile
go build -o desktop/electron/bin/ ./cmd/reasonix-studio-host
pnpm --dir desktop/frontend-next build
node desktop/electron/test/attachments_live.mjs
```
The test uses a disposable workspace, Reasonix home and Electron profile. It
checks 111 MiB native-file selection, paste and drop without byte uploads,
then streams a 65 MiB virtual file and verifies its saved size and ready chip.
No provider request is sent.
Set `REASONIX_TEST_ELECTRON` to use an existing Electron executable, or
`REASONIX_ATTACHMENT_ARTIFACTS` to retain a screenshot and JSON result in a
chosen directory. Failed runs retain their fixture directory for diagnosis.
Attachment transport limits are documented in the
[English guide](../../docs/GUIDE.md#studio-file-attachments) and
[Chinese guide](../../docs/GUIDE.zh-CN.md#studio-文件附件).
+7 -7
View File
@@ -39,8 +39,8 @@
"codemirror": "^6.0.2",
"katex": "^0.19.0",
"maplibre-gl": "6.14.0",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-map-gl": "8.1.3",
"react-markdown": "^10.1.0",
"recharts": "3.10.1",
@@ -56,14 +56,14 @@
"devDependencies": {
"@babel/parser": "^8.0.7",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.7",
"@testing-library/user-event": "^14.6.8",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"jsdom": "^30.1.2",
"playwright": "^1.64.0",
"jsdom": "^30.1.3",
"playwright": "^1.64.1",
"typescript": "^7.0.2",
"vite": "^8.3.3",
"vitest": "^5.0.3"
"vite": "^8.3.4",
"vitest": "^5.0.4"
}
}
+2 -1
View File
@@ -78,7 +78,8 @@ node perf/sidebar.mjs # 侧栏开关只有一个且位置不变(图标栏
node perf/stickyfold.mjs # 展开的长执行过程:滚动时头部吸在顶部、有自己的底(浅/深)
node perf/crumb.mjs # 标题栏里会话标题紧跟项目名,长名字也不溢出(宽/窄)
node perf/hoverradius.mjs # 输入框底行的按钮悬停时圆角和底色一致(浅/深)
node perf/sessionrows.mjs # 会话行样式:34px、无额外行间距、单行省略;本机/远程、悬浮/焦点、浅/深、窄/宽
node perf/jump-ends.mjs # 回到顶部/跳到最新按钮一次点击直达两端(中间有展开块也一样)
node perf/sessionrows.mjs # 会话行样式:34px、1px 紧凑间距、单行省略;本机/远程、悬浮/焦点、浅/深、窄/宽
node perf/start.mjs # 经工作台标签/边缘把手打开工作台先出入口页(文件/改动/浏览器),不替人开浏览器;标题栏 Browser 按钮仍直达浏览器(浅/深 × 宽/窄)
```
@@ -0,0 +1,42 @@
// The row of actions under a reply and the row under the person's own message read as one family: the same
// button and the same icon size. A smaller icon under one of them is the kind of slip a reader sees at once.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&ws=2&sess=6&turns=2";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const size = (el) => el.evaluate((e) => {
const b = e.getBoundingClientRect();
return `${Math.round(b.width * 10) / 10}x${Math.round(b.height * 10) / 10}`;
});
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
const page = await browser.newPage({ colorScheme: scheme, viewport: { width: 1200, height: 900 } });
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".user-acts");
await page.waitForSelector(".call[data-k=\"say\"] .acts");
const mine = page.locator(".user-acts .studio-icon");
const reply = page.locator(".call[data-k=\"say\"] .acts .studio-icon");
check(`${scheme}: both rows were found`, (await mine.count()) > 0 && (await reply.count()) > 0);
const replyIcon = await size(reply.first());
const replyButton = await size(page.locator(".call[data-k=\"say\"] .acts > button").first());
for (let i = 0; i < await mine.count(); i++) {
check(`${scheme}: icon ${i + 1} of the message's own row matches the reply's`, await size(mine.nth(i)) === replyIcon, `${await size(mine.nth(i))} vs ${replyIcon}`);
}
check(`${scheme}: the buttons are the same size`, await size(page.locator(".user-acts > button").first()) === replyButton);
await page.close();
}
} finally {
await browser.close();
}
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
@@ -19,11 +19,12 @@ for (const scheme of ["light", "dark"]) {
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(PAGE, { waitUntil: "domcontentloaded" });
await page.waitForSelector(".machpick");
await page.waitForSelector('.projects-heading [data-action="workspace.add"]');
const current = () => page.evaluate(() => [...document.querySelectorAll(".wsnode[data-current]")].map((el) => el.textContent ?? ""));
const was = await current();
if (SHOTS) await page.screenshot({ path: join(SHOTS, `${scheme}-before.png`) });
await page.locator(".machpick").first().click();
await page.locator('.projects-heading [data-action="workspace.add"]').click();
await page.getByRole("dialog", { name: "打开项目", exact: true }).getByRole("button", { name: "选择本机文件夹", exact: true }).click();
await page.waitForFunction(() => [...document.querySelectorAll(".wsnode[data-current]")].some((el) => el.textContent?.includes("mock-workspace")), null, { timeout: 5000 }).catch(() => {});
const now = await current();
check(`${scheme}: the added project becomes the current one`, now.length === 1 && now[0].includes("mock-workspace"), now.join("|").slice(0, 120));
@@ -1,7 +1,5 @@
// The "+" that opens a project folder sits on the machine row where a person
// looks for it, and is there before the row is hovered. It was drawn only on
// hover once, and two people on 2.39.0 reported that they could not choose a
// folder at all. Opacity and hit-testing need a real browser.
// The Projects heading's add-folder button stays visible and hit-testable
// before hover. Opacity and hit-testing need a real browser.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh";
@@ -18,11 +16,11 @@ try {
const page = await browser.newPage({ viewport: { width, height: 800 }, colorScheme: theme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".machrow[data-here]");
await page.waitForSelector(".projects-heading");
await page.mouse.move(width - 2, 790);
await page.waitForTimeout(300);
const g = await page.evaluate(() => {
const row = document.querySelector(".machrow[data-here]");
const row = document.querySelector(".projects-heading");
const add = row?.querySelector('[data-action="workspace.add"]');
if (!add) return null;
const r = add.getBoundingClientRect();
@@ -32,7 +30,7 @@ try {
return { opacity: seen, width: r.width, height: r.height, hits: hit === add || add.contains(hit), shown: row.matches(":hover") };
});
const where = `${theme} ${width}`;
check(`${where}: the machine row has the add-folder button`, g !== null);
check(`${where}: the Projects heading has the add-folder button`, g !== null);
if (!g) continue;
check(`${where}: it is visible without hovering the row`, !g.shown && g.opacity === 1 && g.width > 0 && g.height > 0, JSON.stringify(g));
check(`${where}: it takes the pointer`, g.hits);
+26 -17
View File
@@ -1,5 +1,5 @@
// Opening the branch menu while the pointer is still over the branch chip must not leave the hover card showing:
// the two surfaces would stack their shadows. Visibility under :hover is a styling question, so it is asked of a real browser.
// Workspace selection must stay reachable before and after a task, with no
// legacy hover card stacked over the open palette.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&turns=2";
@@ -9,22 +9,31 @@ const check = (name, ok, detail = "") => {
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
const browser = await chromium.launch({ executablePath: process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE });
try {
const page = await (await browser.newContext({ locale: "zh-CN", viewport: { width: 1280, height: 800 } })).newPage();
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app", { timeout: 20000 });
const chip = page.locator('.studio-branch-pop .studio-branch').first();
await chip.waitFor();
const card = page.locator(".studio-branch-card").first();
const shown = () => card.evaluate((el) => getComputedStyle(el).visibility === "visible" && Number(getComputedStyle(el).opacity) > 0.5);
await chip.hover();
await page.waitForTimeout(400);
check("the hover card shows over a closed chip", await shown());
await chip.click();
await page.waitForTimeout(500);
check("the branch menu opened", (await chip.getAttribute("aria-expanded")) === "true");
check("the hover card is gone while the menu is open", !(await shown()));
for (const turns of [0, 2]) {
const page = await browser.newPage({ locale: "zh-CN", viewport: { width: 1280, height: 800 }, reducedMotion: "reduce" });
const url = new URL(BASE);
url.searchParams.set("turns", String(turns));
await page.goto(url.href, { waitUntil: "networkidle" });
const chip = page.getByRole("button", { name: "配置工作目录", exact: true });
await chip.hover();
await chip.click();
const palette = page.getByRole("dialog", { name: "配置工作目录", exact: true });
await palette.waitFor();
check(`${turns} turns: the workspace palette opened`, await chip.getAttribute("aria-expanded") === "true");
const stacked = await page.locator(".studio-branch-card").evaluateAll((cards) => cards.some((card) => getComputedStyle(card).visibility === "visible" && Number(getComputedStyle(card).opacity) > 0.5));
check(`${turns} turns: no legacy hover card overlaps the palette`, !stacked);
await palette.getByRole("option", { name: "main", exact: true }).waitFor();
check(`${turns} turns: the current branch is selected`, await palette.getByRole("option", { name: "main", exact: true }).getAttribute("aria-selected") === "true");
const search = palette.getByRole("searchbox", { name: "搜索分支", exact: true });
await search.fill("studio");
check(`${turns} turns: search filters the branch choices`, await palette.getByRole("option").count() === 1 && await palette.getByRole("option", { name: "studio", exact: true }).isVisible());
await search.press("Escape");
await palette.waitFor({ state: "detached" });
check(`${turns} turns: closing returns focus to the workspace entry`, await chip.evaluate((element) => element === document.activeElement));
await page.close();
}
} finally {
await browser.close();
}
@@ -0,0 +1,53 @@
// The product mark in the sidebar's top-left is one row: the wordmark and an outlined uppercase badge, vertically centred on
// each other. Where the badge was hidden before it stays hidden.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
let seen = null;
for (const scheme of ["light", "dark"]) {
for (const width of [1280, 700]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width, height: 800 }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".studio-brand-lockup");
await page.waitForTimeout(500);
const m = await page.evaluate(() => {
const logo = document.querySelector(".studio-brand-logo").getBoundingClientRect();
const sub = document.querySelector(".studio-brand-sub");
const r = sub.getBoundingClientRect();
const cs = getComputedStyle(sub);
return {
shown: r.width > 0,
left: r.left,
top: r.top,
dy: Math.abs(logo.top + logo.height / 2 - (r.top + r.height / 2)),
after: r.left >= logo.right - 1,
fill: cs.backgroundColor, ink: cs.color, border: cs.borderTopWidth, radius: cs.borderTopLeftRadius, upper: cs.textTransform, text: sub.textContent,
};
});
const tag = `${scheme} ${width}px`;
if (width >= 760) {
check(`${tag}: the badge is on the wordmark's row, vertically centred on it`, m.shown && m.dy <= 1.5 && m.after, JSON.stringify(m));
check(`${tag}: it is an outlined uppercase badge in both themes and the text is untouched`, m.fill === "rgba(0, 0, 0, 0)" && m.border !== "0px" && m.radius !== "0px" && m.upper === "uppercase" && m.text === "studio", JSON.stringify(m));
if (!seen) seen = { left: m.left, top: m.top };
check(`${tag}: it sits in the same place whichever theme is on`, Math.abs(m.left - seen.left) <= 0.5 && Math.abs(m.top - seen.top) <= 0.5, `${m.left},${m.top} vs ${seen.left},${seen.top}`);
} else {
check(`${tag}: the badge stays hidden on a narrow window`, !m.shown);
}
await ctx.close();
}
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
@@ -0,0 +1,57 @@
// A call brought to the end of the transcript is the same row it is where it happened, drawn open: no box, no icon
// square, no vertical track — the status glyph, the title, the subject and the meta on one row over a hairline.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1100, height: 900 }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(600);
await page.evaluate(() => {
window.__feed({ kind: "turn_started", authoredTurn: 1, msgIndex: 0, text: "run" });
window.__feed({ kind: "tool_dispatch", tool: { id: "t1", name: "bash", args: '{"command":"go test ./..."}' } });
window.__feed({ kind: "tool_result", tool: { id: "t1", name: "bash", args: '{"command":"go test ./..."}', output: "ok\n", durationMs: 900 } });
window.__feed({ kind: "text", text: "done" });
window.__feed({ kind: "turn_done" });
});
await page.waitForTimeout(400);
await page.evaluate(() => [...document.querySelectorAll('[data-action="tool.bring"]')].pop()?.click());
await page.waitForSelector(".brought-item .call");
await page.mouse.move(5, 5);
await page.waitForTimeout(200);
const m = await page.evaluate(() => {
const call = document.querySelector(".brought-item .call");
const g = call.querySelector(":scope > .g");
if (!call.closest(".flow")) return { iconColumn: "outside .flow" };
const c = call.querySelector(":scope > .c");
const cs = getComputedStyle(c);
return {
iconColumn: g ? getComputedStyle(g).display : "absent",
sides: [cs.borderTopWidth, cs.borderLeftWidth, cs.borderRightWidth].join(","),
radius: cs.borderTopLeftRadius,
bg: cs.backgroundColor,
caption: !!document.querySelector(".brought-bar span"),
open: !!call.querySelector("details[open]"),
};
});
check(`${scheme}: no icon column or vertical track`, m.iconColumn === "none" || m.iconColumn === "absent", m.iconColumn);
check(`${scheme}: no box around the row`, m.sides === "0px,0px,0px" && m.radius === "0px" && (m.bg === "rgba(0, 0, 0, 0)" || m.bg === "transparent"), JSON.stringify(m));
check(`${scheme}: opened, with its caption above`, m.open && m.caption);
await ctx.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
@@ -0,0 +1,60 @@
// Full-screen browser: the page takes the whole pane, the conversation is folded away but stays mounted,
// and Escape (or the same button) brings the split back.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&ws=2&sess=6&turns=2";
const SHOTS = process.env.SHOTS_DIR;
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
const page = await browser.newPage({ colorScheme: scheme, viewport: { width: 1400, height: 900 }, reducedMotion: "reduce" });
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.locator('.navbtn[aria-label="文件"]').first().click();
await page.waitForSelector(".workbench-filelist button");
const read = () => page.evaluate(() => {
const pane = document.querySelector(".pane");
const dock = pane.querySelector(':scope > .scroll[data-pane="browser"]');
const shown = (el) => !!el && getComputedStyle(el).display !== "none";
return {
size: pane.getAttribute("data-browser-size"),
conversation: shown(pane.querySelector(":scope > .pbody")),
composer: shown(pane.querySelector(":scope > .compose")),
dockWidth: dock.getBoundingClientRect().width,
paneWidth: pane.getBoundingClientRect().width,
};
});
await page.waitForTimeout(1200);
await page.mouse.move(1390, 890);
await page.waitForTimeout(300);
const split = await read();
check(`${scheme}: starts split with the conversation shown`, split.size === "split" && split.conversation && split.composer);
if (SHOTS) await page.screenshot({ path: `${SHOTS}/browser-${scheme}-split.png` });
await page.locator('[data-action="browser.full"]').first().click();
await page.waitForTimeout(500);
const full = await read();
check(`${scheme}: full hides the conversation and the composer`, full.size === "full" && !full.conversation && !full.composer);
check(`${scheme}: full gives the page the whole pane`, full.dockWidth >= full.paneWidth - 1, `${full.dockWidth}px of ${full.paneWidth}px`);
await page.mouse.move(1390, 890);
await page.waitForTimeout(300);
if (SHOTS) await page.screenshot({ path: `${SHOTS}/browser-${scheme}-full.png` });
await page.keyboard.press("Escape");
await page.waitForTimeout(500);
const back = await read();
check(`${scheme}: Escape brings the split and the conversation back`, back.size === "split" && back.conversation && back.composer);
await page.close();
}
} finally {
await browser.close();
}
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
+64
View File
@@ -0,0 +1,64 @@
// Cards the reader reads or acts on share one shell: the same radius, border and ground, and a header with no fill of its
// own. A kind that draws its own (a different radius, a state-tinted border, a filled strip) reads as another family.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1000, height: 900 }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(600);
await page.evaluate(() => {
const f = window.__feed;
f({ kind: "turn_started", authoredTurn: 1, msgIndex: 0, text: "跑一遍" });
f({ kind: "text", text: "我来处理。" });
f({ kind: "tool_dispatch", tool: { id: "rm", name: "remember", args: '{}' } });
f({ kind: "tool_result", tool: { id: "rm", name: "remember", output: "saved", args: JSON.stringify({ name: "n", title: "标题", description: "一句话", scope: "project", activation: "always", body: "正文" }) } });
f({ kind: "guardian_assessment", guardian: { id: "gd", tool: "bash", subject: "rm -rf /", outcome: "deny", risk_level: "critical", user_authorization: "unknown", rationale: "越界", duration_ms: 900 } });
f({ kind: "compaction_done", compaction: { trigger: "capacity", messages: 40, summary: "折叠了前 40 条。", sourceTokens: 90000, projectionTokens: 6000, coverageRequired: 6, coverageMissing: 2, boundary: "capacity", triggerTokens: 90000 } });
f({ kind: "extension_surface", extension: { pluginId: "cov", surfaceId: "c", kind: "card", card: { title: "覆盖率", text: "78.4%", fields: [{ key: "语句", value: "78.4%" }], progress: 0.78, actions: [{ actionId: "o", label: "打开" }] } } });
f({ kind: "turn_done", receipt: { verdict: "partial", changes: [{ path: "a.go", reviewed: true }], verifications: [{ command: "go test ./...", passed: false, stale: true }], gaps: [{ kind: "unverified_mutation", detail: "改了没跑" }], risks: [], unverified: [], saysSomething: true } });
f({ kind: "turn_started" });
f({ kind: "approval_request", approval: { id: "a1", tool: "bash", subject: "rm -rf build && make" } });
f({ kind: "ask_request", ask: { id: "q1", questions: [{ id: "q", header: "选一个", prompt: "走哪条路", options: [{ label: "方案 A" }, { label: "方案 B" }] }] } });
});
await page.waitForTimeout(800);
await page.mouse.move(995, 5);
const rows = await page.evaluate(() =>
[...document.querySelectorAll(".flow .call")]
.filter((c) => ["mem", "host", "extension"].includes(c.getAttribute("data-k")) || c.hasAttribute("data-prompt"))
.map((c) => {
const cs = getComputedStyle(c.querySelector(":scope > .c"));
const hl = c.querySelector(":scope > .c > .hl");
return {
kind: c.getAttribute("data-k"),
radius: cs.borderTopLeftRadius,
border: cs.borderTopColor,
bg: cs.backgroundColor,
head: hl ? getComputedStyle(hl).backgroundColor : "rgba(0, 0, 0, 0)",
};
}));
check(`${scheme}: four kinds of card found`, rows.length === 4, rows.map((r) => r.kind).join(","));
const same = (key) => new Set(rows.map((r) => r[key])).size === 1;
check(`${scheme}: one radius`, rows.length > 0 && same("radius"), [...new Set(rows.map((r) => r.radius))].join(" / "));
check(`${scheme}: one border colour, whatever the state`, rows.length > 0 && same("border"), [...new Set(rows.map((r) => r.border))].join(" / "));
check(`${scheme}: one ground`, rows.length > 0 && same("bg"), [...new Set(rows.map((r) => r.bg))].join(" / "));
check(`${scheme}: no header fill`, rows.length > 0 && rows.every((r) => r.head === "rgba(0, 0, 0, 0)"), [...new Set(rows.map((r) => r.head))].join(" / "));
await ctx.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
+6
View File
@@ -101,6 +101,12 @@ check("回执没有重复根容器", await page.locator(".rc > .rc").count() ===
// between any two glyphs, so it is the one that must not give up its width.
const rc = await browser.newPage({ viewport: { width: 1440, height: 900 }, locale: "zh-CN", colorScheme: "dark" });
rc.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await rc.addInitScript(() => {
try {
localStorage.setItem("rx-turn-receipt", "on");
} catch {
}
});
await rc.goto(PAGE, { waitUntil: "networkidle" });
await rc.waitForSelector(".compose");
await rc.evaluate(() => {
@@ -0,0 +1,50 @@
// The code editor's text and its search field follow the interface text size, like the rest of the page.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&ws=2&sess=6&turns=2";
const SHOTS = process.env.SHOTS_DIR;
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
const page = await browser.newPage({ colorScheme: scheme, viewport: { width: 1400, height: 900 } });
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.locator('.navbtn[aria-label="文件"]').first().click();
await page.waitForSelector(".workbench-filelist button");
await page.getByText("README.md").first().click();
await page.getByRole("button", { name: "编辑", exact: true }).click();
await page.waitForSelector(".cm-content");
await page.locator(".cm-content").click();
for (const chord of ["Control+f", "Meta+f"]) {
if (await page.locator(".cm-textfield").count()) break;
await page.keyboard.press(chord);
await page.waitForTimeout(300);
}
await page.waitForSelector(".cm-textfield");
for (const scale of [0.85, 1, 1.6]) {
await page.evaluate((v) => document.documentElement.style.setProperty("--fs-scale", String(v)), scale);
await page.waitForTimeout(1000);
const read = await page.evaluate(() => {
const px = (el) => parseFloat(getComputedStyle(el).fontSize);
return { text: px(document.querySelector(".cm-content")), field: px(document.querySelector(".cm-textfield")) };
});
check(`${scheme} x${scale}: the editor text is ${12 * scale}px`, Math.abs(read.text - 12 * scale) < 0.1, `${read.text}px`);
check(`${scheme} x${scale}: the search field is ${11 * scale}px`, Math.abs(read.field - 11 * scale) < 0.1, `${read.field}px`);
if (SHOTS) await page.screenshot({ path: `${SHOTS}/editor-${scheme}-${scale}.png`, fullPage: false });
}
await page.close();
}
} finally {
await browser.close();
}
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
@@ -0,0 +1,79 @@
// The composer keeps the 1.x feel: a ring of light sweeps its border once when
// it is hovered or focused, nothing sweeps while a turn runs or when motion is
// reduced, and the run state is announced rather than printed inside the box.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&turns=2";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const shotDir = process.env.SHOTS;
const sweep = (page) => page.evaluate(() => getComputedStyle(document.querySelector(".compose"), "::before").animationName);
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const running of [false, true]) {
const label = `${scheme} ${running ? "running" : "idle"}`;
const page = await browser.newPage({ viewport: { width: 1280, height: 800 }, locale: "zh-CN", colorScheme: scheme });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(BASE + (running ? "&running=1" : ""), { waitUntil: "networkidle" });
await page.waitForSelector(".compose");
if (running) {
await page.waitForFunction(() => typeof window.__feed === "function");
await page.waitForTimeout(400);
await page.evaluate(() => window.__feed({ kind: "turn_started" }));
}
await page.waitForSelector(running ? ".studio-runstate[data-running]" : ".studio-runstate[data-idle]");
await page.mouse.move(5, 5);
await page.waitForTimeout(150);
const state = await page.evaluate(() => {
const status = document.querySelector(".compose .studio-runstate");
const word = status?.querySelector(".studio-runlabel > span.sr-only");
const r = word?.getBoundingClientRect();
const clock = status?.querySelector(".studio-runclock");
return {
role: status?.getAttribute("role"),
live: status?.getAttribute("aria-live"),
said: word?.textContent ?? "",
wordBox: r ? [Math.round(r.width), Math.round(r.height)] : null,
clockShown: !!clock && clock.getBoundingClientRect().width > 0,
mark: !!status?.querySelector(".rmark"),
};
});
check(`${label}: the state is announced`, state.role === "status" && state.live === "polite" && state.said.length > 0, state.said);
check(`${label}: the word is not printed in the box`, state.wordBox && state.wordBox[0] <= 2 && state.wordBox[1] <= 2, JSON.stringify(state.wordBox));
check(`${label}: the mark stays`, state.mark);
if (running) check(`${label}: the clock stays`, state.clockShown);
check(`${label}: nothing sweeps at rest`, (await sweep(page)) === "none");
await page.hover(".compose textarea");
await page.waitForTimeout(300);
const hovered = await sweep(page);
check(`${label}: ${running ? "no sweep on hover while running" : "a sweep on hover"}`, running ? hovered === "none" : hovered === "compose-sweep", hovered);
if (shotDir && !running) await page.locator(".compose").screenshot({ path: `${shotDir}/${scheme}-hover.png` });
await page.mouse.move(5, 5);
await page.waitForTimeout(100);
await page.focus(".compose textarea");
await page.waitForTimeout(300);
const focused = await sweep(page);
check(`${label}: ${running ? "no sweep on focus while running" : "a sweep on focus"}`, running ? focused === "none" : focused === "compose-sweep", focused);
if (shotDir) await page.locator(".compose").screenshot({ path: `${shotDir}/${scheme}-${running ? "running" : "idle"}.png` });
await page.close();
}
const calm = await browser.newPage({ viewport: { width: 1280, height: 800 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
await calm.goto(BASE, { waitUntil: "networkidle" });
await calm.waitForSelector(".compose");
await calm.hover(".compose textarea");
await calm.focus(".compose textarea");
await calm.waitForTimeout(300);
check(`${scheme}: no sweep when motion is reduced`, (await sweep(calm)) === "none");
await calm.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
@@ -0,0 +1,49 @@
// The context card opens on hover and holds buttons (compress now, manage MCP).
// Reaching them means crossing the gap between the meter and the card; a card
// that closes while the pointer is in that gap can never be used. Hover is a
// layout question, so it is asked of a real browser, with the pointer moving
// the way a hand does: in steps, through the gap.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ viewport: { width: 1400, height: 900 }, colorScheme: scheme, locale: "zh-CN" });
const page = await ctx.newPage();
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".studio-meter-context", { timeout: 20000 });
const trigger = page.locator(".studio-meter-context").first();
const tb = await trigger.boundingBox();
await page.mouse.move(tb.x + tb.width / 2, tb.y + tb.height / 2);
await page.waitForTimeout(250);
const card = page.locator(".studio-context-anchor .chrome-context-card");
check(`${scheme}: the card opens while the pointer is on the meter`, await card.isVisible());
const target = card.locator("button, a").first();
const cb = await target.boundingBox();
// Up through the gap in small steps, then onto the card's own control.
await page.mouse.move(cb.x + cb.width / 2, cb.y + cb.height / 2, { steps: 40 });
await page.waitForTimeout(250);
check(`${scheme}: the card is still open after crossing the gap`, await card.isVisible());
const hit = await target.evaluate((el) => {
const r = el.getBoundingClientRect();
const at = document.elementFromPoint(r.left + r.width / 2, r.top + r.height / 2);
return at === el || el.contains(at);
});
check(`${scheme}: its first control takes the pointer`, hit);
await ctx.close();
}
} finally {
await browser.close();
}
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
+5 -3
View File
@@ -1,4 +1,4 @@
// The session title sits right beside the project name in the title bar, at every width, and the
// The session title sits right beside the project and checkout in the title bar, at every width, and the
// project name still gives way (ellipsis) before the title is pushed off. Layout is a real-browser question.
import { chromium } from "playwright";
@@ -22,9 +22,11 @@ try {
const range = document.createRange();
range.selectNodeContents(projEl);
const text = range.getBoundingClientRect();
return { gap: Math.round(sep.left - text.right), titleRight: Math.round(title.right) };
const tags = [...document.querySelectorAll(".chrome .crumb .isolab")].filter((el) => !el.hidden);
const edge = tags.at(-1)?.getBoundingClientRect().right ?? text.right;
return { gap: Math.round(sep.left - edge), titleRight: Math.round(title.right) };
});
check(`${width}px: the title follows the project name`, at.gap >= 0 && at.gap <= 12, `gap ${at.gap}px`);
check(`${width}px: the title follows the project and checkout`, at.gap >= 0 && at.gap <= 12, `gap ${at.gap}px`);
check(`${width}px: the title stays on screen`, at.titleRight <= width, `right edge ${at.titleRight}px`);
const long = await page.evaluate(() => {
document.querySelector(".chrome .crumb-proj").textContent = "a-very-long-project-folder-name-".repeat(8);
@@ -0,0 +1,46 @@
// An opened step shows its detail as a panel in place, bordered on all four sides by one hairline. A rule on one side only
// is a rail, and the transcript has no rails.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1000, height: 900 }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(600);
await page.evaluate(() => {
const f = window.__feed;
f({ kind: "turn_started", authoredTurn: 1, msgIndex: 0, text: "go" });
f({ kind: "tool_dispatch", tool: { id: "t1", name: "bash", args: '{"command":"go test ./..."}' } });
f({ kind: "tool_result", tool: { id: "t1", name: "bash", args: '{"command":"go test ./..."}', output: "ok\n", durationMs: 900 } });
f({ kind: "text", text: "done" });
f({ kind: "turn_done" });
});
await page.waitForTimeout(500);
await page.evaluate(() => document.querySelectorAll("details").forEach((d) => (d.open = true)));
await page.waitForTimeout(400);
await page.mouse.move(995, 5);
const m = await page.evaluate(() =>
[...document.querySelectorAll(".flow .tool-disclosure > .out")].map((el) => {
const cs = getComputedStyle(el);
return { sides: [cs.borderTopWidth, cs.borderRightWidth, cs.borderBottomWidth, cs.borderLeftWidth].join(","), color: [cs.borderTopColor, cs.borderRightColor, cs.borderBottomColor, cs.borderLeftColor] };
}));
check(`${scheme}: an opened step has a detail panel`, m.length > 0, `${m.length} found`);
check(`${scheme}: it is bordered on all four sides`, m.length > 0 && m.every((x) => x.sides === "1px,1px,1px,1px" && new Set(x.color).size === 1), JSON.stringify(m[0] ?? {}));
await ctx.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
+15 -24
View File
@@ -1,4 +1,4 @@
// A docked browser column starts at the top of the pane, beside the navigation row, and gives the rows back when it
// A docked browser column starts at the top of the pane, and gives the rows back when it
// is undocked. Where things start is a layout question, so it is asked of a real browser.
import { chromium } from "playwright";
@@ -19,7 +19,7 @@ const geometry = (page) =>
};
const card = document.querySelector('.pane > .scroll[data-pane="browser"] > .workbench');
const divider = card ? parseFloat(getComputedStyle(card).borderLeftWidth) : 0;
return { pane: box(".pane"), tabs: box(".pane > .tabs"), side: box('.pane > .scroll[data-pane="browser"]'), body: box(".pane > .pbody"), strip: box(".workbench-tabs"), divider };
return { pane: box(".pane"), side: box('.pane > .scroll[data-pane="browser"]'), body: box(".pane > .pbody"), strip: box(".workbench-tabs"), divider };
});
const browser = await chromium.launch();
@@ -40,26 +40,24 @@ for (const scheme of ["light", "dark"]) {
check(`${tag} ${round}: the browser column is drawn`, !!open.side);
if (open.side) {
if (label === "wide") {
check(`${tag} ${round}: it starts at the top of the pane, beside the navigation row`, Math.abs(open.side.top - open.pane.top) <= 1 && Math.abs(open.tabs.top - open.pane.top) <= 1, `pane ${open.pane.top} tabs ${open.tabs.top} column ${open.side.top}`);
check(`${tag} ${round}: it starts at the top of the pane`, Math.abs(open.side.top - open.pane.top) <= 1, `pane ${open.pane.top} column ${open.side.top}`);
check(`${tag} ${round}: it runs to the bottom of the pane`, Math.abs(open.side.bottom - open.pane.bottom) <= 1, `${open.side.bottom} against ${open.pane.bottom}`);
check(`${tag} ${round}: the navigation row stays left of it`, open.tabs.right <= open.side.left + 1, `${open.tabs.right} / ${open.side.left}`);
check(`${tag} ${round}: its strip ends on the navigation row's line, so the two rows read as one`, !!open.strip && Math.abs(open.strip.bottom - open.tabs.bottom) <= 1, JSON.stringify([open.tabs, open.strip]));
check(`${tag} ${round}: the workbench card's own edge separates it from the conversation`, open.divider >= 1, String(open.divider));
} else {
check(`${tag} ${round}: the navigation row stays above the page`, !!open.tabs && open.side.top >= open.tabs.bottom - 1, JSON.stringify([open.tabs, open.side]));
check(`${tag} ${round}: the page takes the pane's full width when it stacks`, open.side.left <= open.pane.left + 1 && open.side.right >= open.pane.right - 1, JSON.stringify([open.pane, open.side]));
}
}
if (SHOTS && round === "first open") await page.screenshot({ path: `${SHOTS}/${process.env.DOCK_TAG ?? "shot"}-${tag.replace("/", "-")}.png` });
}
await page.locator('[data-action="pane.view"][data-value="flow"]').first().click();
await page.locator('[data-action="pane.view"][data-value="browser"][aria-pressed="true"]').first().click();
await page.waitForTimeout(700);
const shut = await geometry(page);
check(`${tag} undocked: the column is gone and the navigation row is as wide as the pane's body again`, (!shut.side || shut.side.left >= shut.pane.right - 1) && !!shut.tabs && shut.tabs.right - shut.tabs.left >= shut.pane.right - shut.pane.left - 24, JSON.stringify([shut.side, shut.tabs, shut.pane]));
check(`${tag} undocked: the column is gone`, !shut.side || shut.side.left >= shut.pane.right - 1, JSON.stringify([shut.side, shut.pane]));
await page.close();
}
}
// Every room between phone and wide, not two samples: the left column shrinks with the window, and the tabs it holds
// must still fit and stay clear of the browser column.
// Every room between phone and wide, not two samples: the conversation shrinks with the window, and it must
// stay clear of the browser column, which stacks over it once the window is narrow.
{
const page = await browser.newPage({ viewport: { width: 1440, height: 800 } });
const bad = [];
@@ -70,22 +68,15 @@ for (const scheme of ["light", "dark"]) {
await page.locator('[data-action="pane.view"][data-value="browser"]').first().click();
await page.waitForTimeout(400);
const g = await page.evaluate(() => {
const tabs = document.querySelector(".pane > .tabs");
const side = document.querySelector('.pane > .scroll[data-pane="browser"]');
const t = tabs.getBoundingClientRect();
const last = [...tabs.querySelectorAll(".tab")].at(-1)?.getBoundingClientRect();
const s = side?.getBoundingClientRect();
const stacked = !!s && s.top >= t.bottom - 1;
const first = tabs.querySelector(".tab")?.getBoundingClientRect();
const pad = parseFloat(getComputedStyle(tabs).paddingLeft) * 2;
const need = last && first ? last.right - first.left + pad : 0;
const pane = document.querySelector(".pane").getBoundingClientRect().width;
return { fits: tabs.scrollWidth <= tabs.clientWidth + 1, clear: stacked || !s || !last || last.right <= s.left + 1, stacked, need, pane };
const side = document.querySelector('.pane > .scroll[data-pane="browser"]')?.getBoundingClientRect();
const body = document.querySelector(".pane > .pbody")?.getBoundingClientRect();
const pane = document.querySelector(".pane").getBoundingClientRect();
const stacked = !!side && side.left <= pane.left + 40;
return { stacked, clear: stacked || !side || !body || body.right <= side.left + 1 };
});
const should = g.pane < g.need + 320 || width <= 640;
if (!g.fits || !g.clear || g.stacked !== should) bad.push(`${width}:${g.fits ? "" : "overflow "}${g.clear ? "" : "overlap "}${g.stacked !== should ? `stacked=${g.stacked} pane=${Math.round(g.pane)} need=${Math.round(g.need)}` : ""}`);
if (!g.clear || (width <= 640 && !g.stacked) || (width >= 1000 && g.stacked)) bad.push(`${width}:${g.clear ? "" : "overlap "}stacked=${g.stacked}`);
}
check("from 560 to 1440 the tabs fit their row, stay clear of the browser column, and the column stacks exactly when tabs plus its 320px floor no longer fit", bad.length === 0, bad.join(" "));
check("from 560 to 1440 the conversation stays clear of the browser column, which stacks only in a narrow window", bad.length === 0, bad.join(" "));
await page.close();
}
await browser.close();
+55
View File
@@ -0,0 +1,55 @@
// Keyboard focus has to be seen. Every button the keyboard reaches in the workbench must look different when focused for a
// reason other than fading in: an outline, a shadow, a border or a background. A control that only changes opacity is
// invisible to anyone who cannot tell .45 from 1.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1280, height: 900 }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(700);
await page.mouse.move(1270, 5);
await page.evaluate(() => document.activeElement?.blur());
const look = (el) => {
const cs = getComputedStyle(el);
return [cs.outlineStyle === "none" ? "" : `${cs.outlineWidth} ${cs.outlineColor}`, cs.boxShadow, cs.borderColor, cs.backgroundColor, cs.textDecorationLine].join("|");
};
const seen = new Set();
let stops = 0;
const bad = [];
for (let i = 0; i < 90; i++) {
await page.keyboard.press("Tab");
const r = await page.evaluate(() => {
const el = document.activeElement;
if (!el || el === document.body || el.tagName !== "BUTTON") return null;
const cs = getComputedStyle(el);
const focused = [cs.outlineStyle === "none" ? "" : `${cs.outlineWidth} ${cs.outlineColor}`, cs.boxShadow, cs.borderColor, cs.backgroundColor, cs.textDecorationLine].join("|");
const id = (el.getAttribute("aria-label") || el.textContent || el.getAttribute("data-action") || "button").trim().slice(0, 40);
el.blur();
const css2 = getComputedStyle(el);
const plain = [css2.outlineStyle === "none" ? "" : `${css2.outlineWidth} ${css2.outlineColor}`, css2.boxShadow, css2.borderColor, css2.backgroundColor, css2.textDecorationLine].join("|");
const r = el.getBoundingClientRect();
el.focus({ focusVisible: true });
return { id, key: id + Math.round(r.left) + Math.round(r.top), same: focused === plain, shown: r.width > 0 && r.height > 0 };
});
if (!r) continue;
if (seen.has(r.key)) break;
seen.add(r.key);
stops++;
if (r.shown && r.same) bad.push(r.id);
}
console.log(`${bad.length ? "FAIL" : " ok"} ${scheme}: ${stops} buttons reached by Tab${bad.length ? ", no visible focus on: " + bad.join("; ") : ""}`);
if (bad.length) fails.push(`${scheme}: ${bad.join("; ")}`);
await ctx.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
+90
View File
@@ -0,0 +1,90 @@
// Interface text has one size dial, --fs-scale, and the transcript has its own,
// --read. Every piece of text must answer to one of them: text that moves with
// neither is a size written into a stylesheet as a bare pixel count, which the
// text-size setting could never reach.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const SCENES = [
{ name: "conversation", q: "?pref=zh&ws=2&sess=6&turns=3" },
{ name: "files panel", q: "?pref=zh&ws=2&sess=6&turns=2", act: async (p) => { await p.locator('.navbtn[aria-label="文件"]').first().click(); await p.waitForSelector(".workbench-filelist button"); } },
{ name: "side panel", q: "?pref=zh&turns=2", act: async (p) => { await p.locator('[data-action="side.toggle"]').click(); await p.waitForSelector(".sidepanel"); } },
{ name: "narrow", q: "?pref=zh&ws=2&sess=6&turns=2", w: 390 },
{ name: "settings", q: "?pref=zh&turns=2", tabs: true },
];
const sizes = (page) => page.evaluate(() => {
window.__texts ??= (() => {
const out = [];
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
let n;
while ((n = walker.nextNode())) {
if (![...n.childNodes].some((c) => c.nodeType === 3 && c.textContent.trim())) continue;
const r = n.getBoundingClientRect();
if (r.width < 2 || r.height < 2 || !n.checkVisibility({ checkVisibilityCSS: true, contentVisibilityAuto: true })) continue;
out.push(n);
}
return out;
})();
return window.__texts.map((el) => parseFloat(getComputedStyle(el).fontSize));
});
const browser = await chromium.launch();
for (const sc of SCENES) {
const page = await browser.newPage({ viewport: { width: sc.w ?? 1400, height: 900 }, locale: "zh-CN", reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(BASE + sc.q, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.evaluate(() => document.fonts.ready);
const views = [];
if (sc.tabs) {
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForSelector(".prefs-nav button");
const n = await page.evaluate(() => document.querySelectorAll(".prefs-nav button").length);
for (let i = 0; i < n; i++) views.push(async () => { await page.evaluate((k) => document.querySelectorAll(".prefs-nav button")[k].click(), i); });
} else views.push(async () => { await sc.act?.(page); });
let total = 0;
const holes = new Map();
for (const show of views) {
await show();
await page.waitForTimeout(500);
await page.evaluate(() => { window.__texts = undefined; document.documentElement.style.setProperty("--fs-scale", "1"); });
const base = await sizes(page);
await page.evaluate(() => document.documentElement.style.setProperty("--fs-scale", "1.25"));
await page.waitForTimeout(80);
const scaled = await sizes(page);
await page.evaluate(() => {
const root = document.documentElement.style;
window.__read = root.getPropertyValue("--read");
root.setProperty("--fs-scale", "1");
root.setProperty("--read", `${parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--read")) * 1.25}px`);
});
await page.waitForTimeout(80);
const reading = await sizes(page);
await page.evaluate(() => {
const root = document.documentElement.style;
if (window.__read) root.setProperty("--read", window.__read);
else root.removeProperty("--read");
});
const names = await page.evaluate(() => window.__texts.map((el) => (el.className && typeof el.className === "string" ? el.className.trim().split(/\s+/).slice(0, 2).join(".") : el.tagName.toLowerCase()) + " " + el.textContent.trim().slice(0, 10)));
base.forEach((b, i) => {
if (b <= 0) return;
total++;
const ok = Math.abs(scaled[i] / b - 1.25) < 0.03 || Math.abs(reading[i] / b - 1.25) < 0.03;
if (!ok) holes.set(`${names[i]} (${b}px)`, (holes.get(`${names[i]} (${b}px)`) ?? 0) + 1);
});
}
check(`${sc.name}: every piece of text answers to the text size or the reading size`, holes.size === 0, `${total} text nodes${holes.size ? "; stuck: " + [...holes.keys()].slice(0, 6).join(", ") : ""}`);
await page.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
+86
View File
@@ -0,0 +1,86 @@
// The Git panel in the workbench: a workspace that is one repository shows the changes as a folder tree to stage,
// discard and commit, a push that is previewed before it is confirmed, and a history whose commits open into their
// files; a folder of projects shows one section per repository, each acting on its own.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const shotDir = process.env.SHOTS;
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
for (const width of [1400, 700]) {
const tag = `${scheme} ${width}px`;
const open = async (query) => {
const page = await browser.newPage({ colorScheme: scheme, viewport: { width, height: 1000 }, locale: "zh-CN", reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&ws=2&sess=3&turns=2${query}`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.locator('.navbtn[aria-label="文件"]').first().click();
await page.waitForSelector(".workbench-changes");
return page;
};
const shot = async (page, name) => {
if (!shotDir) return;
await page.mouse.move(width - 3, 995);
await page.waitForTimeout(250);
const box = await page.locator(".workbench-explorer").first().boundingBox();
// At phone width the composer's toolbar is drawn over the foot of the column; the panel's own picture stops above it.
await page.screenshot({ path: `${shotDir}/${scheme}-${width}-${name}.png`, clip: { x: box.x, y: box.y, width: box.width, height: box.height - (width <= 700 ? 150 : 0) } });
};
const one = await open("");
const tree = await one.evaluate(() => ({
folders: [...document.querySelectorAll(".workbench-change-folder")].length,
rows: [...document.querySelectorAll('.workbench-change-row[data-action="workbench.diff"]')].length,
overflow: document.querySelector(".workbench-explorer").scrollWidth > document.querySelector(".workbench-explorer").clientWidth + 1,
}));
check(`${tag}: the changes are a folder tree`, tree.folders >= 2 && tree.rows === 4, JSON.stringify(tree));
check(`${tag}: the panel does not push sideways`, !tree.overflow);
await shot(one, "changes");
await one.locator('[data-action="workbench.discard"]').first().focus();
await one.locator('[data-action="workbench.discard"]').first().click();
await one.waitForSelector(".workbench-discard-ask");
const ask = await one.evaluate(() => document.querySelector(".workbench-discard-ask").textContent);
check(`${tag}: a discard asks first and says it cannot be undone`, ask.includes("无法恢复"));
await shot(one, "discard");
await one.getByRole("button", { name: "取消", exact: true }).first().click();
await one.getByRole("button", { name: "推送…" }).click();
await one.waitForSelector(".push-card");
const push = await one.evaluate(() => document.querySelector(".push-card").textContent);
check(`${tag}: the push says where it goes before it goes`, push.includes("github.com") && push.includes("main → origin/main") && push.includes("从不强制推送"), push.slice(0, 120));
await shot(one, "push");
await one.getByRole("button", { name: "推送到 github.com", exact: false }).last().click();
await one.waitForSelector('.push-card[data-phase="done"]');
check(`${tag}: a confirmed push reports it`, (await one.locator(".push-card").textContent()).includes("已把 2 个提交推送到 github.com"));
await shot(one, "pushed");
await one.getByText("提交历史").click();
await one.getByRole("button", { name: /show the commit graph/ }).click();
await one.getByRole("button", { name: /retry\.go/ }).last().click();
await one.waitForSelector(".gh-diff");
await shot(one, "history");
await one.close();
const many = await open("&git=multi");
const heads = await many.evaluate(() => [...document.querySelectorAll(".workbench-repo-head")].map((h) => h.textContent));
check(`${tag}: a folder of projects shows a section per repository`, heads.length === 3 && heads[0].includes("api") && heads[1].includes("feature/login"), heads.join(" | "));
await shot(many, "repos");
await many.locator('.workbench-repo[data-repo="web"] [data-action="workbench.stage"]').first().click();
await many.waitForFunction(() => document.querySelector('.workbench-repo[data-repo="web"] [data-action="workbench.stage"]')?.getAttribute("aria-checked") === "true");
check(`${tag}: staging in one repository leaves the others as they were`, (await many.locator('.workbench-repo[data-repo="api"] [data-action="workbench.stage"][aria-checked="true"]').count()) === 1);
await many.close();
}
}
} finally {
await browser.close();
}
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
+225 -12
View File
@@ -7,9 +7,11 @@ import "../src/styles/app.css";
import "../src/styles/dock.css";
import "../src/styles/studio.css";
import "../src/styles/changedpill.css";
import "../src/styles/askskip.css";
import "../src/styles/pastekeep.css";
import "../src/styles/ctxitems.css";
import "../src/styles/sidepanel.css";
import "../src/styles/contentmatches.css";
import "../src/styles/scrolljump.css";
import "../src/styles/chart.css";
import "../src/styles/community.css";
@@ -25,9 +27,13 @@ import "../src/styles/dialogcenter.css";
import "../src/styles/treerows.css";
import "../src/styles/workbench-changes.css";
import "../src/styles/gitgraph.css";
import "../src/styles/vthumb.css";
import "../src/styles/tips.css";
import "../src/styles/waitnote.css";
import "../src/styles/bring.css";
import "../src/styles/peerthreads.css";
import "../src/styles/line.css";
import "../src/styles/notice.css";
import "../src/styles/peers.css";
import "../src/styles/jsontext.css";
import "../src/styles/skillpin.css";
import "../src/styles/narrow.css";
@@ -36,13 +42,17 @@ import "../src/styles/workbench-launcher.css";
import "../src/styles/feedback.css";
import "../src/styles/toasts.css";
import "../src/styles/modelmenu.css";
import "../src/styles/composer-menu.css";
import "../src/styles/runsignals.css";
import "../src/styles/overview.css";
import "../src/styles/themes.css";
import { App } from "../src/ui/App";
import { MockHub } from "../src/port/mock_hub";
import { MockPort } from "../src/port/mock";
import { fromHistory } from "../src/state/session";
import type { AgentPort, Appearance, HistoryMessage } from "../src/port/port";
import { HttpError } from "../src/port/port";
import type { AgentPort, Appearance, ChipCall, HistoryMessage, McpEntry } from "../src/port/port";
import type { UpdateProgress } from "../src/port/version";
import type { ThemePack } from "../src/port/look";
import type { RuntimeView, TreeWorkspace } from "../src/port/hub";
import type { WireEvent } from "../src/port/wire";
@@ -86,18 +96,101 @@ function benchPack(): ThemePack | null {
}
class BenchPort extends MockPort {
async browserTabs() {
if (!query.has("agentpage")) return super.browserTabs();
return [{ id: "t1", target: "view-a", url: "https://example.com/docs/install", title: "Install guide", active: true }];
// ?mcpactions=1 adds a server whose tools are withheld and one that is followed.
constructor() {
super();
// ?git=multi is a folder of projects: three repositories, each with changes of its own.
if (query.get("git") === "multi") {
this.repoRows = [
{ dir: "api", name: "api", branch: "main", detached: false },
{ dir: "web", name: "web", branch: "feature/login", detached: false },
{ dir: "tools/release", name: "release", branch: "main", detached: false },
];
this.repoChanges = {
api: [
{ path: "internal/server/routes.go", status: "M", unstaged: true, insertions: 12, deletions: 3 },
{ path: "internal/server/routes_test.go", status: "M", staged: true, insertions: 20, deletions: 0 },
{ path: "README.md", status: "??", unstaged: true },
],
web: [
{ path: "src/login/Form.tsx", status: "M", unstaged: true, insertions: 31, deletions: 9 },
{ path: "src/login/api.ts", status: "M", staged: true, unstaged: true, insertions: 4, deletions: 1 },
],
"tools/release": [],
};
}
if (!query.has("mcpactions")) return;
(this as unknown as { servers: McpEntry[] }).servers.push(
{ name: "notes", state: "ready", enabled: true, transport: "stdio", tools: 2, description: "Notes the agent can search and add to.",
held: [{ name: "mcp__notes__search", class: "changed" }, { name: "mcp__notes__add", class: "added" }], heldDigest: "digest-1" },
{ name: "wiki", state: "ready", enabled: true, transport: "http", tools: 4, followsChanges: true, description: "The team wiki." },
);
}
async workspaceFile(path: string) {
// ?netshell=1 is a connection over HTTP: a `!` line is refused as the kernel refuses it.
async submit(text: string, chips?: ChipCall) {
(window.__sent ??= []).push(text);
if (query.has("netshell") && text.trimStart().startsWith("!")) throw new HttpError(403, "shell commands are unavailable over HTTP", { code: "shell.unavailable_over_http" });
return super.submit(text, chips);
}
// ?checkfail=<name> makes a plain test of that source answer 401.
protected async answerCheck(name: string) {
if (query.get("checkfail") !== name) return super.answerCheck(name);
return { ok: false, code: "provider.probe.unauthorized", httpStatus: 401, detail: "Invalid Authentication" };
}
// ?twoports=1: two local servers on one host, told apart by port, sharing a key slot.
// ?badprice=1: DeepSeek's flash price is a card the vendor's table does not have,
// under a pinned display currency.
async providers() {
const all = await super.providers();
if (query.has("twoports")) {
const local = (name: string, port: number) => ({
...all[0], name, baseUrl: `http://127.0.0.1:${port}/v1`, keyEnv: "LOCAL_API_KEY", inUse: false, preset: false,
models: [`${name}-chat`], default: `${name}-chat`,
});
return [...all, local("local", 8756), local("local-2", 8788)];
}
if (!query.has("badprice")) return all;
return all.map((p) => p.name === "deepseek"
? { ...p, officialPricing: true, modelPrices: { "deepseek-flash": { input: 0.3, output: 1.2, cacheHit: 0, currency: "USD", official: false } } }
: p);
}
async displayCurrency() {
const got = await super.displayCurrency();
return query.has("badprice") ? { ...got, mode: "CNY" as const, unconverted: [{ provider: "deepseek", model: "deepseek-flash", currency: "USD" }] } : got;
}
async browserTabs() {
if (!query.has("agentpage")) return super.browserTabs();
const url = query.get("agentpage") === "file" ? "file:///Users/me/work/site/index.html" : "https://example.com/docs/install";
return [{ id: "t1", target: "view-a", url, title: "Install guide", active: true }];
}
// ?grant=1 grants the workspace a folder, /library, holding one document.
async workspaceRoots() {
const roots = await super.workspaceRoots();
return query.has("grant") ? { ...roots, extra: ["/library"] } : roots;
}
async workspaceFile(path: string, root?: string) {
if (root) {
const content = "# Release plan\n\nThe plan lives in the library folder you granted this project.\n\n- freeze on Friday\n- tag after the checks are green\n- announce the next morning\n";
return { path, content, revision: "r1", root, readOnly: true };
}
if (!query.has("doc") || !path.endsWith(".md")) return super.workspaceFile(path);
const content = "# Install guide\n\nDownload the package for your system, then run the installer. It places the program in your user folder and does not need administrator rights.\n\nAfter the first start, open Settings and add a model service before you begin a conversation.";
return { path, content, revision: "r1" };
}
async updateMode() {
return query.has("update") ? "notify" : super.updateMode();
}
async versions() {
if (query.has("update")) return { current: "2.42.0", pinned: "", stalePin: false, latest: "2.43.0", newer: true, versions: [] };
if (!query.has("versions")) return super.versions();
const names = ["2.38.0", "2.37.0", "2.36.0", "2.35.0", "2.34.0", "2.33.0", "2.32.0", "2.31.0", "2.30.0", "2.29.0"];
return {
@@ -135,6 +228,49 @@ class BenchPort extends MockPort {
return ONBOARDING ? { required: true, noProvider: true, provider: "", model: "" } : null;
}
async peers() {
if (query.has("peerthreads")) {
const states = ["waiting", "working", "replied", "declined"] as const;
return {
enabled: true,
peers: [],
held: [],
threads: states.map((state, i) => ({ key: `s-${i}`, title: ["文档整理", "发布脚本", "拾音", "旧迁移"][i], project: "rx-archive", sessionPath: `/sessions/w0-s${i}.jsonl`, state, since: "2026-10-16T10:00:00Z", messageId: `m-${i}` })),
};
}
if (!query.has("peers")) return super.peers();
return {
enabled: true,
peers: [{ key: "s-1a2b3c4d", title: "拾音", project: "rx-archive" }, { key: "s-5e6f7a8b", title: "文档整理", project: "docs" }],
held: [{ id: "m-1", fromSession: "s-1a2b3c4d", fromTitle: "拾音", fromProject: "rx-archive", sentAt: "2026-10-16T12:00:00Z", body: "迁移脚本跑完了,结果在 out/report.md,请你核对第三节再继续。" }],
};
}
async webAccessSettings() {
if (!query.has("webaccess")) return super.webAccessSettings();
return {
search_backends: ["searxng", "deepseek_api"], searxng_url: "http://127.0.0.1:8080", search_paid_allowed: [],
fetch_backends: ["local", "deepseek_api"], fetch_paid_allowed: [],
known_search_backends: ["searxng", "deepseek_api"], known_fetch_backends: ["local", "deepseek_api"], paid_backends: ["deepseek_api"],
deepseek_api_ready: query.get("webaccess") !== "noready", video_url_passthrough: query.has("videourl"), path: "/Users/you/.reasonix/config.toml",
};
}
async probeSearxng() {
const answer = query.get("probe");
if (!answer || answer === "ok") return super.probeSearxng();
return { ok: false, code: `search.searxng_${answer}`, status: answer === "status" ? 429 : answer === "json_disabled" ? 403 : undefined };
}
async peersSettings() {
if (!query.has("peerset")) return super.peersSettings();
return {
enabled: true, dispatch: true, max_dispatch_depth: 1, max_dispatched_sessions: 8, applies: "next_turn" as const, pending: query.has("pending"), available: true,
path: "/Users/you/.reasonix/config.toml",
release_projects: [{ path: "/Users/you/work/site", name: "site" }, { path: "/Users/you/work/api-gateway", name: "api-gateway" }],
};
}
async foldWorkSettings() {
return { ...(await super.foldWorkSettings()), fold: query.has("fold") };
}
@@ -150,8 +286,15 @@ class BenchPort extends MockPort {
return PREF === null ? look : { ...look, language: PREF };
}
private settingCardSent = false;
subscribe(on: (e: WireEvent) => void) {
this.subs.add(on);
const card = query.get("settingcard");
if (card && !this.settingCardSent) {
this.settingCardSent = true;
setTimeout(() => this.feed(settingCardFrame(card)), 400);
}
return () => this.subs.delete(on);
}
@@ -180,13 +323,16 @@ class BenchPort extends MockPort {
id: `seed-${i}`,
// Lines the person queued: the panel leaves out the host's own queued
// continuations, so a seed of those would draw nothing.
intent: "followup" as const,
intent: (QUEUE_IMAGES && i === 0 ? "steer" : "followup") as "steer" | "followup",
state: "queued" as const,
...(QUEUE_IMAGES && i === 0 ? { images: true } : {}),
// 三种长度,各有各的对照:第一条没被截断(不该弹),第二条长到撞天花板
// (浮层要自己滚),其余是寻常的被截断行。内核把 preview 截到 120 runes,
// 所以第二条在队列里到不了 —— 但 .ovf 是通用的,天花板得有人证明它在。
preview:
i === 0
QUEUE_IMAGES && i === 0
? "@.reasonix/attachments/clipboard-20261017-141249.png reasonix 的你改好了?我这边看到的还是旧界面"
: i === 0
? "bash-1 — failed"
: i === 1
? `bash-2 — failed: ${"error[E0308]: mismatched types in the trait implementation; ".repeat(14)}`
@@ -210,19 +356,46 @@ class BenchPort extends MockPort {
private readonly jobsSince = Date.now() - 739_000;
async status() {
const st = await super.status();
const usage = query.get("goalusage");
const goalRuntime = usage
? { turnsUsed: 4, tokensUsed: 128_400, requestsUsed: 9, workDurationMs: 12 * 60_000, noProgressTurns: usage === "blocked" ? 2 : 0, ...(usage === "blocked" ? { stopCause: "goal_stuck", lastReason: "测试一直没有通过,改动没有让失败的数量减少" } : {}) }
: undefined;
const st = { ...(await super.status()), ...(query.has("running") ? { running: true } : {}), ...(query.has("goal") ? { goal: query.get("goal") ?? "" } : {}), ...(usage ? { goalStatus: usage, goalRuntime } : {}) };
if (STATUS_MS > 0) await new Promise((r) => setTimeout(r, STATUS_MS));
if (!JOBS) return st;
const jobs = Array.from({ length: JOBS }, (_, i) => ({
id: `job-${i}`,
kind: "bash",
label: i === 0 ? "npm run tauri:test 2>&1 | Select-Object -Last 40" : `go test ./internal/... -run Case${i}`,
// ?jobnames=1 gives each job the name its caller wrote and the full command.
...(query.has("jobnames") ? {
description: i === 0 ? "运行桌面端测试并只看最后 40 行输出" : `跑第 ${i} 组内核测试`,
detail: i === 0 ? "npm run tauri:test 2>&1 | Select-Object -Last 40" : `go test ./internal/... -run Case${i} -count=1 -timeout 10m`,
} : {}),
status: this.stopped.has(`job-${i}`) ? "killed" : "running",
startedAt: this.jobsSince,
}));
return { ...st, jobs };
}
async switchBranch(name: string) {
if (SWITCH_MS > 0) await new Promise((r) => setTimeout(r, SWITCH_MS));
return super.switchBranch(name);
}
async goToVersion() {}
onUpdateProgress(cb?: (p: UpdateProgress) => void) {
if (cb && query.has("update")) queueMicrotask(() => cb({ version: "2.43.0", phase: "ready", received: 0, total: 0 }));
return () => {};
}
async jobOutput(jobId: string) {
if (!JOBS) return super.jobOutput(jobId);
const lines = Array.from({ length: 28 }, (_, i) => `[${String(i).padStart(2, "0")}] compiling module ${i * 7 + 3} … ok`);
return { text: lines.join("\n") + "\nwatching for changes\n", status: this.stopped.has(jobId) ? "killed" : "running", bytes: 1100, truncated: false };
}
async cancelJob(jobId: string) {
if (!JOBS) return super.cancelJob(jobId);
this.stopped.add(jobId);
@@ -236,7 +409,7 @@ function storedHistory(): HistoryMessage[] {
const msgs: HistoryMessage[] = [];
for (let i = 0; i < TURNS; i++) {
const pinned = query.get("skill") === "1" && i === TURNS - 1;
msgs.push({ role: "user", content: pinned ? SKILL_PIN : `第 ${i} 个问题,麻烦看一下这个文件。` });
msgs.push({ role: "user", content: pinned ? SKILL_PIN : `第 ${i} 个问题,麻烦看一下这个文件。`, createdAt: new Date(2026, 9, 17, 18, 33 + i).getTime() });
msgs.push({
role: "assistant",
content: `第 ${i} 段回答,说明刚才那一步做了什么。\n\n- 要点一\n- 要点二\n`,
@@ -261,9 +434,12 @@ const SESSIONS = Number(query.get("sess") ?? 0);
// ?turns= is how long the conversation being opened already is.
const TURNS = Number(query.get("turns") ?? 0);
const STATUS_MS = Number(query.get("statusms") ?? 0);
const SWITCH_MS = Number(query.get("switchms") ?? 0);
// ?queue= is how many lines are already waiting when the window opens.
const QUEUE = Number(query.get("queue") ?? 0);
const QUEUE_BODY = query.has("queuebody");
// ?queueimages makes the first seeded line a steer that carries a picture.
const QUEUE_IMAGES = query.has("queueimages");
const JOBS = Number(query.get("jobs") ?? 0);
// ?treems= holds every tree read back until that long after load, so the
// window can be seen before the kernel has named a single folder.
@@ -274,6 +450,16 @@ const NO_PANES = PANES === 0;
class BenchHub extends MockHub {
readonly feeds = new Map<string, BenchPort>();
// ?search=1 answers every query with two conversations that say it.
async searchHistory(q: string) {
if (!query.has("search")) return super.searchHistory(q);
return [
{ path: "/sessions/mock.jsonl", id: "mock", snippet: `…上周讨论过要不要把 ${q} 的轮换放进发布流程,结论是每月一次…`, role: "assistant", messageIndex: 4, score: 2 },
{ path: "/sessions/older.jsonl", id: "older", snippet: `怎么把 ${q} 配到预发环境里?`, role: "user", messageIndex: 0, score: 1 },
];
}
private readonly settingsPort = new BenchPort();
machinePort(): AgentPort {
@@ -300,6 +486,11 @@ class BenchHub extends MockHub {
);
}
async moveSessionTo(path: string, target: string) {
(window.__moves ??= []).push({ path, target });
return super.moveSessionTo(path, target);
}
tree(): Promise<TreeWorkspace[]> {
const wait = TREE_AT - performance.now();
if (wait > 0) return new Promise((resolve) => setTimeout(() => resolve(this.tree()), wait));
@@ -308,13 +499,14 @@ class BenchHub extends MockHub {
Array.from({ length: WORKSPACES }, (_, w) => ({
root: `~/projects/workspace-${w}`,
name: `workspace-${w}`,
remembered: true,
open: w === 0,
sessions: Array.from({ length: SESSIONS }, (_, s) => ({
sessions: this.placed(`~/projects/workspace-${w}`, Array.from({ length: SESSIONS }, (_, s) => ({
path: `/sessions/w${w}-s${s}.jsonl`,
name: `w${w}-s${s}`,
title: `第 ${s} 次会话,标题是内核起的一句话`,
turns: (s % 40) + 1,
})),
}))),
})),
);
}
@@ -333,6 +525,8 @@ createRoot(document.getElementById("root")!).render(<App hub={hub} />);
declare global {
interface Window {
__moves?: { path: string; target: string }[];
__sent?: string[];
// Feeds every open pane, so a split-view measurement costs what two live
// conversations really cost.
__feed: (ev: WireEvent) => void;
@@ -369,3 +563,22 @@ window.__foldCost = () => {
fromHistory(msgs);
return performance.now() - t0;
};
// ?settingcard= draws what the kernel sends when the model asks to change a
// setting: a preference card, an elevated one, or the notice that points at a
// setting only the user may change.
function settingCardFrame(kind: string): WireEvent {
if (kind === "open") {
return { kind: "notice", level: "info", code: "setting_open", text: "助手需要改动 permissions.mode,只有你本人能改。", detail: "permissions.mode" } as WireEvent;
}
const elevated = kind === "elevated";
const id = elevated ? "peers.dispatch" : "ui.show_receipt";
return {
kind: "approval_request",
approval: {
id: "s1", tool: elevated ? "setting_change_elevated" : "setting_change", subject: id, kind: "tool", fresh: true,
allowsSession: !elevated, allowsPersist: false,
reason: `助手请求把设置 ${id} 从 false 改为 true。${elevated ? "从下一回合起生效。" : "立即生效。"}\n它给出的理由:要把任务交给另一个项目里的会话。`,
},
} as WireEvent;
}
+16 -6
View File
@@ -14,10 +14,15 @@ const CONTROLS = [".studio-mode-picker", ".studio-branch", ".model-picker", ".co
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
for (const scheme of ["light", "dark"]) for (const turns of [2, 0]) {
const context = `${scheme}, ${turns ? "existing conversation" : "new conversation"}`;
const url = new URL(BASE);
url.searchParams.set("turns", String(turns));
const page = await browser.newPage({ colorScheme: scheme, viewport: { width: 1100, height: 760 } });
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".compose .studio-branch");
await page.goto(url.href, { waitUntil: "networkidle" });
await page.waitForSelector(turns ? ".compose .studio-branch" : ".compose .worktree-trigger");
const inline = await page.locator(".compose .studio-branch").first().evaluate((e) => !!e.closest(".turntools"));
check(`${context}: workspace control stays in the toolbar`, inline);
const seen = [];
for (const sel of CONTROLS) {
const el = page.locator(`.compose ${sel}`.replace(".compose .compose", ".compose")).first();
@@ -26,11 +31,16 @@ try {
await page.waitForTimeout(300);
seen.push([sel, await el.evaluate((e) => ({ radius: getComputedStyle(e).borderRadius, bg: getComputedStyle(e).backgroundColor }))]);
}
check(`${scheme}: the hovered controls were all found`, seen.length === CONTROLS.length, `${seen.length} of ${CONTROLS.length}`);
check(`${context}: the hovered controls were all found`, seen.length === CONTROLS.length, `${seen.length} of ${CONTROLS.length}`);
const radii = new Set(seen.map(([, v]) => v.radius));
const grounds = new Set(seen.map(([, v]) => v.bg));
check(`${scheme}: one corner radius across the row`, radii.size === 1, [...radii].join(" / "));
check(`${scheme}: one hover ground across the row`, grounds.size === 1, [...grounds].join(" / "));
check(`${context}: one corner radius across the row`, radii.size === 1, [...radii].join(" / "));
check(`${context}: one hover ground across the row`, grounds.size === 1, [...grounds].join(" / "));
await page.setViewportSize({ width: 390, height: 844 });
await page.goto(url.href, { waitUntil: "networkidle" });
const chip = page.locator(turns ? ".compose .studio-branch" : ".compose .worktree-trigger").first();
await chip.click();
check(`${context}: a narrow-pane pointer click opens the workspace menu`, await chip.getAttribute("aria-expanded") === "true");
await page.close();
}
} finally {
@@ -0,0 +1,64 @@
// Interface wording the catalogue test cannot see: a Chinese label kept in a table and drawn without t() passes every
// source scan and still shows up in the English window. This opens each settings section in English, fires the probes
// that fill in more of the page, and fails on any Chinese the reader would see that is not on the fixture list below.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
// Names the demo data itself carries, and names that are written in Chinese on purpose.
const FIXTURE = [
/并行会话演示/, /上一次的会话/, /站点改版/, /数据管线/, /跑一遍评测/, /^中文$/, /^做游戏的小鱼$/, /^DeepSeek-Reasonix官方群$/,
/缓存命中率为什么会掉/, /Co-Authored-By/, /Generated with/, /^回复用中文$/, /^跟着用户每条消息的语言走$/, /v2 是从零重写的 Go 内核/,
/没有 web,桌面端重做/, /问题里提到了 main-v2/, /构建用 -tags legacy/, /^迁移前的构建方式$/,
];
const fails = [];
const browser = await chromium.launch();
const ctx = await browser.newContext({ locale: "en-US", viewport: { width: 1280, height: 900 } });
const page = await ctx.newPage();
page.setDefaultTimeout(8000);
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(`${BASE}?pref=en`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(800);
const scan = () => {
const out = [];
const w = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
for (let n = w.nextNode(); n; n = w.nextNode()) {
const text = n.textContent.trim();
if (text && /[一-鿿]/.test(text) && !["SCRIPT", "STYLE"].includes(n.parentElement?.tagName)) out.push(text);
}
for (const el of document.querySelectorAll("[aria-label],[title],[placeholder],[alt]"))
for (const a of ["aria-label", "title", "placeholder", "alt"]) {
const v = el.getAttribute(a);
if (v && /[一-鿿]/.test(v)) out.push(v);
}
return out;
};
const seen = new Map();
const take = async (where) => {
for (const text of await page.evaluate(scan)) if (!FIXTURE.some((re) => re.test(text)) && !seen.has(text)) seen.set(text, where);
};
await take("workbench");
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForTimeout(500);
await page.evaluate(() => [...document.querySelectorAll("button")].find((x) => /Back up|repair/i.test(x.textContent))?.click());
await page.waitForTimeout(400);
const sections = await page.evaluate(() => [...new Set([...document.querySelectorAll('[data-action="settings.section"]')].map((b) => b.getAttribute("data-value")))]);
if (sections.length < 8) fails.push(`only ${sections.length} settings sections found; the guard is looking at the wrong page`);
for (const value of sections) {
await page.evaluate((v) => document.querySelector(`[data-action="settings.section"][data-value="${v}"]`)?.click(), value);
await page.waitForTimeout(450);
await page.evaluate(() => document.querySelector('[data-action="network.diagnose"]')?.click());
await page.evaluate(() => document.querySelectorAll("details").forEach((d) => (d.open = true)));
await page.waitForTimeout(500);
await take(`settings:${value}`);
}
await browser.close();
for (const [text, where] of seen) fails.push(`${where}: ${text.slice(0, 80)}`);
if (fails.length) {
console.log("Chinese in the English window:\n " + fails.join("\n "));
process.exit(1);
}
console.log(`ok ${sections.length} settings sections, no unlisted Chinese in the English window`);
+52
View File
@@ -0,0 +1,52 @@
// A background job is named for a person: the list shows the name its caller gave it, and the whole name and the full command
// appear in a tip that stays inside the window, can be selected, and opens from the keyboard as well as the pointer.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const [width, height] of [[1280, 860], [400, 760]]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width, height }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(`${BASE}?jobs=3&jobnames=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(800);
await page.evaluate(() => [...document.querySelectorAll("button")].find((b) => /后台任务/.test(b.textContent))?.click());
await page.waitForSelector(".jobs .job .cmd");
const tag = `${scheme} ${width}px`;
const shown = await page.evaluate(() => [...document.querySelectorAll(".jobs .job .cmd")].map((e) => e.textContent));
check(`${tag}: the list shows the names, not the commands`, shown.length === 3 && shown.every((t) => !/go test|npm run/.test(t)), shown.join(" | "));
await page.locator(".jobs .job .cmd").first().hover();
await page.waitForSelector(".job-tip");
const tip = await page.evaluate(() => {
const el = document.querySelector(".job-tip");
const r = el.getBoundingClientRect();
return { inside: r.left >= 0 && r.top >= 0 && r.right <= innerWidth + 1 && r.bottom <= innerHeight + 1, lines: el.children.length, select: getComputedStyle(el).userSelect, cmd: el.querySelector(".jt-cmd")?.textContent ?? "" };
});
check(`${tag}: the tip has the name and the full command, inside the window`, tip.inside && tip.lines === 2 && /npm run tauri:test/.test(tip.cmd), JSON.stringify(tip));
check(`${tag}: its text can be selected`, tip.select === "text", tip.select);
await page.mouse.move(width - 5, 5);
await page.waitForTimeout(200);
check(`${tag}: it closes when the pointer leaves`, (await page.locator(".job-tip").count()) === 0);
await page.locator(".jobs .job .cmd").nth(1).focus();
await page.waitForSelector(".job-tip");
check(`${tag}: focus from the keyboard opens it too`, /内核测试/.test(await page.locator(".job-tip .jt-name").textContent()));
await page.keyboard.press("Escape");
await page.waitForTimeout(150);
check(`${tag}: Escape closes it`, (await page.locator(".job-tip").count()) === 0);
await ctx.close();
}
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
+46
View File
@@ -0,0 +1,46 @@
// The two floating buttons are named for the ends they go to ("back to top", "jump to latest"),
// so one click has to arrive there, whatever expanded blocks lie between. Where a scroller ends up
// is a property of the render, so it is read from the browser.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&ws=2&sess=6&turns=40";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width: 1100, height: 760 } });
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector('[data-pane="flow"]');
const geometry = () => page.locator('[data-pane="flow"]').evaluate((el) => ({ top: Math.round(el.scrollTop), room: Math.round(el.scrollHeight - el.clientHeight - el.scrollTop) }));
await page.locator('[data-pane="flow"]').evaluate((el) => { el.scrollTop = Math.round((el.scrollHeight - el.clientHeight) / 2); });
await page.waitForSelector('.scrolljump button[data-value="up"]');
await page.waitForSelector('.scrolljump button[data-value="down"]');
await page.evaluate(() => document.querySelectorAll("details.tool-disclosure, details.think").forEach((d) => { d.open = true; }));
await page.waitForTimeout(200);
const open = await page.locator("details.tool-disclosure[open], details.think[open]").count();
check("there are expanded blocks between the middle and each end", open >= 2, `${open} expanded blocks`);
check("the conversation is long enough to scroll", (await geometry()).top > 0 && (await geometry()).room > 0);
await page.click('.scrolljump button[data-value="up"]');
await page.waitForTimeout(400);
const atTop = await geometry();
check("one click on the top button reaches the top", atTop.top <= 1, `scrollTop ${atTop.top}`);
await page.locator('[data-pane="flow"]').evaluate((el) => { el.scrollTop = Math.round((el.scrollHeight - el.clientHeight) / 2); });
await page.waitForSelector('.scrolljump button[data-value="down"]');
await page.click('.scrolljump button[data-value="down"]');
await page.waitForTimeout(800);
const atEnd = await geometry();
check("one click on the latest button reaches the end", atEnd.room <= 2, `${atEnd.room}px from the end`);
await page.close();
} finally {
await browser.close();
}
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
+55
View File
@@ -0,0 +1,55 @@
// An allowed guardian review at low risk and a remembered fact are Lines, not cards: one row over a hairline with no box.
// A refusal, or an allow that carried real risk, keeps the card.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1000, height: 900 }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(600);
await page.evaluate(() => {
const f = window.__feed;
f({ kind: "turn_started", authoredTurn: 1, msgIndex: 0, text: "go" });
f({ kind: "tool_dispatch", tool: { id: "rm", name: "remember", args: "{}" } });
f({ kind: "tool_result", tool: { id: "rm", name: "remember", output: "saved", args: JSON.stringify({ name: "n", title: "A fact", description: "why", scope: "project", activation: "always", body: "b" }) } });
f({ kind: "guardian_assessment", guardian: { id: "g1", tool: "bash", subject: "go test", outcome: "allow", risk_level: "low", user_authorization: "high", rationale: "read only", duration_ms: 5 } });
f({ kind: "guardian_assessment", guardian: { id: "g2", tool: "bash", subject: "git push -f", outcome: "allow", risk_level: "high", user_authorization: "low", rationale: "rewrites history", duration_ms: 5 } });
f({ kind: "guardian_assessment", guardian: { id: "g3", tool: "bash", subject: "rm -rf /", outcome: "deny", risk_level: "critical", user_authorization: "unknown", rationale: "no", duration_ms: 5 } });
f({ kind: "turn_done" });
});
await page.waitForTimeout(600);
await page.mouse.move(995, 5);
const m = await page.evaluate(() => {
const rows = [...document.querySelectorAll(".flow .line-row")];
const box = (el) => { const cs = getComputedStyle(el); return [cs.borderTopWidth, cs.borderLeftWidth, cs.borderRightWidth].join(","); };
return {
lines: rows.length,
boxes: rows.map(box),
radius: rows.map((r) => getComputedStyle(r).borderTopLeftRadius),
cards: [...document.querySelectorAll('.flow .call[data-k="host"]')].length,
forget: !!document.querySelector('.flow .line-row [data-action="memory.forget"]'),
oldMem: document.querySelectorAll('.flow .call[data-k="mem"]').length,
};
});
check(`${scheme}: the remembered fact and the low-risk allow are rows`, m.lines === 2, `${m.lines} rows`);
check(`${scheme}: rows carry no box`, m.lines > 0 && m.boxes.every((b) => b === "0px,0px,0px") && m.radius.every((r) => r === "0px"), JSON.stringify(m));
check(`${scheme}: the high-risk allow and the refusal keep their cards`, m.cards === 2, `${m.cards} cards`);
check(`${scheme}: the take-back sits in the row, and no memory card remains`, m.forget && m.oldMem === 0);
await ctx.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
@@ -0,0 +1,60 @@
// A server that answered 401 offers to sign in beside the retry; a server whose
// tools were withheld offers to accept and follow beside the plain approval; a
// followed server says so and offers to stop. None of it may spill at a phone's
// width or crowd the row's other controls.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const shotDir = process.env.SHOTS;
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const width of [1280, 420]) {
const tag = `${scheme} ${width}px`;
const page = await browser.newPage({ viewport: { width, height: 1100 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&turns=2&mcpactions=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForSelector(".prefs-nav button");
await page.evaluate(() => [...document.querySelectorAll(".prefs-nav button")].find((b) => b.textContent.includes("扩展"))?.click());
await page.waitForSelector(".mcp-server");
await page.evaluate(() => document.querySelectorAll("details.mcp-server").forEach((d) => { d.open = true; }));
const r = await page.evaluate(() => {
const row = (name) => [...document.querySelectorAll(".mcp-server")].find((d) => (d.querySelector("summary") ?? d).textContent.includes(name));
const label = (el) => [...el.querySelectorAll("button")].map((b) => b.textContent.trim());
const spill = (el) => { const r = el.getBoundingClientRect(); return [...el.querySelectorAll("button")].filter((b) => b.getBoundingClientRect().right > r.right + 1 || b.getBoundingClientRect().left < r.left - 1).length; };
const figma = row("figma"), notes = row("notes"), wiki = row("wiki");
const overlap = (el) => { const bs = [...el.querySelectorAll("button")].map((b) => b.getBoundingClientRect()).filter((b) => b.width > 0); return bs.some((a, i) => bs.some((c, j) => i < j && a.left < c.right - 1 && c.left < a.right - 1 && a.top < c.bottom - 1 && c.top < a.bottom - 1)); };
return {
figma: figma ? label(figma) : null, notes: notes ? label(notes) : null, wiki: wiki ? label(wiki) : null,
followNote: wiki?.textContent.includes("这个服务器的改动会自动接受") ?? false,
spill: [figma, notes, wiki].filter(Boolean).map(spill),
overlap: [figma, notes, wiki].filter(Boolean).map(overlap),
};
});
check(`${tag}: a 401 row offers sign-in beside the retry`, r.figma?.includes("登录") && r.figma.includes("重连"), r.figma?.join("|"));
check(`${tag}: a row with withheld tools offers both approvals`, r.notes?.includes("批准并重新连接") && r.notes.includes("接受并以后都自动接受这个服务器的改动"), r.notes?.join("|"));
check(`${tag}: a followed row says so and offers to stop`, r.followNote && r.wiki?.includes("取消跟随"), r.wiki?.join("|"));
check(`${tag}: no button spills out of its row`, r.spill.every((n) => n === 0), r.spill.join(","));
check(`${tag}: no two buttons overlap`, r.overlap.every((o) => !o));
if (shotDir && width === 1280) {
await page.addStyleTag({ content: ".cfgbad { display: none !important; }" });
for (const name of ["figma", "notes", "wiki"]) {
const row = page.locator(".mcp-server", { hasText: name }).first();
await row.screenshot({ path: `${shotDir}/${scheme}-${name}.png` });
}
}
await page.close();
}
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
+118
View File
@@ -0,0 +1,118 @@
// Claude Code mods in the window: the band a mod draws above the prompt, a question a mod asks, the settings
// block (switch, time limit, each mod's state by code) and the install preview's full-trust listing.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const shotDir = process.env.SHOTS;
const SHOWN = process.env.MODS_SHOWN === "1";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const band = { kind: "extension_surface", extension: { pluginId: "statusline-clock", surfaceId: "mod-above-prompt", kind: "view", view: { slot: "above_prompt", body: [
{ kind: "row", children: [{ kind: "pip", tone: "ok" }, { kind: "text", value: "statusline-clock", tone: "strong" }, { kind: "text", value: "12:30 · 今天还剩 3 个任务", tone: "dim" }, { kind: "button", label: "稍后提醒", actionId: "snooze:5" }] },
] } } };
const ask = { kind: "extension_surface", extension: { pluginId: "git-guard", surfaceId: "mod-ask", kind: "form", sessionId: "s", generation: 1, form: { title: "git-guard asks", message: "要删除已经合并的分支 old-spike 吗?", fields: [{ key: "answer", label: "回答", kind: "input" }] } } };
// The pane attaches to its stream a moment after the page is up, and an event fed earlier is lost; feed again until it lands.
async function feedUntil(page, ev, seen) {
for (let i = 0; i < 20; i++) {
await page.evaluate((e) => window.__feed(e), ev);
if (await seen().then(() => true, () => false)) return;
}
await seen();
}
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const width of [1280, 420]) {
const tag = `${scheme} ${width}px`;
const page = await browser.newPage({ viewport: { width, height: 1300 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&turns=2`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await feedUntil(page, band, () => page.getByRole("button", { name: "稍后提醒" }).waitFor({ timeout: 500 }));
const at = await page.evaluate(() => {
const s = document.querySelector(".slotted").getBoundingClientRect();
const c = document.querySelector('[aria-label="任务输入"]').getBoundingClientRect();
return { above: s.bottom <= c.top + 4, spill: s.right > innerWidth + 1 || document.documentElement.scrollWidth > innerWidth + 1 };
});
check(`${tag}: the band stands above the text the person types in`, at.above);
check(`${tag}: the band does not push the page sideways`, !at.spill);
await page.getByRole("button", { name: "稍后提醒" }).focus();
check(`${tag}: its button can be reached from the keyboard`, await page.evaluate(() => document.activeElement?.textContent === "稍后提醒"));
const ring = await page.evaluate(() => {
const b = document.activeElement, rail = document.querySelector(".slotrail");
const cs = getComputedStyle(b);
const room = Math.min(b.getBoundingClientRect().left - rail.getBoundingClientRect().left, rail.getBoundingClientRect().right - b.getBoundingClientRect().right);
return { ring: parseFloat(cs.outlineWidth) + Math.max(0, parseFloat(cs.outlineOffset)), room };
});
check(`${tag}: the focus ring of the band's button is not cut off by the strip it sits in`, ring.room >= ring.ring - 0.5, `${ring.room}px room for a ${ring.ring}px ring`);
await page.evaluate(() => document.activeElement?.blur());
if (shotDir) { await page.mouse.move(width - 5, 895); await page.waitForTimeout(300); await page.screenshot({ path: `${shotDir}/${scheme}-${width}-band.png`, clip: { x: 0, y: 760, width, height: 540 } }); }
await feedUntil(page, ask, () => page.waitForSelector('.call[data-k="extension"] .extform', { timeout: 500 }));
const card = await page.evaluate(() => {
const form = document.querySelector(".extform");
return { note: form.querySelector(".why")?.textContent ?? "", tag: document.querySelector('.call[data-k="extension"] .tag')?.textContent ?? "" };
});
check(`${tag}: a mod's question says whose it is and that answering approves nothing`, card.note.includes("git-guard") && card.note.includes("不会批准任何工具调用或权限") && card.tag.includes("git-guard"), card.note);
if (shotDir && width === 1280) await page.locator('.call[data-k="extension"]').last().screenshot({ path: `${shotDir}/${scheme}-ask.png` });
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForSelector(".prefs-nav button");
await page.evaluate(() => [...document.querySelectorAll(".prefs-nav button")].find((b) => b.textContent.trim().startsWith("扩展"))?.click());
await page.waitForSelector('[data-action="extensions.add"]');
if (!SHOWN) {
check(`${tag}: the mod settings block is not drawn while the host is hidden`, (await page.locator("#set-mods").count()) === 0);
await page.locator('input[aria-label="搜索设置"]').fill("Claude Code mod");
await page.waitForTimeout(400);
const found = await page.evaluate(() => [...document.querySelectorAll(".prefs-nav *, .prefs-results *")].some((e) => e.children.length === 0 && /Claude Code mod/.test(e.textContent)));
check(`${tag}: settings search does not lead to it either`, !found);
await page.locator('input[aria-label="搜索设置"]').fill("");
} else {
await page.waitForSelector("#set-mods");
const off = await page.evaluate(() => {
const g = document.getElementById("set-mods");
return { checked: g.querySelector('[role="switch"]').getAttribute("aria-checked"), rows: g.querySelectorAll(".modlist li").length, why: [...g.querySelectorAll(".modlist .ds")].filter((e) => e.textContent.includes("没有打开")).length };
});
check(`${tag}: the switch ships off and every mod says why it is not running`, off.checked === "false" && off.rows === 4 && off.why === 4, `${off.rows} mods, ${off.why} reasons`);
await page.locator('#set-mods [role="switch"]').click();
await page.waitForFunction(() => document.querySelectorAll("#set-mods .modlist li[data-state='running']").length === 1);
const on = await page.evaluate(() => {
const g = document.getElementById("set-mods");
const r = g.getBoundingClientRect();
const states = [...g.querySelectorAll(".modlist li")].map((li) => li.getAttribute("data-state"));
return { states, spill: r.right > innerWidth + 1 || g.scrollWidth > g.clientWidth + 1, marks: [...g.querySelectorAll(".modstate")].every((e) => /^\S+\s+\S+/.test(e.textContent.trim())) };
});
check(`${tag}: each state shows running, disabled, restarting or not running, with a mark as well as a word`, on.states.join() === "running,disabled,restarting,inactive" && on.marks, on.states.join());
check(`${tag}: the block does not spill sideways`, !on.spill);
if (shotDir) await page.locator("#set-mods").screenshot({ path: `${shotDir}/${scheme}-${width}-settings.png` });
}
if (width === 1280) {
await page.locator('[data-action="extensions.add"]').first().click();
const source = page.locator("textarea, input").filter({ hasNot: page.locator("[aria-label]") }).last();
await page.locator('textarea[placeholder*="github.com"], input[placeholder*="github.com"]').first().fill("https://github.com/acme/claude-code mod git-guard");
await page.locator('[data-action="extensions.inspect"]').first().click();
await page.waitForSelector(".modpreview", { timeout: 10000 });
const prev = await page.evaluate(() => {
const m = document.querySelector(".modpreview");
const text = m.textContent;
return { trust: text.includes("完全信任"), static: text.includes("不是保证"), imports: text.includes("看不见"), unserved: text.includes("本应用不会触发的事件"), hash: !!m.querySelector("[title]") };
});
check(`${tag}: the install preview states full trust, that it is a static listing, hidden imports and unserved events`, prev.trust && prev.static && prev.imports && prev.unserved && prev.hash, JSON.stringify(prev));
if (shotDir) await page.locator(".cand").first().screenshot({ path: `${shotDir}/${scheme}-preview.png` });
}
await page.close();
}
}
await browser.close();
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
@@ -0,0 +1,58 @@
// A dialog that declares itself modal keeps the keyboard inside it: Tab from the last control goes back to the first, and
// never reaches the sidebar, the transcript or the composer the sheet is covering.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1280, height: 900 }, colorScheme: scheme });
const page = await ctx.newPage();
page.setDefaultTimeout(8000);
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(600);
const outside = async (selector, presses) => {
const out = [];
for (let i = 0; i < presses; i++) {
await page.keyboard.press("Tab");
const where = await page.evaluate((sel) => {
const el = document.activeElement;
return el && el !== document.body && !el.closest(sel) ? (el.getAttribute("aria-label") || el.textContent || el.tagName).trim().slice(0, 30) : "";
}, selector);
if (where) out.push(where);
}
return out;
};
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForSelector(".prefs-sheet");
await page.waitForTimeout(400);
await page.evaluate(() => [...document.querySelectorAll("button")].find((x) => /备份原文件并修复/.test(x.textContent))?.click());
await page.waitForTimeout(300);
await page.evaluate(() => document.activeElement?.blur());
const settingsOut = await outside(".prefs-sheet", 60);
check(`${scheme}: Tab never leaves the settings sheet`, settingsOut.length === 0, settingsOut.slice(0, 3).join("; "));
await page.keyboard.press("Escape");
await page.waitForTimeout(400);
await page.evaluate(() => document.querySelector('[data-action="workspace.search"]')?.click());
await page.waitForSelector(".palette");
await page.waitForTimeout(300);
const paletteOut = await outside(".palette", 30);
check(`${scheme}: Tab never leaves the command palette`, paletteOut.length === 0, paletteOut.slice(0, 3).join("; "));
await ctx.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
@@ -0,0 +1,59 @@
// The connection form is the widest thing in settings. At phone widths its headings stay on one line, rows that cannot fit
// wrap instead of overlapping, and nothing passes the right edge of the window.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const width of [360, 390, 430]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width, height: 844 }, colorScheme: scheme, reducedMotion: "reduce" });
const page = await ctx.newPage();
page.setDefaultTimeout(8000);
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(600);
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForTimeout(500);
await page.evaluate(() => [...document.querySelectorAll("button")].find((x) => /备份原文件并修复/.test(x.textContent))?.click());
await page.waitForTimeout(400);
await page.evaluate(() => [...document.querySelectorAll('[data-action="settings.section"]')].find((x) => x.textContent.includes("模型服务"))?.click());
await page.waitForSelector(".pdetail", { state: "attached" });
await page.evaluate(() => [...document.querySelectorAll("button,li,a")].find((x) => /myrelay-work/.test(x.textContent) && x.textContent.length < 80)?.click());
await page.waitForSelector(".pdetail .mlhead", { state: "attached" });
const m = await page.evaluate(() => {
const live = (el) => {
const r = el.getBoundingClientRect();
return r.width > 0 && r.height > 0 && getComputedStyle(el).visibility !== "hidden" ? r : null;
};
const head = document.querySelector(".pdetail .mlhead");
const kids = [...head.children].map((el) => [el, live(el)]).filter(([, r]) => r);
const overlaps = [];
for (let i = 0; i < kids.length; i++)
for (let j = i + 1; j < kids.length; j++) {
const a = kids[i][1], b = kids[j][1];
if (Math.min(a.right, b.right) - Math.max(a.left, b.left) > 1 && Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top) > 1) overlaps.push(i + "/" + j);
}
const ttl = head.querySelector(".ttl");
const lineH = parseFloat(getComputedStyle(ttl).lineHeight) || parseFloat(getComputedStyle(ttl).fontSize) * 1.4;
const out = [...document.querySelectorAll(".pdetail *")].filter((el) => live(el) && live(el).right > innerWidth + 1 && !el.closest("[hidden]")).map((el) => String(el.className).split(" ")[0] || el.tagName).slice(0, 4);
return { ttlLines: Math.round(ttl.getBoundingClientRect().height / lineH), overlaps, out, hscroll: document.documentElement.scrollWidth > innerWidth + 1 };
});
check(`${scheme} ${width}px: the model list heading stays on one line`, m.ttlLines === 1, JSON.stringify(m));
check(`${scheme} ${width}px: the model list header wraps instead of overlapping`, m.overlaps.length === 0, m.overlaps.join(", "));
check(`${scheme} ${width}px: nothing in the connection form passes the window edge`, m.out.length === 0 && !m.hscroll, m.out.join(", "));
await ctx.close();
}
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
+32 -7
View File
@@ -43,7 +43,6 @@ const probe = (page) =>
}
return hits;
};
const tabbar = document.querySelector(".tabs");
const bar = document.querySelector(".chrome");
const row = document.querySelector(".compose .row");
const tools = document.querySelector(".compose .turntools");
@@ -54,9 +53,11 @@ const probe = (page) =>
return {
bar: { overlaps: overlaps(bar).concat(overlaps(bar.querySelector(".r"))), outside: outside(bar).concat(outside(bar.querySelector(".r"))) },
row: { overlaps: overlaps(row), outside: outside(row) },
tabs: flatOverlaps([...tabbar.querySelectorAll(".vtabs > .tab, .plan-peek, .sidetoggle")]),
tabsOutside: [...tabbar.querySelectorAll(".vtabs > .tab, .plan-peek, .sidetoggle")].filter((el) => live(el).bottom > tabbar.getBoundingClientRect().bottom + 1).map(name),
viewSwitch: [...bar.querySelectorAll(".view-action")].map((el) => el.getAttribute("data-value")),
sideAsk: (() => { const el = tools.querySelector('[data-action="side.toggle"]'); const r = el && live(el); return r ? { w: r.width, h: r.height } : null; })(),
toolsOverlaps: flatOverlaps([...tools.children]),
toolsOverflow: [...tools.children].filter((el) => live(el) && live(el).right > tools.getBoundingClientRect().right + 1).map(name),
toolsOverlap: flatOverlaps([...tools.querySelectorAll("button")]),
titleShown: t.width,
titleOutsideCrumb: t.width > 0 && (t.left < clip.left - 1 || t.right > clip.right + 1),
crumbWidth: clip.width,
@@ -64,7 +65,7 @@ const probe = (page) =>
};
});
const CONTROLS = [".phone-action", ".find-action", ".theme-toggle", ".top-action"];
const CONTROLS = [".phone-action", ".find-action", ".theme-toggle", ".top-action", ".view-action"];
// Opens the fold when there is one, then presses nothing: asks whether each control is on screen with nothing over it.
async function reachable(page) {
@@ -107,8 +108,30 @@ const browser = await chromium.launch();
check("at every room from 190 to 460 the title keeps its 4em floor", bad.length === 0, bad.join(" "));
await page.close();
}
// A running turn swaps Send for Stop, which is wider; the toolbar must still sit on one line at every column width.
{
const page = await browser.newPage({ viewport: { width: 1280, height: 800 } });
await page.goto(`${BASE}?pref=zh&turns=2`, { waitUntil: "networkidle" });
await page.waitForSelector(".compose");
await page.fill('textarea[role="combobox"]', "hello");
await page.keyboard.press("Enter");
await page.waitForSelector(".btn.stop");
const bad = [];
for (let room = 420; room <= 760; room += 20) {
await page.setViewportSize({ width: room, height: 800 });
await page.waitForTimeout(150);
const lines = await page.evaluate(() => {
const seen = [...document.querySelectorAll(".compose .row button")].filter((el) => el.getBoundingClientRect().width > 0 && el.checkVisibility());
const mids = seen.map((el) => { const r = el.getBoundingClientRect(); return r.top + r.height / 2; }).sort((a, b) => a - b);
return mids.filter((m, i) => i === 0 || m - mids[i - 1] > 6).length;
});
if (lines !== 1) bad.push(`${room}:${lines}`);
}
check("while a turn runs, the composer toolbar stays on one line from 420 to 760", bad.length === 0, bad.join(" "));
await page.close();
}
for (const scheme of ["light", "dark"]) {
for (const [width, zoom] of [[390, 1.8], [390, 1.3], [320, 1.8], [320, 1], [1280, 1]]) {
for (const [width, zoom] of [[390, 1.8], [390, 1.3], [390, 1], [320, 1.8], [320, 1], [1280, 1]]) {
const page = await browser.newPage({ viewport: { width, height: 800 }, colorScheme: scheme, reducedMotion: "reduce" });
page.setDefaultTimeout(8000);
page.on("pageerror", (e) => fails.push("page error: " + e.message));
@@ -120,10 +143,12 @@ for (const scheme of ["light", "dark"]) {
const m = await probe(page);
check(`${tag}: title bar controls do not overlap`, m.bar.overlaps.length === 0, m.bar.overlaps.join(", "));
check(`${tag}: title bar stays inside the window`, m.bar.outside.length === 0, m.bar.outside.join(", "));
check(`${tag}: view tabs and their neighbours do not overlap`, m.tabs.length === 0, m.tabs.join(", "));
check(`${tag}: the tab bar grows to hold a wrapped row`, m.tabsOutside.length === 0, m.tabsOutside.join(", "));
check(`${tag}: the workbench switch is on the bar`, m.viewSwitch.includes("browser"), JSON.stringify(m.viewSwitch));
check(`${tag}: composer row does not overlap`, m.row.overlaps.length === 0, m.row.overlaps.join(", "));
check(`${tag}: the side question icon is drawn in the toolbar`, !!m.sideAsk && m.sideAsk.w > 0 && m.sideAsk.h > 0, JSON.stringify(m.sideAsk));
check(`${tag}: composer toolbar controls do not overlap`, m.toolsOverlaps.length === 0, m.toolsOverlaps.join(", "));
check(`${tag}: composer toolbar controls stay in the toolbar`, m.toolsOverflow.length === 0, m.toolsOverflow.join(", "));
check(`${tag}: composer toolbar buttons do not overlap`, m.toolsOverlap.length === 0, m.toolsOverlap.join(", "));
check(`${tag}: the title keeps its 4em floor inside its own box`, m.crumbWidth >= 48 && !m.titleOutsideCrumb, `crumb ${Math.round(m.crumbWidth)}px`);
if (SHOTS) await page.screenshot({ path: `${SHOTS}/${process.env.NARROW_TAG ?? "shot"}-${scheme}-${width}-z${zoom}.png` });
const hint = await page.evaluate(() => {
@@ -0,0 +1,50 @@
// A host notice is a bar, not a card: one sentence with a glyph, no header strip, no box and no state wash. Severity is
// the glyph's ink, so warn and error differ only there.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1000, height: 760 }, colorScheme: scheme });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(BASE, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForTimeout(600);
await page.evaluate(() => {
window.__feed({ kind: "turn_started", authoredTurn: 1, msgIndex: 0, text: "go" });
for (const level of ["info", "warn", "error"]) window.__feed({ kind: "notice", level, text: `a ${level} notice`, detail: "the diagnostic" });
window.__feed({ kind: "turn_done" });
});
await page.waitForTimeout(500);
await page.mouse.move(990, 10);
const m = await page.evaluate(() => {
const read = (el) => {
const cs = getComputedStyle(el);
const g = el.querySelector(".nb-ic, .nb-dot");
return {
border: [cs.borderTopWidth, cs.borderLeftWidth, cs.borderRightWidth, cs.borderBottomWidth].join(","),
bg: cs.backgroundColor,
header: !!el.querySelector(".hl, .tag"),
glyph: g ? getComputedStyle(g).color : "",
};
};
return [...document.querySelectorAll(".notice-bar")].map(read);
});
check(`${scheme}: three notices drawn as bars`, m.length === 3, `${m.length} found`);
check(`${scheme}: no box, wash or header strip`, m.length > 0 && m.every((x) => x.border === "0px,0px,0px,0px" && (x.bg === "rgba(0, 0, 0, 0)" || x.bg === "transparent") && !x.header), JSON.stringify(m[0] ?? {}));
check(`${scheme}: severity is the glyph ink alone`, m.length === 3 && new Set(m.map((x) => x.glyph)).size === 3, m.map((x) => x.glyph).join(" / "));
await ctx.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nall ok");
@@ -0,0 +1,75 @@
// Tab-switch and sidebar-filter cost with 1/2/4/8 panes that each hold a long transcript. A measurement, not a guard:
// the numbers depend on the machine, so it prints a table instead of failing. CPU=4 emulates a slow laptop.
import { chromium } from "playwright";
const CPU = Number(process.env.CPU ?? 4);
const TURNS = Number(process.env.TURNS ?? 60);
const REPS = Number(process.env.REPS ?? 3);
const b = await chromium.launch();
const rows = [];
const pct = (a, p) => { const s = [...a].sort((x, y) => x - y); return s[Math.min(s.length - 1, Math.floor(s.length * p))]; };
for (const n of [1, 2, 4, 8]) {
const ctx = await b.newContext({ locale: "zh-CN", viewport: { width: 1440, height: 900 } });
const page = await ctx.newPage();
const cdp = await ctx.newCDPSession(page);
await page.goto(`${process.env.PERF_URL ?? "http://localhost:4399/perf.html"}?panes=${n}`, { waitUntil: "networkidle" });
await page.waitForSelector(".app"); await page.waitForTimeout(800);
await page.evaluate(async (k) => {
const frame = () => new Promise((r) => requestAnimationFrame(r));
for (let i = 0; i < k; i++) {
window.__feed({ kind: "turn_started" });
const id = `t${i}`;
window.__feed({ kind: "tool_dispatch", tool: { id, name: "bash", args: JSON.stringify({ command: `go test ./pkg${i}/...` }) } });
window.__feed({ kind: "tool_result", tool: { id, name: "bash", args: JSON.stringify({ command: `go test ./pkg${i}/...` }), output: "ok\n".repeat(20) } });
window.__feed({ kind: "text", text: `第 ${i} 段回答。\n\n- 要点一\n- 要点二\n\n\`\`\`go\nfunc f${i}() {}\n\`\`\`\n` });
window.__feed({ kind: "message" });
window.__feed({ kind: "turn_done" });
if (i % 10 === 9) await frame();
}
await frame();
}, TURNS);
await page.waitForTimeout(800);
if (CPU > 1) await cdp.send("Emulation.setCPUThrottlingRate", { rate: CPU });
await cdp.send("Performance.enable");
const nodes = (await cdp.send("Performance.getMetrics")).metrics.find((m) => m.name === "Nodes")?.value;
// tab switch: click each session row in turn, time until two frames have painted
const switches = [];
const m0 = Object.fromEntries((await cdp.send("Performance.getMetrics")).metrics.map((m) => [m.name, m.value]));
for (let r = 0; r < REPS; r++) {
const count = await page.locator(".sessrow").count();
for (let i = 0; i < count; i++) {
const ms = await page.evaluate(async (i) => {
const el = document.querySelectorAll(".sessrow")[i];
const t0 = performance.now();
el.click();
await new Promise((res) => requestAnimationFrame(() => requestAnimationFrame(res)));
return performance.now() - t0;
}, i);
switches.push(ms);
await page.waitForTimeout(80);
}
}
const m1 = Object.fromEntries((await cdp.send("Performance.getMetrics")).metrics.map((m) => [m.name, m.value]));
const per = (k) => (((m1[k] - m0[k]) * 1000) / switches.length).toFixed(0);
// sidebar: type into the rail find box and measure each keystroke to paint
const keys = [];
const box = page.locator(".wsfind input");
await page.evaluate(() => document.querySelector(".wsfind input")?.focus());
for (const ch of "perf") {
const ms = await page.evaluate(async (ch) => {
const input = document.querySelector(".wsfind input");
const t0 = performance.now();
const set = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value").set;
set.call(input, input.value + ch);
input.dispatchEvent(new Event("input", { bubbles: true }));
await new Promise((res) => requestAnimationFrame(() => requestAnimationFrame(res)));
return performance.now() - t0;
}, ch);
keys.push(ms);
}
rows.push({ N: n, 节点: nodes, "切换 p50": pct(switches, 0.5).toFixed(0), "切换 p95": pct(switches, 0.95).toFixed(0), "切换 max": Math.max(...switches).toFixed(0), "脚本/次": per("ScriptDuration"), "样式/次": per("RecalcStyleDuration"), "布局/次": per("LayoutDuration"), "侧栏筛选 p50": pct(keys, 0.5).toFixed(0), "侧栏筛选 max": Math.max(...keys).toFixed(0) });
await ctx.close();
}
await b.close();
console.log(`CPU 降频 ${CPU}x,每窗格 ${TURNS} 轮历史(含 bash 工具卡),切换 ${REPS} 轮;单位 ms(点击到两帧之后)\n`);
console.table(rows);
@@ -0,0 +1,55 @@
// A session this one has written to carries one small icon for where the
// conversation stands: it has to sit inside its row, leave the title readable,
// say its state to a reader who cannot hover, and not select the row it is on.
import { chromium } from "playwright";
const PAGE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&ws=1&sess=6&peerthreads=1";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const shotDir = process.env.SHOTS;
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const page = await browser.newPage({ viewport: { width: 1280, height: 800 }, locale: "zh-CN", colorScheme: scheme });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(PAGE, { waitUntil: "networkidle" });
await page.waitForSelector(".sessrow");
await page.waitForSelector(".peerthread");
const rows = await page.evaluate(() =>
[...document.querySelectorAll(".sessrow")].map((row) => {
const mark = row.querySelector(".peerthread");
const title = row.querySelector(".sesstitle");
const r = row.getBoundingClientRect();
const m = mark?.getBoundingClientRect();
const t = title?.getBoundingClientRect();
return {
path: row.getAttribute("data-target"),
state: mark?.getAttribute("data-state") ?? null,
label: mark?.getAttribute("aria-label") ?? null,
inside: m ? m.left >= r.left && m.right <= r.right && m.top >= r.top && m.bottom <= r.bottom : null,
clear: m && t ? m.left >= t.right - 1 : null,
size: m ? Math.round(m.width) : null,
};
}),
);
const marked = rows.filter((r) => r.state);
check(`${scheme}: four sessions carry a mark, the rest none`, marked.length === 4 && marked.map((r) => r.state).sort().join() === "declined,replied,waiting,working", marked.map((r) => r.state).join(","));
check(`${scheme}: each mark says its state in words`, marked.every((r) => r.label && r.label.length > 6));
check(`${scheme}: each mark sits inside its row`, marked.every((r) => r.inside));
check(`${scheme}: no mark covers the title`, marked.every((r) => r.clear));
check(`${scheme}: marks are small`, marked.every((r) => r.size >= 14 && r.size <= 22), marked.map((r) => r.size).join(","));
const before = await page.locator('.sessrow[aria-selected="true"]').count();
await page.locator(".peerthread[data-state=\"waiting\"]").first().focus();
check(`${scheme}: a mark takes keyboard focus`, await page.evaluate(() => document.activeElement?.classList.contains("peerthread")));
if (shotDir) await page.locator(".rail").screenshot({ path: `${shotDir}/rail-${scheme}.png` });
void before;
await page.close();
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
@@ -0,0 +1,78 @@
// Session messages are switched on from the settings page, not from a config
// file; a message held for approval can be let through for its project for good,
// and says where that is kept and undone; and a saved switch says when it applies.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const shotDir = process.env.SHOTS;
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const width of [1280, 420]) {
const tag = `${scheme} ${width}px`;
const page = await browser.newPage({ viewport: { width, height: 900 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&turns=2&peers=1&peerset=1&pending=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
await page.waitForSelector(".peerbar");
const held = await page.evaluate(() => {
const bar = document.querySelector(".peerbar");
const btn = [...bar.querySelectorAll("button")].find((b) => b.textContent.includes("记住项目"));
const note = bar.querySelector(".apv-note");
const r = bar.getBoundingClientRect();
const spill = [...bar.querySelectorAll("button, .apv-note")].some((e) => e.getBoundingClientRect().right > r.right + 1);
return { btn: btn?.textContent ?? "", note: note?.textContent ?? "", described: btn?.getAttribute("aria-describedby") === note?.id, spill, scroll: bar.scrollWidth - bar.clientWidth };
});
check(`${tag}: the held message offers to remember its project`, /记住项目「[^」]+」/.test(held.btn), held.btn);
check(`${tag}: it says where the choice is kept and undone`, held.note.includes("设置 → 会话间消息") && held.note.includes("/"), held.note.slice(0, 40));
check(`${tag}: the note is tied to the button`, held.described);
check(`${tag}: nothing in the held bar spills sideways`, !held.spill && held.scroll <= 1, `${held.scroll}px`);
if (shotDir && width === 1280) await page.locator(".compose").screenshot({ path: `${shotDir}/${scheme}-held.png` });
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForSelector(".prefs-nav button");
await page.evaluate(() => [...document.querySelectorAll(".prefs-nav button")].find((b) => b.textContent.includes("工具与权限"))?.click());
await page.waitForSelector('[role="switch"][aria-label="启用会话间消息"]', { timeout: 8000 });
const s = await page.evaluate(() => {
const sw = (n) => document.querySelector(`[role="switch"][aria-label="${n}"]`);
const list = document.querySelector(".peerreleased");
const box = sw("启用会话间消息").closest(".box");
const r = box.getBoundingClientRect();
return {
enabled: sw("启用会话间消息").getAttribute("aria-checked"),
dispatchOff: sw("允许模型把任务交给别的会话").disabled,
released: [...(list?.querySelectorAll("li") ?? [])].map((li) => li.textContent),
revoke: [...(list?.querySelectorAll("button") ?? [])].map((b) => b.getAttribute("aria-label")),
pending: document.body.textContent.includes("下个回合起生效"),
immediate: /立即生效/.test(box.textContent),
path: box.textContent.includes("/Users/you/.reasonix/config.toml"),
spill: box.scrollWidth - box.clientWidth,
within: [...box.querySelectorAll("li, .lrow, .peerhead")].every((e) => e.getBoundingClientRect().right <= r.right + 1),
};
});
check(`${tag}: the switch is on the page`, s.enabled === "true");
check(`${tag}: the hand-off switch is live while messages are on`, s.dispatchOff === false);
check(`${tag}: released projects are listed with a revoke each`, s.released.length === 2 && s.revoke.length === 2 && s.revoke.every((l) => l.startsWith("撤销放行")), s.revoke.join("|"));
check(`${tag}: a saved switch says the next turn, never at once`, s.pending && !s.immediate);
check(`${tag}: the file the switches live in is named`, s.path);
check(`${tag}: nothing spills out of the box`, s.within && s.spill <= 1, `${s.spill}px`);
if (shotDir && width === 1280) {
await page.addStyleTag({ content: ".cfgbad { display: none !important; }" });
await page.setViewportSize({ width, height: 1100 });
await page.waitForTimeout(250);
await page.locator("#set-peers").screenshot({ path: `${shotDir}/${scheme}-settings.png` });
}
await page.close();
}
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
@@ -0,0 +1,37 @@
// Two servers on one host and different ports are two connections, each listed under its own address.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const shotDir = process.env.SHOTS;
const browser = await chromium.launch();
try {
for (const scheme of ["light", "dark"]) {
const ctx = await browser.newContext({ locale: "zh-CN", colorScheme: scheme, viewport: { width: 1400, height: 900 }, reducedMotion: "reduce" });
const page = await ctx.newPage();
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?twoports=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app", { timeout: 20000 });
await page.getByRole("button", { name: "设置", exact: true }).click();
await page.getByText("模型服务", { exact: true }).first().click();
await page.waitForSelector('[data-action-click="provider.select"]');
const text = await page.evaluate(() => [...document.querySelectorAll('[data-action-click="provider.select"]')].map((b) => b.textContent ?? ""));
check(`${scheme}: the server on port 8756 is listed`, text.some((t) => t.includes("127.0.0.1:8756")), text.join(" | "));
check(`${scheme}: the server on port 8788 is listed beside it`, text.some((t) => t.includes("127.0.0.1:8788")), text.join(" | "));
await page.waitForTimeout(900);
if (shotDir) await page.screenshot({ path: `${shotDir}/${scheme}-ports.png` });
await ctx.close();
}
} finally {
await browser.close();
}
if (fails.length) {
console.log(`\n${fails.length} failed:\n ` + fails.join("\n "));
process.exit(1);
}
console.log("\nall passed");
@@ -0,0 +1,64 @@
// The rail's search box stays open while it holds a query: pressing a result takes focus off the box, and a
// box that folds away on blur moves the list up under the pointer, so the first press never became a click.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const shotDir = process.env.SHOTS;
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
const page = await browser.newPage({ viewport: { width: 1280, height: 900 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&turns=2&search=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
const state = () => page.evaluate(() => {
const box = document.querySelector(".wsfind");
const cs = getComputedStyle(box);
return { shown: cs.opacity === "1" && cs.position === "relative", top: Math.round(box.getBoundingClientRect().top) };
});
await page.getByRole("searchbox").fill("轮换");
await page.waitForSelector(".content-matches li");
const hit = page.locator(".content-matches li button[data-action='session.open-match']").first();
const before = await hit.boundingBox();
if (shotDir) await page.screenshot({ path: `${shotDir}/${scheme}-typed.png`, clip: { x: 0, y: 0, width: 420, height: 520 } });
await page.evaluate(() => {
window.__events = [];
for (const ev of ["mousedown", "mouseup", "click"]) {
window.addEventListener(ev, (e) => window.__events.push(`${ev} ${e.target.tagName}[${e.target.closest?.("[data-action]")?.getAttribute("data-action") ?? ""}]`), true);
}
});
await page.mouse.move(before.x + 20, before.y + before.height - 8);
await page.mouse.down();
await page.waitForTimeout(200);
const held = await state();
const moved = (await hit.boundingBox()).y - before.y;
if (shotDir) await page.screenshot({ path: `${shotDir}/${scheme}-pressed.png`, clip: { x: 0, y: 0, width: 420, height: 520 } });
await page.mouse.up();
await page.waitForTimeout(200);
const events = await page.evaluate(() => window.__events);
check(`${scheme}: the search box stays open after focus leaves it, because it holds a query`, held.shown);
check(`${scheme}: pressing a result does not move the list under the pointer`, Math.abs(moved) < 1, `${moved}px`);
check(`${scheme}: the first press on a result becomes a click on that result`, events.some((e) => e.startsWith("click ") && e.endsWith("[session.open-match]")), events.join(" | "));
await page.getByRole("searchbox").fill("");
await page.keyboard.press("Tab");
await page.mouse.click(700, 500);
await page.waitForTimeout(250);
const idle = await state();
check(`${scheme}: with no query the box still folds away when it loses focus`, !idle.shown);
await page.close();
}
await browser.close();
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
+3 -2
View File
@@ -59,9 +59,10 @@ for (const [ws, sess] of SHAPES) {
const after = Object.fromEntries((await cdp.send("Performance.getMetrics")).metrics.map((m) => [m.name, m.value]));
// 展开一个折叠的工作区,量这一下点击有多久才落地。
const twist = page.locator(".wsnode").nth(1).locator("button.twist");
const project = page.locator(".wsnode > .wsrow").nth(1);
if (await project.getAttribute("aria-expanded") === "true") await project.click();
const tExpand = Date.now();
await twist.click();
await project.click();
await page.waitForTimeout(50);
await page.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r))));
const expand = Date.now() - tExpand;
@@ -1,33 +0,0 @@
import assert from "node:assert/strict";
import { chromium } from "playwright";
// The small magnifier beside the session filters opens the rail's find box and
// closes it again: a second press must not reopen it.
const base = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const browser = await chromium.launch();
try {
for (const theme of ["light", "dark"]) {
const page = await browser.newPage({ viewport: { width: 1280, height: 800 }, colorScheme: theme, reducedMotion: "reduce" });
const errors = [];
page.on("pageerror", (error) => errors.push(error.message));
await page.goto(`${base}?pref=zh`, { waitUntil: "networkidle" });
await page.waitForSelector(".studio-filter-search");
const shown = () => page.evaluate(() => Number(getComputedStyle(document.querySelector(".rail .wsfind")).opacity) > 0.5);
const press = () => page.locator(".studio-filter-search").click();
assert.equal(await shown(), false, `${theme}: the find box starts hidden`);
await press();
await page.waitForTimeout(250);
assert.equal(await shown(), true, `${theme}: the first press shows the find box`);
await press();
await page.waitForTimeout(250);
assert.equal(await shown(), false, `${theme}: a second press on the magnifier must hide the find box, not show it again`);
await press();
await page.waitForTimeout(250);
assert.equal(await shown(), true, `${theme}: the third press shows it again`);
assert.deepEqual(errors, []);
await page.close();
}
console.log("ok search-toggle");
} finally {
await browser.close();
}
@@ -0,0 +1,51 @@
// A conversation can be moved to another project from its menu: the dialog says what travels and what does not,
// lists the other projects, and asks the kernel exactly once for the one chosen.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const shotDir = process.env.SHOTS;
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const width of [1280, 420]) {
const tag = `${scheme} ${width}px`;
const page = await browser.newPage({ viewport: { width, height: 900 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&ws=3&sess=3&turns=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
const rows = '.sessrow[role="treeitem"][data-target]';
await page.waitForSelector(rows);
const first = await page.locator(rows).first().getAttribute("data-target");
await page.evaluate((sel) => document.querySelector(sel).dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: 140, clientY: 300 })), rows);
await page.getByRole("menuitem", { name: "移动到项目…" }).click();
await page.waitForSelector('[role="dialog"] select');
const dlg = await page.evaluate(() => {
const d = document.querySelector('[role="dialog"]:has(select)');
const card = d.querySelector(".pickcard").getBoundingClientRect();
return { options: [...d.querySelectorAll("option")].map((o) => o.textContent), text: d.textContent, fits: card.left >= 0 && card.right <= innerWidth + 1 && card.bottom <= innerHeight + 1, focusIn: d.contains(document.activeElement) };
});
check(`${tag}: it lists the other projects but not the one it is in`, dlg.options.length === 2 && !dlg.options.some((o) => o.startsWith("workspace-0")), dlg.options.join(" | "));
check(`${tag}: it says what travels and what does not`, dlg.text.includes("原项目的权限与目标设置不会跟着走") && dlg.text.includes("路径保持原样"));
check(`${tag}: the dialog fits the window and holds focus`, dlg.fits && dlg.focusIn, JSON.stringify({ fits: dlg.fits, focusIn: dlg.focusIn }));
if (shotDir) await page.mouse.move(width - 3, 895), await page.waitForTimeout(250), await page.screenshot({ path: `${shotDir}/${scheme}-${width}-dialog.png` });
await page.locator('[role="dialog"] select').selectOption({ index: 1 });
await page.getByRole("button", { name: "移动", exact: true }).click();
await page.waitForFunction(() => (window.__moves ?? []).length === 1);
const moves = await page.evaluate(() => window.__moves);
check(`${tag}: the kernel is asked once, for this conversation and the chosen project`, moves.length === 1 && moves[0].path === first && moves[0].target.endsWith("workspace-2"), JSON.stringify(moves));
await page.waitForFunction(() => !document.querySelector('[role="dialog"]:has(select)'));
check(`${tag}: the dialog closes when it is done`, true);
await page.close();
}
}
await browser.close();
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
@@ -0,0 +1,60 @@
// A conversation can be moved one place up or down in its project's list from its menu or with Alt+Arrow,
// the new order is the kernel's (it is read again, not patched), and the menu says where a step has nowhere to go.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const shotDir = process.env.SHOTS;
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const width of [1280]) {
const tag = `${scheme} ${width}px`;
const page = await browser.newPage({ viewport: { width, height: 900 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&ws=1&sess=4&turns=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
const rows = '.wsnode:has(> .wsrow[data-target="~/projects/workspace-0"]) .sessrow[role="treeitem"][data-target]';
const remoteRows = '.sessrow-remote[role="treeitem"][data-target]';
const order = () => page.evaluate((sel) => [...document.querySelectorAll(sel)].map((e) => e.getAttribute("data-target")?.replace(/.*\/|\.jsonl/g, "")), rows);
await page.waitForSelector(rows);
const start = await order();
const remoteOrder = () => page.locator(remoteRows).evaluateAll((els) => els.map((el) => el.dataset.target));
const remoteStart = await remoteOrder();
check(`${tag}: SSH conversations share the list`, remoteStart.length > 0, remoteStart.join());
check(`${tag}: the project lists its four conversations`, start.length === 4, start.join());
const first = page.locator(rows).first();
await first.click({ button: "right" });
const menu = await page.evaluate(() => {
const items = [...document.querySelectorAll('[role="menuitem"][data-action="session.move"]')];
return { labels: items.map((b) => b.textContent.trim()), disabled: items.map((b) => b.disabled) };
});
check(`${tag}: the first conversation can only go down`, menu.labels.join() === "上移,下移" && menu.disabled.join() === "true,false", JSON.stringify(menu));
if (shotDir) await page.locator(".session-pop").screenshot({ path: `${shotDir}/${scheme}-menu.png` });
await page.locator('[data-action="session.move"][data-value="1"]').click();
await page.waitForFunction(([sel, s]) => [...document.querySelectorAll(sel)].map((e) => e.getAttribute("data-target")?.replace(/.*\/|\.jsonl/g, "")).join() !== s, [rows, start.join()]);
const moved = await order();
check(`${tag}: moving it down puts it second, the rest keep their order`, moved.join() === [start[1], start[0], start[2], start[3]].join(), moved.join());
await page.locator(rows).nth(1).focus();
await page.keyboard.press("Alt+ArrowUp");
await page.waitForFunction(([sel, s]) => [...document.querySelectorAll(sel)].map((e) => e.getAttribute("data-target")?.replace(/.*\/|\.jsonl/g, "")).join() === s, [rows, start.join()]);
check(`${tag}: Alt+Up on the focused row puts it back first`, (await order()).join() === start.join());
check(`${tag}: sorting local conversations preserves the SSH rows`, JSON.stringify(await remoteOrder()) === JSON.stringify(remoteStart));
check(`${tag}: sorting keeps focus on the moved row`, await page.locator(rows).first().evaluate((el) => el === document.activeElement));
await page.mouse.move(width - 3, 895);
if (shotDir) await page.locator(".rail").screenshot({ path: `${shotDir}/${scheme}-rail.png` });
await page.close();
}
}
await browser.close();
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
+104
View File
@@ -0,0 +1,104 @@
// A past conversation is referenced from the message box: "#" lists this
// workspace's conversations, a pick becomes a removable chip, a search hit in
// the rail can be referenced too, and the size limit is a real control.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
const shotDir = process.env.SHOTS;
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const width of [1280, 420]) {
const tag = `${scheme} ${width}px`;
const page = await browser.newPage({ viewport: { width, height: 900 }, locale: "zh-CN", colorScheme: scheme, reducedMotion: "reduce" });
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=zh&turns=2&search=1`, { waitUntil: "networkidle" });
await page.waitForSelector(".app");
const box = page.getByRole("combobox", { name: "任务输入" });
await box.click();
await box.pressSequentially("接着上次的讨论 #");
await page.waitForSelector(".slashmenu .mi");
const menu = await page.evaluate(() => {
const m = document.querySelector(".slashmenu");
const r = m.getBoundingClientRect();
const rows = [...m.querySelectorAll(".mi")];
return {
rows: rows.length,
kinds: [...new Set(rows.map((x) => x.querySelector(".rt")?.textContent))],
spill: r.left < -1 || r.right > innerWidth + 1,
hints: rows.every((x) => !!x.querySelector(".ds")),
};
});
check(`${tag}: # lists past conversations marked as conversations`, menu.rows >= 2 && menu.kinds.length === 1 && menu.kinds[0] === "会话", `${menu.rows} rows ${menu.kinds}`);
check(`${tag}: each row says when it was`, menu.hints);
check(`${tag}: the menu stays on screen`, !menu.spill);
if (shotDir && width === 1280) {
const area = await page.evaluate(() => {
const a = document.querySelector(".compose").getBoundingClientRect(), m = document.querySelector(".slashmenu").getBoundingClientRect();
const x = Math.min(a.left, m.left), y = Math.min(a.top, m.top);
return { x, y, width: Math.max(a.right, m.right) - x, height: Math.max(a.bottom, m.bottom) - y };
});
await page.screenshot({ path: `${shotDir}/${scheme}-menu.png`, clip: area });
}
await page.keyboard.press("Enter");
await page.waitForSelector(".shots .shot");
const chip = await page.evaluate(() => {
const c = document.querySelector(".shots .shot");
const ta = document.querySelector('[aria-label="任务输入"]');
const r = c.getBoundingClientRect();
return { title: c.querySelector(".nm")?.textContent, sub: c.querySelector(".sz")?.textContent, text: ta.value, spill: r.right > innerWidth + 1, remove: !!c.querySelector(".x") };
});
check(`${tag}: picking one makes a chip titled with it and takes the # word out of the box`, !!chip.title && chip.text === "接着上次的讨论 " && chip.sub === "历史会话 · 只读资料", `${chip.title} | "${chip.text}"`);
check(`${tag}: the chip can be removed and does not spill`, chip.remove && !chip.spill);
if (shotDir && width === 1280) await page.locator(".compose").screenshot({ path: `${shotDir}/${scheme}-chip.png` });
if (width === 1280) {
await page.getByRole("searchbox").fill("轮换");
await page.waitForSelector(".content-matches li", { timeout: 8000 });
const hit = await page.evaluate(() => {
const li = document.querySelector(".content-matches li");
const [open, ref] = li.querySelectorAll("button");
const o = open.getBoundingClientRect(), r = ref.getBoundingClientRect();
return { has: !!ref, size: Math.round(r.width) + "x" + Math.round(r.height), label: ref?.getAttribute("aria-label") ?? "", beside: r.left >= o.right - 1 && Math.abs(r.top - o.top) < 2, tall: r.height >= 28 };
});
check(`${tag}: a search hit offers to reference it, beside the open button`, hit.has && hit.beside && /引用「.+」到输入框/.test(hit.label), `${hit.size} ${hit.label}`);
check(`${tag}: that button is at least 28px tall`, hit.tall, hit.size);
if (shotDir) await page.locator(".content-matches").screenshot({ path: `${shotDir}/${scheme}-hit.png` });
const refButton = page.locator(".content-matches li button[data-action='session.reference-match']").first();
await refButton.focus();
await page.waitForTimeout(200);
const refBox = await refButton.boundingBox();
await page.mouse.click(refBox.x + refBox.width / 2, refBox.y + refBox.height / 2);
await page.waitForFunction(() => document.querySelectorAll(".shots .shot").length === 2);
check(`${tag}: referencing a hit adds a second chip to the message box`, true);
}
await page.evaluate(() => document.querySelector('[data-action="chrome.settings"]')?.click());
await page.waitForSelector(".prefs-nav button");
await page.evaluate(() => [...document.querySelectorAll(".prefs-nav button")].find((b) => b.textContent.trim().startsWith("会话"))?.click());
await page.waitForSelector("#set-session-ref", { timeout: 8000 });
const s = await page.evaluate(() => {
const g = document.getElementById("set-session-ref");
const input = g.querySelector("input");
const r = g.getBoundingClientRect();
return { value: input?.value, unit: g.querySelector("i")?.textContent, restore: g.querySelector('[data-action="session-ref.reset"]')?.disabled, spill: r.right > innerWidth + 1 || g.scrollWidth > g.clientWidth + 1 };
});
check(`${tag}: the size limit is a number field at its default, with nothing to restore`, s.value === "8000" && s.unit === "token" && s.restore === true, `${s.value} ${s.unit}`);
check(`${tag}: the setting does not spill sideways`, !s.spill);
if (shotDir) await page.locator("#set-session-ref").screenshot({ path: `${shotDir}/${scheme}-${width}-setting.png` });
await page.close();
}
}
await browser.close();
if (fails.length) {
console.error(`\n${fails.length} failed: ${fails.join("; ")}`);
process.exit(1);
}
console.log("\nall passed");
Loaded 100 of 2220 files, more files were not shown because too many files have changed in this diff. Show more