Compare commits

..
Author SHA1 Message Date
YHH 2ed678a37c Merge pull request #12242 from esengine/docs/studio-2.30.0-notes
docs(release): Studio 2.30.0 notes
2026-10-06 17:58:50 -07:00
yhh 0107a78275 docs(release): Studio 2.30.0 notes 2026-10-06 17:51:00 -07:00
YHH cc0206dd25 Merge pull request #12241 from esengine/fix/mcp-prompt-failure-attribution
fix(control): attribute a failed MCP prompt fetch and tell the model about it
2026-10-06 15:40:03 -07:00
yhh 47aff7d34f fix(control): attribute a failed MCP prompt fetch and tell the model about it
A prompts/get failure surfaced as the bare transport error, and the model
never learned the user had invoked a prompt. MCPPrompt now returns a typed
MCPPromptError (prompt, server, stage; matches ErrMCPPromptFetch) and owes
the model a turn-tail block describing the failed invocation.
2026-10-06 15:26:39 -07:00
YHH 43a9069b46 Merge pull request #12233 from esengine/feat/session-unread-ui
feat(studio): mark sessions that finished unseen in the sidebar and tabs
2026-10-06 10:19:04 -07:00
esengine 18465053 72d8d622dd feat(studio): mark sessions that finished unseen in the sidebar and tabs
Draw the kernel's typed `unread` on session rows (dot, bold title, spoken
name), as a count pill on folded project rows and as a dot on pane tabs.
A session is marked viewed through the pane's own endpoint when it
becomes the pane in front, when an unread row or pane is clicked, and
when a turn ends in the pane in front while the window has focus. The
mark is cleared optimistically and restored if the call is refused.

Refs #12230
2026-10-06 10:10:12 -07:00
YHH dd92486b5e Merge pull request #12239 from esengine/fix/attachment-refusal-codes
fix(attachments): say why an attachment was refused, with a code per class
2026-10-06 10:06:31 -07:00
yhh 431daf03c4 fix(attachments): say why an attachment was refused, with a code per class
/attachments refused with plain text, so the composer could only show
"Could not add" and left the reason in a tooltip. Refusals now carry
attachment.unsupported_image, too_large, empty, unreadable and write_failed
with params, the port keeps the code, the catalogues say each in both
languages, and the failed chip shows the reason with Retry.
2026-10-06 09:55:16 -07:00
YHH 7b653ddd84 Merge pull request #12237 from esengine/perf/background-panes-stream-rate
perf(studio): stop panes behind another from redrawing at stream rate
2026-10-06 09:52:31 -07:00
esengine 3f2a2760f4 perf(studio): stop panes behind another from redrawing at stream rate
Panes that are not on screen kept re-rendering on every streamed delta, and
each of those renders also rebuilt the reply actions handed to every settled
row. With nine sessions streaming the renderer's main thread saturated and
queued work (status reads, stop, settings) starved.

A hidden pane now takes the first token of each stream at once and coalesces
the rest into one batch per second; any other event flushes first and bringing
the pane forward flushes immediately. Reveal pacing, the thinking clock and the
wait clock only run for a pane that is shown. The reply actions keep their
identity while a streamed answer grows, and the folded thought's length is no
longer recounted per delta.

Refs #12232
2026-10-06 09:43:15 -07:00
YHH 42b1d2742a Merge pull request #12234 from esengine/fix/session-viewed-torn-sidecar
fix(session): let a view wait out a sidecar caught mid-replace
2026-10-06 09:32:41 -07:00
esengine 89a00b8310 fix(session): let a view wait out a sidecar caught mid-replace
MarkSessionViewed pre-checked the session sidecar with a plain unlocked
read. Concurrent views replace the sidecar, so on Windows that read can
meet it mid-replace (access denied, or torn JSON after the replace
fallback) and the view failed with a 500 instead of waiting it out. The
pre-check now uses the tear-tolerant read the other sidecar readers use.

Refs #12230
2026-10-06 09:21:16 -07:00
YHH 7f30fcbdb3 Merge pull request #12231 from esengine/feat/session-unread-kernel
feat(session): persist a finished-but-unviewed mark per session
2026-10-06 08:53:07 -07:00
YHH 7e6a90e954 Merge pull request #12216 from esengine/feat/compaction-progress-record
feat(agent): re-project finished work at the request tail once a fold is installed
2026-10-06 08:51:10 -07:00
YHH 95d0f747a8 Merge pull request #12229 from esengine/fix/remote-serve-attach-12228
fix(remote): attach to a running serve instead of replacing it
2026-10-06 08:41:19 -07:00
esengine 39fbadf232 feat(session): persist a finished-but-unviewed mark per session
The kernel now records two optional facts in the session sidecar,
finished_at (stamped when a turn ends) and viewed_at (stamped when the
person opens the session). A session is unread iff finished_at is after
viewed_at; the sidebar tree and GET /sessions carry it as a typed
`unread` boolean. A turn the person cancelled is stamped as viewed.

Controller.MarkSessionViewed (POST /sessions/viewed) writes only the
session sidecar and takes no workspace or transcript lease. Sidecars
without the fields read as seen.

Refs #12230
2026-10-06 08:40:09 -07:00
esengine 444a38cdd9 feat(agent): re-project finished work at the request tail once a fold is installed
A fold leaves the model with a digest, and the host re-projected only the
step ids of plan-seeded unfinished lists. A task list the model wrote itself
(no ids), a list with every item complete, the files changed and the checks
that passed all survived only as digest prose, which a weaker model reads as
work not yet done and repeats.

While a fold is installed the request now ends with one derived "Host
progress record": the canonical task list with statuses when no todo_write is
left in view, the files changed in the folded prefix, and the verification
commands whose latest outcome was a pass (marked when a file changed after
them). It is derived from tool receipts, bounded (30 files, 15 checks, with
the omitted count), memoised on the covered-prefix fingerprint, and ends with
the fold. Sessions that never folded carry nothing extra.
2026-10-06 08:37:36 -07:00
YHH 021685bc90 Merge pull request #12224 from xxoingr/fix/perf-tooltip-attach-lookup
test(studio): the tooltip guard measures the attach button in every language
2026-10-06 08:26:30 -07:00
YHH 2e0354050c fix(remote): attach to a running serve instead of replacing it
A live serve with no record is attached and recorded, launch no longer
deletes the port/pid files another serve published, and a live serve
whose provider source differs fails the connect with a coded error
instead of being terminated. Document what desktop exit does to the
remote runtime.
2026-10-06 08:25:55 -07:00
YHH e7d8dea94f Merge pull request #12217 from xxoingr/fix/tui-menu-ctrl-pn
fix(tui): Ctrl+N and Ctrl+P move through the completion menu and resume picker
2026-10-06 08:05:18 -07:00
YHH cb934974a6 Merge pull request #12220 from esengine/fix/feedback-veil-no-backdrop-blur
fix(desktop): drop the feedback veil's backdrop blur so an open dialog does not pin the GPU
2026-10-06 07:51:18 -07:00
YHH e41e54e173 Merge pull request #12223 from xxoingr/fix/tui-ctrl-l-cls
fix(tui): Ctrl+L clears the screen like /cls
2026-10-06 07:46:20 -07:00
YHH e85f182fc8 Merge pull request #12222 from esengine/fix/compaction-trigger-reads-provider-usage
fix(compaction): let the provider's last reported prompt size trigger a fold when the local estimate runs low
2026-10-06 07:43:10 -07:00
YHH 4c2ac96604 Merge pull request #12213 from xxoingr/fix/bgjob-failure-tool-error
fix(tools): reading a background job that failed is a failed call
2026-10-06 07:39:33 -07:00
xxoingr 8c48421711 test(studio): the tooltip guard measures the attach button in every language
perf/tooltip.mjs looked the attach button up by its aria-label in each
language, and the English label it searched for, "Add attachment", is not
the shipped one ("Add an attachment"). The lookup found nothing and the loop
skipped on, so the four English attach combinations were never measured and
the guard stayed green.

Controls are now found by structure, data-action for refine and the attach
class for attach, and a control that cannot be found fails the guard rather
than being skipped. All 24 combinations (light/dark x zh/en x two widths x
three cases) are measured: 96 checks, where 80 ran before.

Refs #12156
2026-10-06 22:31:57 +08:00
yhh 04420cca07 fix(desktop): drop the feedback veil's backdrop blur so an open dialog does not pin the GPU
The veil blurred the whole window behind it, which the compositor redoes every frame while anything beneath animates. A flat, more opaque scrim dims the same way for free.
2026-10-06 07:31:38 -07:00
xxoingr de2b1d6240 fix(tui): Ctrl+L clears the screen like /cls
GUIDE.md lists "Ctrl+L or /cls" as clearing only the visible transcript, and
1.x bound the key, but the 2.x terminal UI left Ctrl+L unbound. It now runs
the same clearDisplay as /cls: the conversation, session and the kernel's
task list stay, and a running turn is refused the same way. Being a key
rather than a typed command, it leaves a half-typed draft in the composer.

Refs #12144
2026-10-06 22:28:01 +08:00
esengine d62e4bc71b fix(compaction): let the provider's last reported prompt size trigger a fold when the local estimate runs low
The fold trigger compared only a local estimate against the threshold. That
estimate is characters times one tokens-per-character ratio, and the ratio is
not learned from requests that carry images or provider-side tool results, so a
session with screenshots can sit well under the real size and defer the fold.

The trigger now takes the larger of the local estimate and the provider's
reported prompt_tokens (cached tokens included) for the last request plus the
local estimate of what the visible view gained since. The anchor is dropped when
a fold changes the projection, when the transcript is swapped, and when the
usage is estimated, aggregated over retries, or padded by provider-run tools.
The hard ceiling and the overflow paths still read the local estimate alone, so
a provider count that no fold can lower never ends a turn.
2026-10-06 07:26:33 -07:00
xxoingr b4564e5f8d fix(tui): Ctrl+N and Ctrl+P move through the completion menu and resume picker
The slash and @ completion menu and the /resume picker moved only with the
arrow keys, while 1.x also took Ctrl+N / Ctrl+P there and GUIDE.md and
CLI.md list both for these lists. The provider and quick pickers already
bind them. Both lists now take Ctrl+N as Down and Ctrl+P as Up; neither is
text, so a picker's filter is untouched.

Refs #12144
2026-10-06 22:20:27 +08:00
YHH aa0d80f798 Merge pull request #12212 from xxoingr/fix/probe-refusal-redacted
fix(serve): probe refusals keep the code and leave the endpoint's echo behind
2026-10-06 07:03:50 -07:00
YHH 89df335f78 Merge pull request #12210 from esengine/feat/market-browse-cache
feat(market): serve the last good browse answer, marked, when the registry is unreachable
2026-10-06 06:58:13 -07:00
xxoingr da7ec275f6 fix(tools): reading a background job that failed is a failed call
bash_output and wait reported a background job that later failed or timed
out only in their text, with no tool error. The activity panel and the
failure count read the host-set error, so a job that failed after it started
never turned red and was not counted, while the model was told it failed.

Both tools now return errJobFailed, naming the failed jobs, whenever a job
they report ended as failed (a background command's non-zero exit and its
timeout both end that way). The output is returned alongside, so the model
still reads it under the error line. A job that finished, was killed, was
interrupted or is still running is not a failure and the call stays clean.

Fixes #12201
2026-10-06 21:57:09 +08:00
esengine 98ba2b7e4e feat(market): serve the last good browse answer, marked, when the registry is unreachable 2026-10-06 06:39:03 -07:00
YHH 9d4a2bd6d3 Merge pull request #12209 from esengine/feat/phone-browser-tabs
feat(studio): show the agent's browser tabs read-only on the phone web client
2026-10-06 06:36:24 -07:00
xxoingr a83f6c0229 fix(serve): probe refusals keep the code and leave the endpoint's echo behind
POST /providers/probe built its refusal message from probe.Error(), which
carries the model-list response body verbatim. That body can echo the
request, and this route receives the key typed into the add-provider draft,
so a 401 that quoted the key sent it back in the refusal. A failure that was
not a ProbeError came back as an untyped 502 with the error's text.

The message now carries the probe reason and only what endpointDetail lets
through (one bounded printable line, the draft key and credential-shaped
text redacted), the same treatment /providers/check gives its detail. A
failure without a probe identity is a kernel fault and refuses as 500
provider.probe.failed without its text.

Fixes #12188
2026-10-06 21:34:30 +08:00
esengine 8decb83466 feat(studio): show the agent's browser tabs read-only on shells that cannot draw them
A phone using the web client got an empty Workbench when the agent opened a
page: useBrowserTabs returned early because the web host draws no native
views, so the tab list was never read. Read it on every host and, where the
page cannot be drawn, show its title and address as plain text with no
controls.
2026-10-06 06:27:22 -07:00
YHH e13eb30dbc Merge pull request #12206 from KHG420/codex/studio-extension-transcript-restore
fix(studio): retain extension cards during history recovery
2026-10-06 06:09:18 -07:00
xiexian ae7fb0c1f5 fix(studio): retain extension cards during history recovery 2026-10-06 20:50:34 +08:00
YHH 7ac14f94af Merge pull request #12194 from KHG420/codex/studio-idle-extension-prompt
fix(studio): restore idle status after questions
2026-10-06 05:35:29 -07:00
YHH ed7dbd54e4 Merge pull request #12205 from KHG420/codex/studio-failed-switch-sidecar-rollback
fix(studio): restore sidecars after model selection fails
2026-10-06 05:33:05 -07:00
YHH 7f2365b4a0 Merge pull request #12202 from esengine/feat/provider-sticky-footer
feat(desktop): sticky Save bar with a phase dot on the provider form (RFC #12040 S1, 2b-2)
2026-10-06 05:22:28 -07:00
yhh 7fa84ab3cc feat(desktop): keep the provider form's Save bar and state at the bottom of the panel
The save area sat at the end of a long form, so its state was out of sight
exactly when it mattered. The bar is now sticky, shared by the edit and add
forms, and holds the failure or not-applied reason beside a single persistent
status line with a dot for each phase (clean, unsaved, saving, saved, saved but
not applied, save refused). Ctrl/Cmd+S saves a pending draft.
2026-10-06 05:13:07 -07:00
YHH c434fc423f Merge pull request #12199 from esengine/feat/skill-paths-listing-3
feat(skill): show a paths-gated skill only after a matching file is touched (3/4 for #11352)
2026-10-06 05:08:50 -07:00
xiexian 285b537f96 fix(studio): restore sidecars after model selection fails 2026-10-06 19:55:52 +08:00
esengine 69cfaefdcc feat(skill): show a paths-gated skill to the model only after a matching file is touched
A skill that declares paths: is held out of the per-turn listing, the
capability catalog, the slash_command listing and the unknown-name hint until
the session has touched a file its globs match. The set of touched files is
owned by the skill store; eligibility is memoised against it and dropped when
it changes, and the next turn after a match owes the listing again. The user's
/<name> and run_skill by exact name are not gated.
2026-10-06 04:43:43 -07:00
YHH 38c1519373 Merge pull request #12198 from esengine/fix/background-start-not-a-failure
fix(desktop): stop drawing a background start as a failed shell call
2026-10-06 04:37:00 -07:00
esengine 66723cc065 fix(desktop): stop drawing a background start as a failed shell call
The shell card and the activity group decided failure a second time from
execution.state and exitCode, so state background_started (no error, no exit
code) rendered a red BACKGROUND_STARTED badge and counted as one failure.
The host already classifies every call once: err is set for failed,
timed-out, cancelled and refused calls. Read only that.
2026-10-06 04:24:06 -07:00
YHH 36e059b7f2 Merge pull request #12196 from esengine/feat/provider-test-enabled-models
feat(desktop): Test enabled models button with a running summary (RFC #12040 S1, 2b-1)
2026-10-06 04:15:49 -07:00
YHH 5d4f4f0259 Merge pull request #12195 from esengine/feat/skill-paths-feed-2
feat(skill): record the files completed tool calls touched (2/4 for #11352)
2026-10-06 04:09:57 -07:00
yhh 34ea5a5d78 feat(desktop): test every enabled model at once from the provider edit form
Verifying a model was one click per row, and the form blocked while any one
ran. The model header gets a Test enabled models button that runs the existing
per-model check over the ticked rows, two at a time, and stops as soon as the
draft changes or the form is left. The summary line counts rows still being
verified, and the per-row live regions are dropped so a run is announced once
through the summary.
2026-10-06 04:08:34 -07:00
esengine 23eec9f92e feat(skill): record the files completed tool calls touched for paths eligibility
The agent tells a PathObserver which workspace files a completed call named,
through the ReadTargeter and WritePathResolver capabilities its tool already
declares; failed, refused and hook-blocked calls feed nothing and sub-agents
are not observed. Swapping the conversation rebuilds the set from the
transcript. skillSet wires its PathHits in; the catalog does not read it yet.
2026-10-06 04:00:42 -07:00
YHH 2a412969b0 Merge pull request #12158 from KHG420/codex/studio-offline-sdk-handoff
docs(sdk): verify starter extension with the offline provider
2026-10-06 03:50:10 -07:00
YHH 4669be38c6 Merge pull request #12105 from chuiwenwei/test/studio-corpus-guard-three
test(e2ebench): hold fanout-width, upstream-edge and project-check to the authoring guard
2026-10-06 03:47:53 -07:00
YHH 9a6936ceb7 Merge pull request #12193 from esengine/feat/provider-results-near-buttons
feat(desktop): provider test results next to their buttons, with a summary line (RFC #12040 S1, 2a)
2026-10-06 03:46:03 -07:00
yhh 26e2eba5ea feat(desktop): show provider test results next to their buttons with a one-line summary
A failed catalogue refresh surfaced under the form's footer and a silent
refresh that found nothing looked like a click that missed. The add form's
connection failure also rendered below its save button.

Refresh failures and outcomes (including 'no new models') now render under the
model header, verified rows are summed up in one status line over the ticked
models, and the add form's connection failure sits under the button that ran
it. Results clear when the address or key they depend on changes.
2026-10-06 03:34:05 -07:00
xiexian 4024c63a43 fix(studio): restore idle status after questions 2026-10-06 18:25:33 +08:00
YHH 722ceb4017 Merge pull request #12162 from KHG420/codex/studio-publication-version-guidance
fix(studio): describe publication version auto-increment limits
2026-10-06 03:09:15 -07:00
YHH fa194e4f91 Merge pull request #12133 from KHG420/codex/studio-memory-history
fix(studio): refresh memory history after writes
2026-10-06 03:06:52 -07:00
YHH 647d7670ba Merge pull request #12192 from esengine/feat/skill-paths-frontmatter-1
feat(skill): parse paths frontmatter and track the files a session touched (1/4 for #11352)
2026-10-06 03:05:45 -07:00
YHH bd12c75dfa Merge pull request #12191 from esengine/feat/provider-leave-guard
feat(desktop): ask before switching service or adding discards unsaved provider edits (RFC #12040 S1, 1.5/3)
2026-10-06 03:03:50 -07:00
esengine 40e8ee8050 feat(skill): parse paths frontmatter and track the files a session touched
Skills may declare file globs in a paths: key. The registry now parses them
(rejecting negation, parent traversal and malformed globs into InvalidPaths,
which doctor reports) and a PathHits set records workspace files the host saw
touched, resolving symlinks so nothing outside the workspace counts. The set
is owned by skillSet; the catalog does not read it yet.
2026-10-06 02:54:26 -07:00
YHH f80741bbd5 Merge pull request #12190 from KHG420/codex/studio-auth-bootstrap-asset-reload
fix(studio): reload protected assets after fragment authentication
2026-10-06 02:53:04 -07:00
yhh 7f43425005 feat(desktop): ask before a provider switch or Add discards unsaved edits
Leaving the edit form for another service, the Add form, another service's
rename, or a protocol switch dropped pending edits without a word.

EditConn reports the pending state it already computes; Providers holds it
and routes every way out of the form through one guard that asks to keep
editing or discard. A save in flight is not interrupted and not asked about,
and the question closes by itself once nothing is pending.
2026-10-06 02:46:35 -07:00
YHH c050ffc1d4 Merge pull request #12155 from KHG420/codex/studio-package-remove-reload-result
fix(studio): settle runtime feedback after package removal
2026-10-06 02:44:56 -07:00
YHH 5fcdd4f970 Merge pull request #12097 from KHG420/codex/studio-skill-namespace-guide
docs(studio): clarify skill frontmatter namespaces
2026-10-06 02:40:11 -07:00
YHH cc24f23cda Merge pull request #12071 from KHG420/codex/studio-copy-fallback-focus
fix(studio): preserve focus after legacy clipboard copy
2026-10-06 02:37:25 -07:00
YHH 97e6bb3dc1 Merge pull request #12121 from KHG420/codex/studio-mcp-example-argument-schema
fix(studio): enforce the MCP example argument schema
2026-10-06 02:35:15 -07:00
xiexian c81f424100 fix(studio): reload protected assets after fragment authentication 2026-10-06 17:32:07 +08:00
YHH 9106bbe805 Merge pull request #12189 from esengine/feat/provider-form-dirty-revert
feat(desktop): unsaved-changes indicator, Revert and a Saved receipt on the provider edit form (RFC #12040 S1, 1/3)
2026-10-06 02:11:55 -07:00
yhh a9a726b921 feat(desktop): show unsaved changes, Revert and a Saved receipt on the provider edit form
The edit form had no way to tell pending edits from stored ones: Save was
always enabled, Cancel was a remount in disguise, and a successful save
silently turned into the same form with nothing said.

Pending state is the fingerprint of what a save would send, compared with the
one taken at mount, so typing a value back or toggling a row off and on is
clean again. Save is disabled when clean, Cancel becomes Revert, and the footer
says whether there are unsaved changes, no changes, or that the save landed
once the list has been re-read.
2026-10-06 02:01:50 -07:00
YHH 15cefe039e Merge pull request #12187 from KHG420/codex/studio-extension-panel-progress-name
fix(studio): name standing extension panel progress
2026-10-06 01:26:06 -07:00
YHH a6eb4e1742 Merge pull request #12185 from esengine/feat/provider-check-typed-failure
feat(providers): report why a whole-connection check failed as a typed finding
2026-10-06 01:25:14 -07:00
YHH de66ad3240 Merge pull request #12186 from xxoingr/fix/refine-tip-described
fix(studio): the prompt-refine button is described by its tooltip
2026-10-06 01:16:37 -07:00
xiexian ba338a2d6b fix(studio): name standing extension panel progress 2026-10-06 16:16:34 +08:00
esengine bfcbf2a8ff feat(providers): report why a whole-connection check failed as a typed finding
Cause: POST /providers/check returned a free-text `error` assembled from the
probe error's message. The probe already knows whether a key was refused, a
path is missing, nothing listed chat models or the deadline expired, but that
identity was flattened into prose on the way out, so the settings page could
only print the sentence (which also echoed the endpoint body unredacted), and
the refresh button invented its own literal error when a check came back empty.

Blast radius: /providers/check on failure now answers 200 with
`{ok:false, code, params?, httpStatus?, detail?}` and no `error`. `code` is the
dotted identity the add flow's refusals already use (provider.probe.*), plus a
new provider.probe.timeout split out of unreachable; `params` carries only the
numeric facts the sentence needs; `detail` is the endpoint's own text through
the same redaction the model check uses. Success responses are unchanged.
catalog.ProbeError gains Status and Body, read from the typed fetch error, and
the status/code table is shared by the refusal and the finding.

Neighbouring behaviours tested: refused, forbidden, payment, rate limit, missing
path, upstream error, no chat models, unreachable, timeout, success, key
redaction in the endpoint text, bounded one-line detail, missing grant,
unknown name, and the add flow's probe codes all translated.

Why this layer: the probe owns the class; serve only projects it; the page
maps the code to words.
2026-10-06 01:14:03 -07:00
xxoingr 80e8a1a82f fix(studio): the prompt-refine button is described by its tooltip
The refine button's tooltip carried the Ctrl+Shift+E shortcut, but nothing
pointed the button at it: it had no aria-describedby and the tooltip had no
id, so a screen reader announced only "Optimize prompt" and the keyboard
route stayed undiscoverable. The attach button beside it already describes
itself this way.

The tooltip now takes an id from useId and the button names it in
aria-describedby, matching the attach button.

Refs #12156
2026-10-06 16:04:44 +08:00
YHH 0afafb7a46 Merge pull request #12184 from KHG420/codex/studio-backup-delete-lifetime
fix(studio): hold backup deletions until receipts settle
2026-10-06 01:02:39 -07:00
xiexian e3e2ea39dd fix(studio): hold backup deletions until receipts settle 2026-10-06 15:50:22 +08:00
YHH 444ca4fa45 Merge pull request #12179 from esengine/feat/chart-desktop-renderer
feat(desktop): draw render_chart calls as inline SVG charts in the transcript
2026-10-06 00:41:01 -07:00
YHH 5fbb16f2d6 Merge pull request #12183 from KHG420/codex/studio-backup-restore-draft
fix(studio): hold restore choices while awaiting receipts
2026-10-06 00:36:59 -07:00
YHH 6ee31dedd0 Merge pull request #12180 from KHG420/codex/studio-backup-create-draft
fix(studio): hold backup drafts while creating
2026-10-06 00:36:28 -07:00
YHH defebb51b2 Merge pull request #12175 from KHG420/codex/studio-add-provider-save-draft
fix(studio): hold provider additions while saving
2026-10-06 00:29:00 -07:00
YHH 0427ff16f8 Merge pull request #12174 from KHG420/codex/studio-provider-save-draft
fix(studio): hold provider drafts while saving
2026-10-06 00:27:56 -07:00
yhh 8f5701324e feat(desktop): draw render_chart calls as inline SVG charts in the transcript
A settled render_chart call (direct or through use_capability) is re-validated
on the page, lifted out of the folded execution group, and drawn as a bar,
line or pie chart from the validated spec by our own React SVG components in
a lazy chunk. A running, refused or invalid call keeps the ordinary tool card.
The same card is rebuilt on reload from the stored call. Each chart offers an
accessible data table, keyboard-reachable points and no entrance motion.
2026-10-06 00:25:02 -07:00
YHH 0333c008a9 Merge pull request #12181 from esengine/feat/chart-tui-text
feat(tui): show a render_chart call as an aligned data table
2026-10-06 00:19:30 -07:00
yhh f2631f18fc feat(tui): show a render_chart call as an aligned data table
A settled chart call (direct or through use_capability) now draws its title,
marks and rows as a capped, width-fitted table in the terminal, with numbers
right-aligned and the fold key opening the rest, instead of a line count.
chartspec.FromCall and Spec.Table/Describe are the single projection; the TUI
history record and frame merge now keep the resolved tool name, without which
neither a reopened session nor a live call could be told from any other
use_capability call.
2026-10-06 00:08:07 -07:00
xiexian b924372004 fix(studio): hold restore choices while awaiting receipts 2026-10-06 15:01:06 +08:00
xiexian e2b02ed555 fix(studio): hold backup drafts while creating 2026-10-06 14:47:46 +08:00
YHH 65aef1e228 Merge pull request #12177 from esengine/fix/provider-save-remount-from-fresh-list
fix(providers): remount the editor only after the list has been re-read
2026-10-05 23:36:17 -07:00
YHH 03ac4a5197 Merge pull request #12178 from KHG420/codex/studio-backup-empty-selection
fix(studio): preserve empty backup selections on reload
2026-10-05 23:32:50 -07:00
xiexian d4af1d6527 fix(studio): preserve empty backup selections on reload 2026-10-06 14:23:34 +08:00
YHH 8156f643fc fix(providers): remount the editor only after the list has been re-read
A successful save remounted the editor synchronously while the list reload
was still in flight, so the new editor was seeded from the stale entry and
showed the pre-save values. onEdited now returns the reload, the editor
waits for it before remounting, and save keeps the form busy until then.
2026-10-05 23:19:30 -07:00
xiexian d194492f30 fix(studio): hold provider drafts while saving 2026-10-06 14:15:14 +08:00
YHH fd93411f81 Merge pull request #12169 from KHG420/codex/studio-market-vote-account-state
fix(studio): refresh market votes when account changes
2026-10-05 23:12:10 -07:00
YHH 49affe9889 Merge pull request #12163 from KHG420/codex/studio-package-hook-row-identity
fix(studio): replace colliding package hook rows
2026-10-05 23:10:08 -07:00
YHH 9aa9756b46 Merge pull request #12170 from KHG420/codex/studio-provider-probe-endpoint-state
fix(studio): discard probe findings after endpoint edits
2026-10-05 23:07:55 -07:00
YHH e17c91e44f Merge pull request #12167 from KHG420/codex/studio-provider-check-manual-proxy
fix(studio): honor draft proxy bypass during model checks
2026-10-05 23:07:20 -07:00
xiexian 93f408bfd9 fix(studio): hold provider additions while saving 2026-10-06 13:47:42 +08:00
xiexian a08a5b60a7 fix(studio): discard probe findings after endpoint edits 2026-10-06 12:31:59 +08:00
xiexian 099c1faa52 fix(studio): refresh market votes when account changes 2026-10-06 12:12:19 +08:00
xiexian a9e7e22636 fix(studio): honor draft proxy bypass during model checks 2026-10-06 11:52:39 +08:00
YHH 9ce1b8ba5e Merge pull request #12160 from esengine/docs/studio-2.29.0-notes
docs(release): Studio 2.29.0 notes
2026-10-05 20:49:58 -07:00
yhh 4c296c9320 docs(release): Studio 2.29.0 notes 2026-10-05 20:41:26 -07:00
YHH a45ff5a771 Merge pull request #12157 from esengine/fix/steer-into-paused-queue
fix(control): hold a mid-turn message as a follow-up when the queue is paused
2026-10-05 20:34:33 -07:00
xiexian 74b5580b83 fix(studio): replace colliding package hook rows 2026-10-06 11:33:20 +08:00
xiexian a4c97196ff fix(studio): describe publication version auto-increment limits 2026-10-06 11:15:05 +08:00
esengine 0e026c95f0 fix(control): hold a mid-turn message as a follow-up when the queue is paused
A steer sent while a stop had paused the queue was refused with inbox.paused
but its queued copy stayed behind, so retries piled up and all ran on resume.
Hold the item as a follow-up under the admission lock and answer with the
queued receipt that already carries paused=true. The pause itself is kept,
and send-now from the queue panel still refuses. The composer reads the
receipt, from the steer path and from an idle skill send, and says the queue
is paused, once, in the notice strip.

Part of #12153
2026-10-05 20:14:07 -07:00
YHH 1c85e79cc6 Merge pull request #12154 from esengine/fix/plan-gate-cancel
fix(control): return the plan to planning when a stop cancels the approval card
2026-10-05 20:03:47 -07:00
xiexian 3a47847772 docs(sdk): verify starter extension with the offline provider 2026-10-06 10:39:44 +08:00
YHH 6b1e18db89 Merge pull request #12152 from esengine/fix/control-tooltip-wrap-and-fade
fix(studio): composer control tooltips wrap inside their box and no longer fade when the host is disabled
2026-10-05 19:34:41 -07:00
xiexian d2a7e55585 fix(studio): settle runtime feedback after package removal 2026-10-06 10:25:50 +08:00
esengine 972f0212fa fix(control): return the plan to planning when a stop cancels the approval card
Stopping a turn while the plan approval card is open left the plan in
AwaitingApproval with no card to answer it. Later messages then ran under
the planning barrier and no new card could open. Treat a cancelled or timed
out approval as a revise so the workflow can propose again.

Part of #12153
2026-10-05 19:23:59 -07:00
yhh 5561753a6d fix(studio): composer control tooltips wrap inside their box and no longer fade when the host is disabled
The refine and attach tooltips are children of their buttons. They inherited
the button's white-space: nowrap, so the hint spilled past the 220px box in
both locales, and the disabled refine button dimmed itself to 35% opacity,
which multiplied down onto the tooltip that explains the control.

The shared .studio-control-tip now wraps inside its max-width, and a disabled
host dims its glyph instead of itself.

Part of #12148
2026-10-05 19:17:14 -07:00
YHH cf1a147bcb Merge pull request #12150 from esengine/fix/subagent-model-saved-while-running
fix(settings): keep a role saved while busy and say it is not applied yet
2026-10-05 19:16:27 -07:00
esengine c4736c747c fix(settings): keep a role saved while the conversation is busy and say it is not applied yet
Cause: the settings page awaited setRole and only then re-read /roles. While a
turn, a question or a background job is active the kernel has already written
the value and answers 409 runtime.saved_while_running; run() treated that as a
failure, the re-read never ran, and the controlled select snapped back to
"follow the main model" although config.toml held the saved model. The banner
also called it "操作未完成".

Fix: the role row always re-reads /roles (promise finally), and the page's one
failure banner now distinguishes saved-but-not-applied (SAVED_NOT_APPLIED, the
set the provider edit form already uses) from a real failure, with the same
title, warn colour and status role.

Blast radius: Settings.tsx only. Every action routed through run() now shows
"已保存,尚未生效" instead of "操作未完成" when the kernel answers one of the
SAVED_NOT_APPLIED codes; other failures render as before. No kernel change.

Neighbouring behaviours tested: role saved while idle, role saved while busy
(value and notice), real refusal (alert, no saved notice), other role rows and
a reopened page after a busy save, default-model row refused while busy (stays
on the kernel's default; the kernel refuses before writing, so it is not the
same defect). Go: POST /roles mid-turn returns 409 runtime.saved_while_running
and GET /roles returns the saved value.

Why this layer: the page owns the re-read and the banner; the code identity
already comes from the kernel and the shared SAVED_NOT_APPLIED list.
2026-10-05 19:06:33 -07:00
YHH d1c534c8d6 Merge pull request #12146 from esengine/fix/cli-quit-ctrlc-tab-parity
fix(tui): restore 1.x /quit, second Ctrl+C while stopping, and Tab accept
2026-10-05 18:57:55 -07:00
YHH 10c6aade5f Merge pull request #12140 from esengine/fix/browser-open-failure-visible
fix(workbench): show why a browser tab could not open
2026-10-05 18:55:02 -07:00
YHH 01edf16dbc Merge pull request #12145 from esengine/fix/scratch-owned-temp-dirs
fix(jobs): reclaim temp roots abandoned by killed kernels via a lock-owned scratch dir
2026-10-05 18:51:36 -07:00
yhh ce66ba8742 fix(tui): restore 1.x /quit, second Ctrl+C while stopping, and Tab accept
Part of #12144.

Cause
- `/quit` and `/exit` are in the slash catalogue but the TUI had no handler,
  so since #11969 they were sent to the model as ordinary messages.
- Every Ctrl+C on a running turn re-sent cancel, so a turn that would not
  stop could not be left, while the footer says "Ctrl+C exits".
- Tab in the completion menu moved the highlight down (and did nothing
  visible with one item); the guides say Tab / Enter accept.

Blast radius
- internal/frontend/tui: send(), menuKey, the Ctrl+C branches of onKey and
  viKey, one new Options field. internal/frontend/cli passes the quit names
  from the slash registry. docs/GUIDE.md and GUIDE.zh-CN.md rows for Ctrl+C,
  Ctrl+D and /quit. No controller, wire or config change. The bare words
  exit, quit and :q stay ordinary prompts.
- Tab history: the cycling was part of the first completion commit
  (5ff9d7a0f) with no stated reason and no test; nothing later touched it.

Neighbouring behaviours tested
- Idle double Ctrl+C, Ctrl+D (idle and while running), double Esc opens
  rewind, a second Esc does not quit, Esc then Ctrl+C quits, one cancel call
  per first Ctrl+C, vi mode Ctrl+C, a finished cancelled turn needs two
  presses again, Up/Down still move the menu, Enter accepts, Tab accepts
  the highlighted row, file-mention directory descends, Tab without a menu
  still asks the kernel, /quit while a turn runs is not queued.

Why this layer
- Quitting is a frontend lifecycle action with no controller verb, so it
  lives in the TUI local-command switch beside /mouse; the names come from
  the registry through Options rather than a second alias list. Both
  interrupt paths share one helper so Esc and Ctrl+C agree on what
  "stopping" means. The unreachable shift+tab case in menuKey is removed.
2026-10-05 18:48:26 -07:00
yhh 731bc29ca5 fix(workbench): show why a browser tab could not open
When the kernel refuses browser.open, the workbench stored the reason in
`failed` but only drew it inside the file-tab branch. Opening the column
or pressing + with no page left the pane on its empty state, "choose a
file on the right, or open a browser", with no error.

Cause: `failed` was rendered only when the active surface is a file, while
the browser open paths (column opening with no agent tab, the + button)
also write it. The kernel also answered every failure with the generic
browser.open_failed, whose wording needs an {error} param it never sent,
so the typed engine_missing / engine_failed / profile_busy causes were
lost. Separately, `.workbench-error` used --danger, a token no stylesheet
defines, so such errors drew in the body colour.

Blast radius: WorkbenchPanel, one CSS declaration, serve's browser open
refusal and the kernel.ts / en_kernel.ts tables. The alert renders for any
non-file surface; file tabs keep their own copy and are unchanged.
`failed` is cleared when a tab is picked and when the active tab closes.
POST /browser/open now answers browser.engine_missing, browser.engine_failed
or browser.profile_busy for those causes (same 400, same params, plus the
detail in params.error) and browser.open_failed for the rest. The colour
fix also recolours the file-tab and explorer errors.

Neighbouring behaviours tested: the three codes and the generic one through
the real SsePort decoding path, on both open paths, asserting the exact
text and no leftover placeholder; the reason clearing on picking a file
and on a later successful open; a file read error staying single on its
tab and going away with it; serve end to end with real launch failures;
the refusal-code parity test; the whole WorkbenchPanel suite and tsc.

Why this layer: the pane owns the state and the draw; the kernel boundary
in serve is where the typed cause becomes a code, and internal/platform/
browser is not touched.

Fixes #12139
2026-10-05 18:42:59 -07:00
yhh 90de42bf12 fix(jobs): reclaim temp roots abandoned by killed kernels via a lock-owned scratch dir
Add internal/base/scratch: a temp directory claimed by a long-lived
exclusive .owner.lock (internal/base/filelock). Remove releases the lock
first and retries sharing violations for up to 2 s. Sweep/SweepOnce remove
only non-symlink directories past a one-minute grace whose lock can be
taken, so a live owner is never touched. The jobs manager now creates its
reasonix-jobs-* fallback root through it, which also sweeps roots left by
earlier killed kernels.

Part of #12142
2026-10-05 18:41:45 -07:00
YHH bc55e83c39 Merge pull request #12096 from KHG420/codex/studio-mcp-cached-inventory-notice
fix(studio): mark cached MCP tools without descriptions
2026-10-05 18:26:42 -07:00
YHH 7ee3a554c4 Merge pull request #12094 from KHG420/codex/studio-localized-settings-search
fix(studio): search settings by localized labels
2026-10-05 18:19:37 -07:00
YHH f1bae78d39 Merge pull request #12113 from xxoingr/fix/tui-resume-index
fix(tui): /resume <n> continues the nth saved session in place
2026-10-05 17:37:25 -07:00
YHH f0e735084a Merge pull request #12131 from KHG420/codex/studio-memory-connection
fix(studio): scope memory panels to their connection
2026-10-05 17:08:59 -07:00
YHH e9108c3133 Merge pull request #12127 from KHG420/codex/studio-backup-connection
fix(studio): scope backup forms to connection
2026-10-05 16:54:12 -07:00
YHH a91c2632d5 Merge pull request #12134 from esengine/docs/drop-open-pr-cap
docs(contributing): drop the open-PR cap
2026-10-05 15:33:08 -07:00
yhh 6afdcb47a0 docs(contributing): drop the open-PR cap
Contributors may keep any number of pull requests open. The policy keeps one suggestion for series of related changes.
2026-10-05 15:25:16 -07:00
YHH fa978db05e Merge pull request #12132 from esengine/docs/contributing-pr-policy
docs(contributing): open-PR cap, issue-first for features, AI-assist note
2026-10-05 15:18:42 -07:00
xiexian 57e6222d98 fix(studio): refresh memory history after writes 2026-10-06 06:13:43 +08:00
yhh 462a47f240 docs(contributing): open-PR cap, issue-first for features, AI-assist note 2026-10-05 15:09:23 -07:00
xiexian eca93427cc fix(studio): scope memory panels to their connection 2026-10-06 05:49:27 +08:00
xiexian 7f3b72967d fix(studio): scope backup forms to connection 2026-10-06 04:26:31 +08:00
xiexian d5c963523d fix(studio): enforce the MCP example argument schema 2026-10-06 01:47:42 +08:00
xxoingr 34c84f7a73 fix(tui): /resume <n> continues the nth saved session in place
In 1.x, "/resume <n>" switches straight to the nth saved session. The Studio
TUI ignored the number and always opened the picker, the known gap left in
the CLI migration tracking issue.

An indexed /resume now resolves the session by its row in the same list the
picker numbers and resumes it, with the same refusals the picker gives: a
running turn, the session already open, or an index outside the list. A bare
/resume (or a non-numeric argument) still opens the picker.

The index lookup shared by /takeover <n> and /rename <n> <title> moves into
one helper so the three commands cannot drift apart.

Refs #11493
2026-10-06 00:35:42 +08:00
Will 48365b2ecb test(e2ebench): hold fanout-width, upstream-edge and project-check to the authoring guard
The reference-solution half covered only the e2e, train and verification-stress
corpora, so three committed corpora with the same tasks/ layout carried no
evidence that any attempt can score: a grader that can never pass is
indistinguishable from a task with no solution, and a corpus of those teaches
that nothing is ever accepted.

Their pristine seeds already fail, checked across all eleven tasks, so this adds
the reference solutions the guard needs: one ANSWER.md each for the three fleet
tasks, and the non-positive-skipping calc.py the eight project-check graders
assert. The e2e suite stays the single declared exception, named in the skip.

Refs #11852.
2026-10-05 22:42:25 +08:00
YHH 198f60e6b4 Merge pull request #12101 from esengine/fix/side-models-effort-fallback
fix(boot): side models retry on the lowest effort when an endpoint refuses "disabled"
2026-10-05 07:36:50 -07:00
yhh 4396615092 fix(boot): side models retry on the lowest effort when an endpoint refuses "disabled"
Prompt refine and commit-message drafting built their provider with effort forced to "disabled". Generic OpenAI-compatible endpoints refuse that at construction, so the side model was nil and the user saw "no usable model" while chat worked. sideProvider retries only on provider.ErrEffortRefused, with the lowest effort the entry's vocabulary lists (automatic depth when it lists none); other construction errors are not retried and are logged at warn.
2026-10-05 07:22:55 -07:00
xiexian 61c1e6cb68 docs(studio): clarify skill frontmatter namespaces 2026-10-05 20:53:20 +08:00
xiexian 8175a143f1 fix(studio): mark cached MCP tools without descriptions 2026-10-05 20:30:46 +08:00
xiexian 57ec3c2245 fix(studio): search settings by localized labels 2026-10-05 19:51:57 +08:00
YHH 064405a2a7 Merge pull request #12082 from esengine/fix/compaction-failure-visible-and-bounded
fix(compaction): a failed summary's retry hold gives way before the window
2026-10-05 02:10:37 -07:00
YHH aba9fe6134 Merge pull request #12076 from esengine/fix/sidebar-select-immediately
fix(studio): select a session row on the click instead of after the kernel answers
2026-10-05 02:02:38 -07:00
YHH ea7721b15f Merge pull request #12079 from esengine/fix/status-no-config-load
perf(serve): answer /status model facts from the build, not a config load
2026-10-05 01:55:07 -07:00
YHH 31725ae561 Merge pull request #12077 from esengine/fix/catalog-frontmatter-only
perf(skill): leave references and scripts unread when listing skills
2026-10-05 01:53:56 -07:00
yhh 985853ac03 fix(compaction): a failed summary's retry hold gives way before the window, and a code-less overflow refusal is recovered
A transient summary failure held the retry until the input grew by an
eighth of the trigger. Recorded near 105% of the trigger that release
point is the window itself, so the next request went out uncompacted.
The step is now capped at half of the room left below the hard ceiling,
so the hold always lifts before it.

A relay that refuses an oversized request with a 400 and no error code
was not recognised as an overflow, so recovery never ran. A 400 or 413
whose request our own estimate puts over the window now takes the same
fold-and-replay path, judged by status and size, never by wording.
2026-10-05 01:47:19 -07:00
esengine 1e17d7f5c7 fix(studio): select a session row on the click instead of after the kernel answers
A session row was selected only once POST /runtimes (or /resume), GET /runtimes
and GET /tree had all returned, so every switch to a session without a pane
waited out the kernel's pane assembly with nothing but a dimmed row to show for it.

The window now owns which session is being opened (useSessionSwitch). The row
reads selected and busy from that state as soon as it is clicked, the active
pane shows aria-busy, a ticket orders concurrent opens so the last click wins
and a refusal from a superseded open changes nothing, and a failed open drops
the selection back to the pane that is still in front while the error is shown.
Opening moves out of App into useOpenPane so every caller shares the one path.

The pane burst after an open now asks for /runtimes and /tree through one
single-flight read instead of one per caller.
2026-10-05 01:40:40 -07:00
yhh 1a18ad9e0e perf(serve): answer /status model facts from the build, not a config load
/status called config.Load() on every poll, which re-parses every
installed plugin package under a process-wide lock. The controller now
carries the model entry boot resolved and /status reads effort, vision
and the model ref from it. The provider label still comes from the user
file because a rename rebuilds nothing.

Refs #12055
2026-10-05 01:39:45 -07:00
yhh 3cb8c26bd7 perf(skill): leave references and scripts unread when listing skills
Discovery read every directory-layout skill's references/ and scripts/
to build a Body that a catalog never uses, so opening a pane cost
O(bytes in the skill library). Listing now keeps only SKILL.md; Read,
ReadSlash, Prepare and the capability digest complete the skill when it
is invoked or inspected.

Refs #12055
2026-10-05 01:34:53 -07:00
YHH b9bc20a6cb Merge pull request #12036 from esengine/fix/summary-idle-bound
fix(compaction): bound the summary request by lack of progress, not total time
2026-10-05 01:22:30 -07:00
yhh 84688a91d8 fix(compaction): bound the summary request by lack of progress, not total time
A summary request was cut off at a fixed 90 s of wall time, so a local model
that was still streaming steadily failed every /compress with summary_timeout.
Bound the silence between streamed chunks instead (6 minutes, one minute past
the providers' own 300 s stream idle watchdog), and add a 30 minute overall
ceiling with its own typed code summary_ceiling so a trickling model cannot
hold the turn. Both failures stay transient: a later attempt may retry once
the input has grown. The notices state which bound fired and its length.
2026-10-05 01:13:31 -07:00
YHH 8511f820e9 Merge pull request #12074 from esengine/fix/skills-list-single-config-load
fix(serve): list skills with one configuration read instead of one per skill
2026-10-05 01:00:48 -07:00
esengine 9a6df69e00 fix(serve): list skills with one configuration read instead of one per skill
GET /skills resolved each skill's activation through Controller.SkillEnabled,
and every call re-ran config.Load(), which walks all installed plugin
packages. Resolve activation once per request via Controller.SkillActivation.

Refs #12055, #12051
2026-10-05 00:51:24 -07:00
xiexian 67f0b7b9f5 fix(studio): preserve focus after legacy clipboard copy 2026-10-05 15:16:01 +08:00
YHH 63df856224 Merge pull request #12064 from esengine/fix/outbound-user-agent
fix(net): send a non-Go User-Agent on catalog, relay and worker requests
2026-10-04 23:35:06 -07:00
yhh f96b3677c2 fix(net): send a non-Go User-Agent on catalog, relay and worker requests
Go's default User-Agent is answered with 403 by edge bot protection on
datacenter networks. Catalog and manifest reads now use the Studio update
identity shared with artifact downloads, the relay websocket handshake uses
the account client's identity, and feedback, telemetry, crash and account
requests fall back to the shared client identity when none is set.
2026-10-04 23:24:43 -07:00
YHH f154bd95e5 Merge pull request #12056 from esengine/fix/status-poll-never-stacks
fix(studio): status reads never stack, decision submits are bounded
2026-10-04 22:55:15 -07:00
yhh 5edd8ac898 fix(studio): status reads never stack, decision submits are bounded
The pane polled /status every 250ms with no in-flight guard. When the kernel
answered in 13-16s the unanswered reads filled the browser's per-origin
connection pool and the approve, plan-decision and answer POSTs queued behind
them.

Idempotent reads now share one request per path with a single trailing
re-read, the pane schedules its next poll when the previous read settles, and
decision submits get a bounded wait that fails with a typed KernelBusyError.
2026-10-04 22:48:03 -07:00
YHH ad5191854f Merge pull request #12050 from esengine/fix/retry-line-explains-itself
fix(retry): say why a request is retried, what it waits for, and expose idle_timeout_seconds
2026-10-04 22:42:30 -07:00
esengine 04007d942f fix(retry): say why a model request is retried, what it waits for, and expose idle_timeout_seconds
The retry status line showed "connection broke before the response headers"
for every retried failure, including 502/429 statuses, did not say what the
attempt was waiting for or when it counts as unanswered, and its seconds
counter ran from the first notice of the whole stall instead of per attempt.

The retrying event now carries a typed failure class (connection_closed,
timeout, upstream_status with the HTTP status, stream_idle, upstream_error),
the backoff before the next attempt, and the header wait of the coming
attempt. The producers set them: SendWithRetry knows the class, the adapters
pass their idle_timeout_seconds window, and the stream replay path maps the
stream-interrupt reason. The window words each class and phase (backoff
countdown, then a wait that restarts per attempt) from those fields, never
from text. The CLI machine record carries the same fields.

Provider settings gain one advanced row for idle_timeout_seconds (1..32767,
empty is the default), validated in the form and by the kernel's provider
edit endpoint.

Fixes #12046
2026-10-04 22:19:08 -07:00
YHH c701436015 Merge pull request #11991 from keeyangyy/pr/remote-host-switches
feat(remote): per-host switches to stop dialing a machine and to keep it out of the rail
2026-10-04 21:55:40 -07:00
keeyang 0d69ac0f95 feat(remote): per-host switches to stop dialing a machine and to keep it out of the rail
The host book has no per-machine state: every entry is dialed on demand and every entry is
listed in the rail. A machine that is temporarily off the network, or one kept for the
occasional job, cannot be marked as such - the only lever is removing it, which takes its
folders and its forward rules with it.

- RemoteHostEntry gains disabled, written as "disabled" rather than "enabled" so an entry
  written before the field existed still means what it always did, plus IsEnabled(); the
  renderer writes the key only when it is set.
- One switch per row decides whether the machine is dialed, and that is all it decides:
  live panes keep running and the rail still lists the machine, because a machine being
  off the network says nothing about what this window should show. Whether this window
  lists it stays a separate preference, and it is an immediate row action next to the
  row's other actions rather than a control inside the edit form, which saves on submit.
- remoteHostDialable is the single answer to whether a machine may be reached: POST
  /remotes/open refuses a disabled one with remote.disabled before dialing, and remoteLink
  (the tree and directory reads, and removing a far session) asks the same question, so a
  disabled machine is not reached for at all. A book that cannot be read is a refusal
  rather than a dial.
- GET /remotes reports disabled and the edit endpoint carries it.
2026-10-05 12:28:38 +08:00
YHH 0397a3bed6 Merge pull request #12047 from esengine/fix/phone-chip-idle-while-running
fix(studio): status chip no longer says idle while the turn is running on a late-attached client
2026-10-04 21:24:00 -07:00
yhh 4c64d7cc61 fix(studio): status chip no longer says idle while the turn is running on a late-attached client 2026-10-04 21:15:46 -07:00
YHH 312ba89ae6 Merge pull request #11992 from keeyangyy/pr/default-model-display
fix(studio): the default-model row shows the configured default, not the session's model
2026-10-04 21:01:55 -07:00
YHH a3d1142d7d Merge pull request #12034 from esengine/fix/studio-stable-github-latest
release(studio): stable releases become GitHub latest, without a root latest.json
2026-10-04 20:57:16 -07:00
keeyang 5c3b9f0bed fix(studio): the default-model row shows the configured default, not the session's model
#11897 stopped a session's model switch from rewriting default_model, which left the
settings row reading status.modelRef - the model the session in front is running - so
switching models inside a conversation still moved that row while the file it claims to
describe did not change.

The row now shows the entry the model catalogue marks as default, falling back to the
session's model when the catalogue carries no default, and the column beside it follows
the same value. `main` stays the session's model for the vendor-protocol inference this
component does.

Tested: with a catalogue default the row shows it whatever the session runs; without one
it falls back to the session's model; the settings-catalogue, ModelUsage and i18n gates.
2026-10-05 11:52:13 +08:00
yhh b7541b7c80 release(studio): stable releases become GitHub latest, without a root latest.json
A stable studio-vX.Y.Z that is the highest stable studio tag is created with
--latest and without --prerelease. Candidates (-preview.N, -rc.N) keep
--prerelease --latest=false, and recovering an older stable tag does not take
latest back. The decision lives in scripts/studio-release-flags.sh and reads
the tag grammar, not wording.

The GitHub release no longer carries a root latest.json. The 1.x desktop
updaters fall back to releases/latest/download/latest.json, and builds up to
1.18 do not validate the manifest and share Studio's minisign key, so a
Studio manifest there would offer them a Studio package. The file stays in
the R2 mirror under <tag>/, which is the only place Studio reads it. The
release now has 21 assets.

Adds a flags-script test and a workflow contract test, and updates the
runbook, READMEs, MIGRATING and ROADMAP.
2026-10-04 20:25:37 -07:00
YHH ac681f524d Merge pull request #12030 from esengine/theme-decorative-tokens
feat(theme): decorative roles get their own tokens (link, brand, halo, labelAgent)
2026-10-04 20:08:02 -07:00
yhh b977cbda91 feat(theme): give links, brand tint, halos and agent names their own tokens
Part of #12008.
2026-10-04 19:54:17 -07:00
YHH e6655a6054 Merge pull request #12014 from esengine/fix/pack-theme-generated-stylesheet
fix(studio): deliver theme packs through a generated stylesheet, not inline styles
2026-10-04 19:45:31 -07:00
YHH 3e6f700acb Merge pull request #12021 from esengine/fix/approval-allow-wording-12020
fix(studio): name the allow decision on session/persistent approval buttons
2026-10-04 19:44:36 -07:00
YHH 770f24b278 Merge pull request #12017 from esengine/fix/claude-modules-unsupported
fix(pluginpkg): report Claude Code modules as an unsupported capability
2026-10-04 19:43:45 -07:00
YHH d338338d54 Merge pull request #12022 from esengine/docs/studio-2.28.0-notes
docs(release): Studio 2.28.0 notes
2026-10-04 16:58:29 -07:00
yhh 8df12a049a docs(release): Studio 2.28.0 notes 2026-10-04 16:51:12 -07:00
YHH ab25352696 Merge pull request #12018 from esengine/fix/bash-rule-wrapper-peeling
fix(permission): match Bash deny and ask rules through transparent command wrappers
2026-10-04 16:33:38 -07:00
yhh 9d96517857 fix(studio): name the allow decision on the session and persistent approval buttons 2026-10-04 16:31:48 -07:00
yhh 1fa63d16f0 fix(permission): match Bash deny and ask rules through transparent command wrappers
A deny or ask rule such as Bash(rm:*) compared only the words the model wrote,
so `env X=1 rm`, `sudo rm`, `command rm`, `nohup rm`, `nice rm`, `time rm` and
`/bin/rm` were judged by fallback mode instead of the rule.

shellparse.PeelWrappers reads one simple command from the shell AST and
follows a fixed set of wrappers (env, sudo, doas, command, builtin, exec,
nohup, time, nice) down to the program they run, naming a path-spelled program
by its base name. Deny and ask matching test every layer; allow and session
rules are unchanged. A wrapper whose target cannot be named statically needs a
human instead of falling through to the mode.
2026-10-04 16:24:22 -07:00
yhh 4b4b324a81 fix(studio): deliver theme packs through a generated stylesheet, not inline styles
apply() wrote every pack token, and the ink variables even with no pack,
as inline custom properties on <html>, so any author stylesheet needed
!important to win. The values now live in one rule of a <style
id="pack-theme"> created after the built-in sheets, written through the
CSSOM so a rejected value is dropped. The contrast tiers carry the inks in
the stylesheet, with --ghost on --faint's value, and perf/tiers.mjs holds
each tier to the legibility users already had.
2026-10-04 16:08:54 -07:00
yhh f654aeabb6 fix(pluginpkg): report Claude Code modules as an unsupported capability
A Claude Code Mod declares "modules" in hooks/hooks.json instead of a
"hooks" map. The importer returned early on an empty hook map, so the
modules were dropped silently and a Mod with skills previewed as full.
2026-10-04 15:56:08 -07:00
YHH e40b3b070f Merge pull request #12006 from esengine/fix/model-list-two-keys-one-endpoint
fix(serve): keep models from two accounts at one endpoint in the model list
2026-10-04 14:12:44 -07:00
yhh fc2887582e fix(serve): keep models from two accounts at one endpoint in the model list
The model list collapsed entries by endpoint + model, so two providers
sharing a base URL with different API keys listed each model once and
the second account's refs vanished from the picker.
2026-10-04 13:58:32 -07:00
YHH 8f8785c4c4 Merge pull request #11697 from KHG420/codex/studio-plugin-profile-diagnostics
fix(studio): diagnose rejected plugin profile declarations
2026-10-04 13:58:02 -07:00
xiexian e6d5dab212 fix(studio): diagnose rejected plugin profile declarations 2026-10-05 04:39:40 +08:00
YHH 403ae88dd2 Merge pull request #12004 from esengine/fix/boot-flaky-tests
test(boot): deflake URL-interaction and fullsidecar effect tests
2026-10-04 13:25:38 -07:00
YHH f7eb4e26a6 Merge pull request #12002 from esengine/fix/flaky-instances-differ-test
test(context-retrieval): assert live runs are seeded from entropy, not that two answers differ
2026-10-04 13:19:31 -07:00
yhh a4e456a43e test(boot): wait for lazy MCP swap before URL-interaction run; give sidecar build a 5m bound and name its timeout 2026-10-04 13:16:21 -07:00
YHH 42455e61fb Merge pull request #11844 from KHG420/codex/studio-sdk-tool-call-identifiers
fix(sdk): validate provider tool call identifiers
2026-10-04 13:12:36 -07:00
esengine 677e3eabe2 test(context-retrieval): assert live runs are seeded from entropy, not that two answers differ
TestInstancesDifferBetweenRuns instantiated every task twice and failed
whenever two independent draws collided. Three tasks answer with a bounded
number (i70 quota 1200..9800, i47 lease 15..300, i112 lease 20..420), so a
run fails with probability 1/8601 + 1/286 + 1/401, about 0.61%.

liveRand now delegates to liveRandFrom(io.Reader). The test asserts the
invariant at the seed: two live generators do not share a stream, the same
entropy yields identical instances and different entropy yields different
values.
2026-10-04 12:59:18 -07:00
YHH 090060507c Merge pull request #11742 from KHG420/codex/studio-unicode-agent-inventory
fix(studio): match package agent inventory to runtime names
2026-10-04 12:56:01 -07:00
xiexian cb1b36d726 fix(studio): match package agent inventory to runtime names 2026-10-05 03:41:01 +08:00
YHH 255001cead Merge pull request #11843 from KHG420/codex/studio-sdk-usage-counts
fix(sdk): reject negative provider token usage
2026-10-04 12:30:56 -07:00
YHH 7ed449841b Merge pull request #12000 from esengine/fix/state-root-walk-windows-delete
test(config): treat a directory mid-deletion on Windows as vanished in the state-root walk
2026-10-04 12:30:30 -07:00
yhh 28455421fb test(config): treat a directory mid-deletion on Windows as vanished in the state-root walk
The walk tolerated only not-exist, but a directory being removed on Windows
fails to open with a sharing violation or access denied. Those errors now
count as vanished only when a re-stat shows the path gone.
2026-10-04 12:16:04 -07:00
YHH 8cfb5f75c7 Merge pull request #11702 from KHG420/codex/studio-directory-agent-inventory
fix(studio): guard agent inventory source residency
2026-10-04 12:00:42 -07:00
xiexian 116d0b4176 fix(studio): guard agent inventory source residency 2026-10-05 02:42:01 +08:00
YHH fc1f7fdcfa Merge pull request #11837 from KHG420/codex/studio-sdk-chunk-types
fix(sdk): reject unregistered provider chunk types
2026-10-04 11:33:32 -07:00
xiexian 9d5f2a7dd9 fix(sdk): validate provider tool call identifiers 2026-10-05 02:28:31 +08:00
xiexian 63754d56d2 fix(sdk): reject negative provider token usage 2026-10-05 02:25:05 +08:00
xiexian 0e06829846 fix(sdk): reject unregistered provider chunk types 2026-10-05 02:22:10 +08:00
YHH 54f4fbb19f Merge pull request #11667 from Harbor404/fix/studio-11605-copy-session-info
feat(studio): copy session handoff information
2026-10-04 11:02:22 -07:00
YHH 03147a71cd Merge pull request #11839 from KHG420/codex/studio-sdk-echo-provider
feat(sdk): add an installable offline provider example
2026-10-04 11:01:31 -07:00
YHH 65a06434fb Merge pull request #11997 from esengine/fix/sdk-unused-time-import
fix(sdk): drop the import the merged intercept-budget change left unused
2026-10-04 10:45:05 -07:00
yhh fdba7c3210 fix(sdk): drop the import the merged intercept-budget change left unused 2026-10-04 10:36:19 -07:00
YHH 254140a866 Merge pull request #11795 from KHG420/codex/studio-sdk-provider-start-cancel
fix(sdk): cancel provider streams while opening
2026-10-04 10:20:50 -07:00
YHH b02849f54f Merge pull request #11719 from KHG420/codex/studio-runtime-doctor-executable
fix(cli): detect non-executable plugin runtimes in doctor
2026-10-04 10:13:26 -07:00
YHH 66bfceb85b Merge pull request #11789 from KHG420/codex/studio-sdk-externalized-intercept-budget
fix(sdk): include externalized reads in the intercept budget
2026-10-04 10:10:08 -07:00
xiexian 39fe0acdc5 fix(sdk): cancel provider streams while opening 2026-10-05 01:04:37 +08:00
YHH 931b9aea42 Merge pull request #11968 from esengine/docs/cli-migration-fixes
docs(migrating): match the verified 2.x CLI behaviour for 1.x users
2026-10-04 09:45:01 -07:00
YHH cb2485a0b8 Merge pull request #11990 from esengine/fix/model-check-shows-status
fix(providers): show HTTP status and endpoint text when a model check is refused
2026-10-04 09:43:44 -07:00
YHH 172d05191a Merge pull request #11852 from chuiwenwei/test/studio-verification-stress-solutions
test(e2ebench): prove every declared-solvable verification-stress task can pass
2026-10-04 09:41:03 -07:00
YHH 8c87da114b Merge pull request #11982 from esengine/fix/link-open-failed-page-no-second-browser
fix(studio): a link whose page failed to load no longer also opens the system browser
2026-10-04 09:35:37 -07:00
yhh 8634cf3da2 fix(providers): show the HTTP status and the endpoint's words when a model check is refused
Cause: the per-model check classified any 4xx it could not name as
unknown/rejected and the row printed only "request refused, not confirmed".
The kernel already carried httpStatus; the settings UI dropped it, and the
endpoint's own error text was never sent, so a local Ollama 404 (base URL
without /v1, model id without its tag), a 400 for a model that cannot take
tools, and a missing key on a System One entry all read identically.

Blast radius: POST /providers/check/model gains an optional `detail` field:
the endpoint's error text as one printable line. It is built in this order:
control characters and ANSI sequences replaced, the probe key masked in raw,
URL-escaped and JSON-escaped form (skipped for keys under 8 characters),
secrets.RedactCredentials, then cut to 300 runes. Folding and the key
replacement see the whole text; only the pattern scrub is bounded (8 KiB cut
on a word boundary, after folding). The model row shows an HTTP badge and the text inline. Status and
reason are unchanged and never derived from the text.

Neighbouring behaviours tested: Ollama-shaped upstream (correct, base without
/v1, tagless id, System One kind); 400/404/405/422 classification; detail
equals the upstream text, masks raw/escaped/plain keys, Bearer, ?token=,
Cookie, neutralises newlines/ANSI/NUL, cuts after redaction, cuts at the scan cap with the key split at every offset, with and
without leading whitespace, bounds a 4 MB body, leaves short keys alone (each mutation-checked); add and edit flows
share one fact helper; full ui vitest suite and the serve package.

Why this layer: the serve handler owns the typed result and the row is the only
renderer of it; classification stays where the failure is first known.
2026-10-04 09:31:09 -07:00
YHH 0a66bd417d Merge pull request #11791 from KHG420/codex/studio-sdk-stream-context-lifetime
fix(sdk): cancel provider contexts when streams finish
2026-10-04 09:25:48 -07:00
YHH 72030d75a3 Merge pull request #11806 from KHG420/codex/studio-market-blocked-previews
fix(studio): keep blocked market previews out of confirmation
2026-10-04 09:21:30 -07:00
YHH 5dfcc2d086 Merge pull request #11987 from esengine/fix/acp-resume-status-notif
test(acp): resume invariant is no transcript replay, not no notification
2026-10-04 09:16:32 -07:00
yhh 42d4ab374c test(acp): resume invariant is no transcript replay, not no notification 2026-10-04 09:06:20 -07:00
YHH 2921ddff26 Merge pull request #11969 from esengine/fix/tui-unknown-slash-as-message
fix(tui): send an unknown slash command to the model with a visible notice
2026-10-04 09:06:09 -07:00
YHH 750ed087db Merge pull request #11981 from esengine/fix/list-folder-of-first-turn
fix(serve): list the folder a first turn is held in
2026-10-04 08:58:31 -07:00
YHH a2a5855f23 Merge pull request #11973 from esengine/fix/compaction-block-release
fix(compaction): release a transient summary failure once the input has grown
2026-10-04 08:56:26 -07:00
yhh 9052fd32f6 fix(studio): a link whose page failed to load no longer also opens the system browser
POST /browser/open answers 400 when the navigation fails even though the
window's tab already exists, and the link handler read every refusal as
"nothing opened" and sent the same address to the machine's browser.
The refusal now names the tab it left behind and the handler only falls
back when there is none.
2026-10-04 08:54:43 -07:00
yhh 3a3b474b10 fix(serve): list the folder a first turn is held in
A pane adopted at launch is not a folder anyone picked, so nothing listed it
once a later launch opened another one. Its conversations stayed on disk with
no sidebar row to open them from. The folder is now listed behind the existing
ones when the pane's first turn mints its session path.
2026-10-04 08:48:09 -07:00
YHH 8fb66a86da Merge pull request #11976 from esengine/fix/queue-withdraw-races
fix(studio): queue withdraw races (double click, stale pull, late receipt)
2026-10-04 08:47:03 -07:00
YHH 2766f23beb Merge pull request #11979 from esengine/fix/state-root-walk-vanishing-dir
test(config): the state-root guard skips directories removed mid-walk
2026-10-04 08:42:19 -07:00
yhh 58a94b30d6 fix(studio): keep taking back a queued line from erring, ghosting or flickering back
A queued line taken back could fail with a spurious error on a repeated click,
leave a pending transcript row when its receipt landed after the withdrawal,
and reappear in the panel when an older queue pull answered last.
2026-10-04 08:36:56 -07:00
esengine 7db5d0af31 fix(compaction): release a transient summary failure once the input has grown
A truncated, timed-out or failed summary request blocked automatic
compaction for the whole generation, so context kept growing past the
fold trigger with no further attempt. Block release now reads the typed
failure code: transient request failures are released after the input
grows by one retry step; every other class stays blocked.
2026-10-04 08:32:39 -07:00
YHH 779fe8a04d Merge pull request #11972 from esengine/fix/compaction-summary-effort
fix(compaction): summary request asks for the lowest approved reasoning depth
2026-10-04 08:31:42 -07:00
yhh 25eff5352d test(config): the state-root guard skips directories removed mid-walk 2026-10-04 08:31:16 -07:00
YHH 0a96b4bf8e Merge pull request #11975 from esengine/fix/compaction-notice-codes
fix(compaction): typed codes for /compact notices and aborted cards, localised by the frontends
2026-10-04 08:26:55 -07:00
esengine c24586d34d fix(compaction): summary request asks for the lowest approved reasoning depth
The digest request inherited the session's reasoning effort, so reasoning
tokens spent the same 16384-token cap the digest had to fit in and a
finish_reason=length dropped the whole summary. It now carries
EffortOverride=low; adapters apply it only when the endpoint's own effort
vocabulary admits it, so endpoints without a low tier keep their configured
depth.

Refs #11970
2026-10-04 08:21:01 -07:00
esengine 3c96792e13 fix(compaction): host notices and aborted cards carry a typed code the frontends word
/compact notices were raw English sentences built from err.Error(), and an
aborted card with no code read "compaction done / folded nothing". Add
compacted/compact_declined/compact_failed notice codes (detail = the
compaction code), give cancellation, unclassified failures and a busy
session their own codes, and word them in the desktop and TUI catalogues.

Refs #11970
2026-10-04 08:16:44 -07:00
esengine 294d179cb5 fix(tui): send an unknown slash command to the model with a visible notice
The terminal UI asked the kernel to refuse any slash line the registry does
not answer, so a typed path or half-remembered command dead-ended with
"unknown command". 1.x sends it as an ordinary message and says so (#5756).

The TUI client no longer sets refuseUnknownSlash; the controller's existing
default path runs the line through the normal turn pipeline. That notice is
now localised (en/zh/zh-TW) and carries the unknown_command code.

A built-in named first is that built-in whatever follows it, as in 1.x: the
kernel matches /context, /new and /clear by first word, and the TUI does the
same for /help, /clear, /setup, /version, /mouse, /resume and its display
commands, so none of them is sent as prose when given arguments.

Refs #11493, #5756
2026-10-04 08:08:01 -07:00
YHH adde7dd6a7 Merge pull request #11928 from esengine/feat/first-run-key-gate
feat(tui): a keyless first run says why and refuses the turn locally
2026-10-04 07:55:35 -07:00
esengine 610e28f6d7 feat(tui): a keyless first run says why and refuses the turn locally
With no API key the connection panel opened silently and a typed message went
to the provider, which answered 401 with a pointer to a shell command. The
panel now names the model that lacks a key, and /submit refuses a turn for it
with provider.key_missing before anything is sent. The TUI returns the line to
the composer and points at /setup.
2026-10-04 07:45:09 -07:00
YHH 27d6e6f2ad Merge pull request #11967 from esengine/fix/usage-test-no-time-local
test(serve): pass the usage window its zone instead of writing time.Local
2026-10-04 07:43:59 -07:00
esengine 7f453a62f3 docs(migrating): match the verified 2.x CLI behaviour for 1.x users
Correct the YOLO shortcut, the --inline form and the unknown slash command row, and list the permission, slash command and compaction differences.
2026-10-04 07:42:42 -07:00
esengine 5fcf468fb0 test(serve): pass the usage window its zone instead of writing time.Local
The usage range test assigned the process-global time.Local while goroutines from earlier tests still read it, so the race detector failed the package. usageWindow now delegates to usageWindowIn, which takes the zone trailing windows count days in; the test passes a fixed zone and never touches the global.
2026-10-04 07:33:03 -07:00
YHH abd863407f Merge pull request #11964 from esengine/fix/backup-malformed
fix(backup): accept the private credential slot a provider key lives in
2026-10-04 07:10:43 -07:00
esengine 2d43186219 fix(backup): accept the private credential slot a provider key lives in
A provider whose natural key slot is taken gets REASONIX_CONNECTION_<id>_KEY. Collect wrote that provider and its key, but restore validation denied every REASONIX_ name, so the backup sealed fine and then failed to open as malformed.
2026-10-04 06:59:49 -07:00
YHH d30d9cec70 Merge pull request #11960 from esengine/fix/11955-11956
fix(studio): feedback opens with no pane, visible refusals, backup button explains itself
2026-10-04 06:59:33 -07:00
esengine 542a6076a3 fix(studio): feedback opens with no pane, refusals are visible, backup button says why it is disabled
Settings and feedback are answered by a pane's kernel. With no pane open, feedback silently did nothing and the settings refusal never cleared. Opening either now starts a session in the current folder, a refusal is shown for both, and it is withdrawn once a folder or pane exists. The cloud-backup button now states what it is waiting for.
2026-10-04 06:50:58 -07:00
YHH 692aecd6b7 Merge pull request #11343 from par73e/fix/studio-acp-mcp-health-9904
fix(studio): report per-server MCP health over ACP
2026-10-04 06:49:46 -07:00
par73e c5b3dbbfe0 fix(studio): complete MCP health review fixes
Preserve ACP frame-order assertions while skipping only MCP status updates,
and use t.Context in the serve regression test.

Report servers requiring launch approval as pending rather than failed in
controller, ACP and /mcp snapshots. Keep pending rows disabled without a retry
action while retaining their recorded transport and sanitized error.

Document connecting and awaiting-approval notifications, style the pending
indicator in both themes, and derive frontend state coverage from Go constants.
Add controller, endpoint, ACP and row-rendering regression coverage.
2026-10-04 21:15:01 +08:00
par73e d550f754fc fix(studio): address review on per-server MCP health
- Map the new `pending` state in the desktop panel with an i18n label. A
  repository-declared server nobody has answered for is off, but not because
  the user switched it off, and the row rendered the raw state string.
- Announce what actually happened. RecordFailure and
  RecordLaunchApprovalRequired now share one store path and name their own
  state, so a project MCP awaiting authorization stops reporting a failed
  connection.
- Correct the MCPSurfaceReady contract: it fires on every change to what /mcp
  answers, not once per server. Audited every consumer before changing it —
  the ACP sink republishes a full snapshot, the serve broadcaster numbers the
  frame and the SPA refetches /mcp, the headless stream passes it through — so
  repeats are harmless and the documentation was the stale part.
- Keep the spawn claim beside the rest of the deferred-spawn bookkeeping
  instead of a file of its own.
- Add the /mcp endpoint regression test the refactor was missing (live
  transport and source, recorded status code, in-flight spawn, cached
  description and tools), and a panel test tying every state label to the
  English catalogue.
2026-10-04 21:06:00 +08:00
par73e b3a5541069 fix(studio): expose per-server MCP health over ACP 2026-10-04 21:05:59 +08:00
YHH 63195e95a5 Merge pull request #11935 from esengine/feat/tui-mcp-panel
feat(tui): /mcp opens a panel to enable, reconnect and inspect MCP servers
2026-10-04 06:02:53 -07:00
esengine 878fc8a53d feat(tui): /mcp opens a panel to enable, reconnect and inspect MCP servers 2026-10-04 05:51:34 -07:00
YHH f7d6d25930 Merge pull request #11929 from esengine/feat/tui-model-provider-pickers
feat(tui): /model and /provider open a searchable picker and switch the session
2026-10-04 05:50:26 -07:00
YHH 0594ee9e0c Merge pull request #11923 from esengine/fix/credential-roundtrip-11901
fix(config): a stored API key reads back byte-for-byte
2026-10-04 05:42:25 -07:00
esengine 290e787c47 feat(tui): /model and /provider open a searchable picker and switch the session 2026-10-04 05:38:56 -07:00
YHH dbb7b8498f Merge pull request #11950 from esengine/feat/settings-display-currency
feat(settings): choose the cost display currency (Auto / CNY / USD)
2026-10-04 05:32:04 -07:00
esengine 4e7067a17b fix(config): a stored API key reads back byte-for-byte (#11901)
SetCredential and SetCredentialIfRevision built a KEY=value line and parsed it
with the dotenv reader, so ${...} was expanded and wrapping quotes stripped
before the key was ever written. The writer also left a value containing $
bare, which the reader then expanded. Store the assignment directly and pick
the first encoding the reader returns unchanged; a value no encoding can hold
(for example a trailing backslash next to a quote or $) is refused before
anything is written, so one entry can never make the whole file unreadable.
2026-10-04 05:31:41 -07:00
YHH ac16c15950 Merge pull request #11934 from esengine/feat/tui-skills-panel
feat(tui): /skills opens a panel to search, filter by source and toggle skills
2026-10-04 05:29:20 -07:00
esengine c8f57aeb69 feat(tui): /skills opens a panel to search, filter by source and toggle skills 2026-10-04 05:16:09 -07:00
YHH 3134b0f18c Merge pull request #11953 from esengine/fix/response-language-11951
fix(control): constrain the visible answer language per turn in auto mode
2026-10-04 05:14:40 -07:00
YHH 6ab2051411 Merge pull request #11949 from esengine/dependabot/github_actions/actions-dfc3086b10
build(deps): bump pnpm/action-setup from 6.0.9 to 6.1.0 in the actions group
2026-10-04 05:12:21 -07:00
yhh 6a9a821998 feat(settings): choose the cost display currency (Auto / CNY / USD)
Adds GET/POST /display-currency over the controller's new
DisplayCurrencySettings/SaveDisplayCurrency (shared with /currency), a
Settings > Usage control, and makes the quote sink follow the
display_currency notice so rounds after a change are priced in it.
2026-10-04 05:08:29 -07:00
YHH 3083ef303d Merge pull request #11945 from esengine/dependabot/go_modules/go-284eff489b
build(deps): bump the go group with 2 updates
2026-10-04 05:07:02 -07:00
esengine 5bba3bf0b4 fix(control): constrain the visible answer language per turn in auto mode 2026-10-04 05:04:16 -07:00
YHH 35da5f70be Merge pull request #11948 from esengine/dependabot/npm_and_yarn/desktop/frontend-next/npm-b63839cc01
build(deps): bump the npm group in /desktop/frontend-next with 4 updates
2026-10-04 05:04:15 -07:00
YHH 27f78af346 Merge pull request #11944 from esengine/feat/render-chart-tool
feat(tools): add the render_chart built-in, hidden from the provider schema
2026-10-04 05:03:04 -07:00
YHH ae6f621bb8 Merge pull request #11946 from esengine/dependabot/npm_and_yarn/desktop/electron/npm-c15dc57556
build(deps-dev): bump electron from 44.4.5 to 44.5.1 in /desktop/electron in the npm group
2026-10-04 05:01:22 -07:00
YHH 28dd27d033 Merge pull request #11927 from esengine/fix/import-1x-session-layouts
fix(migration): import 1.x sessions from project, v4 and desktop v5 stores
2026-10-04 05:00:36 -07:00
dependabot[bot] 6ee1bbd3aa build(deps): bump pnpm/action-setup
Bumps the actions group with 1 update: [pnpm/action-setup](https://github.com/pnpm/action-setup).


Updates `pnpm/action-setup` from 6.0.9 to 6.1.0
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v6.0.9...ea17c68df8912ef543352723c149a84f56e3d413)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-04 11:55:05 +00:00
dependabot[bot] c8152a8f7e build(deps): bump the npm group in /desktop/frontend-next with 4 updates
Bumps the npm group in /desktop/frontend-next with 4 updates: [@lezer/highlight](https://github.com/lezer-parser/highlight), [katex](https://github.com/KaTeX/KaTeX), [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) and [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest).


Updates `@lezer/highlight` from 1.2.4 to 1.2.5
- [Changelog](https://github.com/lezer-parser/highlight/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lezer-parser/highlight/commits)

Updates `katex` from 0.18.9 to 0.18.10
- [Release notes](https://github.com/KaTeX/KaTeX/releases)
- [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md)
- [Commits](https://github.com/KaTeX/KaTeX/compare/v0.18.9...v0.18.10)

Updates `vite` from 8.3.0 to 8.3.2
- [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.2/packages/vite)

Updates `vitest` from 5.0.1 to 5.0.3
- [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.3/packages/vitest)

---
updated-dependencies:
- dependency-name: "@lezer/highlight"
  dependency-version: 1.2.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: katex
  dependency-version: 0.18.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: vite
  dependency-version: 8.3.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
- dependency-name: vitest
  dependency-version: 5.0.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-04 11:54:18 +00:00
dependabot[bot] 0487b131a0 build(deps-dev): bump electron in /desktop/electron in the npm group
Bumps the npm group in /desktop/electron with 1 update: [electron](https://github.com/electron/electron).


Updates `electron` from 44.4.5 to 44.5.1
- [Release notes](https://github.com/electron/electron/releases)
- [Commits](https://github.com/electron/electron/compare/v44.4.5...v44.5.1)

---
updated-dependencies:
- dependency-name: electron
  dependency-version: 44.5.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-04 11:53:26 +00:00
dependabot[bot] 87d1ebd1d4 build(deps): bump the go group with 2 updates
Bumps the go group with 2 updates: [github.com/klauspost/compress](https://github.com/klauspost/compress) and [modernc.org/sqlite](https://gitlab.com/cznic/sqlite).


Updates `github.com/klauspost/compress` from 1.20.0 to 1.20.1
- [Release notes](https://github.com/klauspost/compress/releases)
- [Commits](https://github.com/klauspost/compress/compare/v1.20.0...v1.20.1)

Updates `modernc.org/sqlite` from 1.59.0 to 1.60.1
- [Changelog](https://gitlab.com/cznic/sqlite/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/cznic/sqlite/compare/v1.59.0...v1.60.1)

---
updated-dependencies:
- dependency-name: github.com/klauspost/compress
  dependency-version: 1.20.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go
- dependency-name: modernc.org/sqlite
  dependency-version: 1.60.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-04 11:53:05 +00:00
yhh 5b4b4ccb97 fix(migration): import 1.x sessions from project, v4 and desktop v5 stores
Picking a 1.x data folder only looked at <root>/sessions, so per-project
sessions, sessions-v4 and desktop-sessions-v5/by-id imported nothing and the
UI reported no old sessions.
2026-10-04 04:49:41 -07:00
YHH ab8835393f Merge pull request #11932 from esengine/fix/cask-waits-for-cli-release
ci(release): write the Homebrew cask only after the CLI release exists
2026-10-04 04:49:29 -07:00
yhh dc809e1150 feat(tools): add the render_chart built-in, hidden from the provider schema
render_chart validates a chartspec v1 spec with chartspec.Parse and answers
with a chart_id and the deterministic text summary, never the rows. It is a
registered built-in left out of the provider allow list, so it is found and
called through use_capability and the cache-stable prefix is unchanged. The
spec persists in the call arguments the session already stores (#11564).
2026-10-04 04:46:12 -07:00
YHH 2bfe43a62d Merge pull request #11926 from esengine/cli/rename-by-index
fix(tui): /rename <n> <title> names the nth saved session and the picker shows the name
2026-10-04 04:41:55 -07:00
YHH 81ce4da64b Merge pull request #11919 from esengine/feat/chartspec-v1
feat(chartspec): add the closed v1 chart spec, validator and text summary
2026-10-04 04:38:49 -07:00
YHH 6a335ae9d7 Merge pull request #11939 from esengine/fix/editconn-save-failed-wording
fix(settings): distinguish failed save from saved-but-not-applied in provider edit
2026-10-04 04:33:07 -07:00
esengine f89c934e47 ci(release): the Homebrew cask is written only after the CLI release it points at exists, and never moves backwards
cli-channels and cli-pointer both waited only for cli-tag, so the cask could be
pushed while the v<version> release holding its archives was still being
created, and stayed pointing at nothing if cli-pointer then failed. The cask
step also overwrote the tap whatever its version, so a workflow_dispatch of an
older tag moved Homebrew backwards; it now skips a tap that is ahead and fails
closed when the tap's version cannot be read.
2026-10-04 04:32:09 -07:00
YHH bfe2ca68b8 Merge pull request #11931 from esengine/fix/cli-archive-build-identity
ci(release): CLI archives carry the same build identity as the npm packages
2026-10-04 04:31:21 -07:00
YHH c3837f5a93 Merge pull request #11937 from esengine/feat/slash-remote-preset-pasteimage
feat(control): answer /remote, /preset (/work-mode, /profile) and /paste-image
2026-10-04 04:28:17 -07:00
yhh 2abe2784e3 feat(chartspec): add the closed v1 chart spec, its validator and text summary
Leaf package internal/contract/chartspec: spec types for bar/line/pie, a
strict Parse (size cap first, unknown fields refused, scalar cells only,
unsafe integers refused), typed refusals with dotted codes and caps, and a
deterministic Summary that quotes cell data. No consumer yet (#11564).
2026-10-04 04:28:10 -07:00
YHH 0d7fd85452 Merge pull request #11920 from esengine/fix/run-untrusted-folder-exit-code
fix(run): exit 4 when an untrusted folder refused the work, and 1.x migration notes
2026-10-04 04:20:25 -07:00
YHH ac31510363 Merge pull request #11933 from esengine/fix/tui-finished-todos-stay
fix(tui): a finished to-do list stays docked until the next turn starts
2026-10-04 04:14:00 -07:00
YHH 753996a897 Merge pull request #11936 from esengine/feat/tui-rate-band
feat(tui): the footer and turn receipt name the peak or off-peak rate a spend was billed at
2026-10-04 04:13:55 -07:00
yhh 2f45ce03f3 fix(settings): say a refused provider save failed, and a saved-but-unapplied one is saved
EditConn titled every outcome "not saved" at warn level, so a write that
landed but was not applied to the live session read as a failure, and a real
failure read as a soft notice. Split by outcome: error alert for a refused
save, status note for saved-not-applied, own title for a catalog refresh.
2026-10-04 04:08:35 -07:00
esengine 4e4004f0f4 fix(tui): /rename <n> <title> names the nth saved session and the picker shows the name 2026-10-04 04:05:59 -07:00
YHH 939ff9f6f7 Merge pull request #11930 from esengine/fix/tui-blank-thinking-marker
fix(tui): a thinking block with no text draws no marker
2026-10-04 04:04:50 -07:00
YHH feb4a51051 Merge pull request #11925 from esengine/fix/windows-icon-fill
fix(desktop): fill the Windows icon tile so the Start menu icon matches its neighbours
2026-10-04 03:46:57 -07:00
esengine 69464792d2 feat(control): answer /remote, /preset (/work-mode, /profile) and /paste-image instead of 'unknown command' 2026-10-04 03:46:00 -07:00
esengine 75c640b9d2 ci(release): CLI archives carry the commit, build time and docs identity npm builds already carry
The archives that reasonix upgrade, the Homebrew cask and the GitHub release
install were linked with main.version only, so they reported no git_commit or
build_time_utc and the embedded product docs identified themselves as dev. The
npm packages of the same release were linked with all of them.
2026-10-04 03:43:25 -07:00
esengine a970662e35 feat(tui): the footer and turn receipt name the peak or off-peak rate a spend was billed at
CostQuote carries a rate band for a rate confirmed as the vendor's own
schedule, aggregates fold it to peak, off-peak or mixed (none when any call
has no schedule), and the TUI prints it beside the cost as 1.x does.
2026-10-04 03:39:23 -07:00
YHH 19c86553ae Merge pull request #11924 from esengine/cli/status-details
fix(tui): /status lists the work tree, the effort and the model ref as 1.x does
2026-10-04 03:36:09 -07:00
esengine 2719b42f8b fix(run): exit 4 when an untrusted folder refused the work, and write the 1.x migration notes
A headless run in a folder with no trust decision refused every edit and
command and exited 0, so scripts that relied on 1.x defaults looked
successful. It now exits 4 (3 under --fail-on-unverified); the gate and
what it allows are unchanged. docs/MIGRATING.md gains the 1.x differences:
trust prompt, untrusted-folder runs, compact-ratio range, env vars.

Refs #11493
2026-10-04 03:35:56 -07:00
esengine a15b269c7f fix(tui): a finished to-do list stays docked until the next turn starts
The panel dropped a list as soon as every item was completed, so the final
N/N never showed. It now stays through the ask panel and the idle prompt and
goes when the next turn begins; a rebuilt screen (resume, rewind) still does
not draw a list that finished before it was opened.
2026-10-04 03:35:51 -07:00
esengine 597153d377 fix(tui): a thinking block with no text draws no marker
Reasoning that is only whitespace has nothing to fold, so the transcript no
longer prints a collapsed "thought for 0s (Ctrl+O)" line for it.
2026-10-04 03:32:15 -07:00
yhh ebe758959e fix(desktop): fill the Windows icon tile so the Start menu icon matches its neighbours 2026-10-04 03:27:32 -07:00
esengine ae22f4b171 fix(tui): /status lists the work tree, the effort and the model ref as 1.x does 2026-10-04 03:25:25 -07:00
YHH 0b638eb96e Merge pull request #11534 from esengine/feat/commit-message-helper
feat(studio): draft a commit message from the staged diff, commit locally on confirm
2026-10-04 01:56:13 -07:00
esengine 7c2a81eb24 feat(studio): draft a commit message from the staged diff and commit locally on confirm
Adds a typed Commits port on the controller: ProposeCommit reads the staged
index through gitcmd, frozen as a tree object, and asks the session's model
for a conventional-commit message in a request of its own (prefix untouched,
billed as commit-message). CommitStaged writes the reviewed tree with
commit-tree and moves HEAD only if it has not moved, so an index that changes
after confirmation cannot enter the commit. Files named as secret holders or
whose added lines carry a private key are withheld from the model and need an
acknowledgement. Hooks and signing never run. Nothing pushes.

Refs #11518
2026-10-04 01:45:20 -07:00
YHH b3d091139f Merge pull request #11342 from par73e/fix/studio-glm-effort-9642
fix(studio): expose GLM reasoning effort levels
2026-10-04 01:38:46 -07:00
par73e 6913fc9765 fix(studio): address review on GLM reasoning effort
- Add the pre-5.3 GLM catalogs to shippedPresets so installs holding the
  old list are moved forward, plus upgrade tests (old shape upgrades, a
  curated catalog stays untouched).
- Declare the per-model ladder once in provider.ZhipuEffortContract and
  read it from the /effort menu, the normalizer and the request builder,
  instead of repeating the model lists across three switches.
- Cite Zhipu's Core Parameters reference for the documented levels
  (5.2's none/minimal/low/medium/xhigh folds, 5.3's forced thinking).
- Add a boot.Build effect test at the provider-request boundary covering
  the stored enabled/disabled -> EffortDisplay -> request path.
- Surface the disabled->low landing for GLM-5.3 in the /effort menu and
  document the 1M context window the added models reuse.
2026-10-04 16:28:33 +08:00
YHH 18ed0649c9 Merge pull request #11914 from esengine/fix/sidebar-open-version-twice
fix(studio): list a version a pane has open once, not under its parent and as its own row
2026-10-04 01:15:13 -07:00
YHH 90afa32c27 Merge pull request #11913 from esengine/fix/gitcmd-codeql-cut
fix(gitcmd): make the option screen a CodeQL barrier at the exec exit
2026-10-04 00:59:24 -07:00
esengine 7363b44c25 fix(studio): list a version a pane has open once, not under its parent and as its own row 2026-10-04 00:58:28 -07:00
esengine f74ae6d352 fix(gitcmd): classify every argument by the option test before it reaches the exec
CodeQL's go/command-injection models regexp matches as barriers only when the
match is the branch condition dominating each use. screen() folded the match
into an || condition and the -C directory skipped it, so alert 1014 kept its
flows through screen() and Args.
2026-10-04 00:49:46 -07:00
YHH c5b43c410c Merge pull request #11665 from Harbor404/fix/studio-11615-usage-ranges
feat(usage): add calendar ranges and precise daily details
2026-10-04 00:26:39 -07:00
Harbor404 080a8d7ac1 fix(usage): clip long rows without hiding totals 2026-10-04 15:11:03 +08:00
Harbor404 86ba9227ee fix(usage): preserve structured range validation
- keep typed field details for days and explicit ranges
- reject from/to combined with days
- treat explicit dates as zone-less calendar days
- relocate and extend usage range tests
2026-10-04 14:10:41 +08:00
YHH 9b1ec952e1 Merge pull request #11909 from esengine/fix/11905-probe-resolved-base
fix(providers): save the base URL the model-list probe answered at
2026-10-03 22:38:14 -07:00
YHH c28884609c Merge pull request #11911 from esengine/fix/rebuild-busy-saved-identity
fix(serve): settings saved while the runtime is busy no longer read as a failed rebuild
2026-10-03 22:33:29 -07:00
YHH 5f7827c9b2 Merge pull request #11906 from esengine/fix/gitcmd-arg-injection
fix(gitcmd): refuse program-running git options at the exec exit
2026-10-03 22:32:26 -07:00
YHH 711966ef31 Merge pull request #11908 from esengine/fix/no-reload-shortcut
fix(studio): leave F5 and Ctrl/Cmd+R to the page; app-window reload moves to Ctrl/Cmd+Shift+R
2026-10-03 22:26:32 -07:00
esengine fb297c3483 fix(serve): a settings save that meets a busy runtime says it was saved, by code
rebuildFailed collapsed the busy refusal into runtime.rebuild_failed with
the English sentence as detail, so the compaction, shell, sandbox,
permission, browser and MCP-load saves told a zh reader the write had
failed. It now answers runtime.saved_while_running, which the UI renders.
2026-10-03 22:16:18 -07:00
esengine 99ee5cdfe0 fix(gitcmd): refuse program-running git options at the exec exit (CodeQL go/command-injection) 2026-10-03 22:13:54 -07:00
esengine fc2f4b495c fix(providers): save the base URL the model-list probe actually answered at
A bare https://host passed the add-provider probe because {base}/v1/models
answered, while chat posts to the saved base + /chat/completions and failed.
The probe now reports the base that was proven (typed address completed with
/v1 only when the listing answered there alone, openai-style kinds only), and
add, onboarding and edit-refresh adopt it into the address field before save.
2026-10-03 22:13:18 -07:00
esengine 1a38708fda fix(studio): leave F5 and Ctrl/Cmd+R to the page; reload the app window on Ctrl/Cmd+Shift+R
F5 and Ctrl/Cmd+R reloaded the whole Studio UI from any focus, so a page
or browser-pane user pressing them lost the window state. The app window
now reloads only on Ctrl/Cmd+Shift+R (white-screen recovery, crash reload
unchanged); the browser pane reloads its own page on F5 and Ctrl/Cmd+R and
ignores the cache on the shifted chord.
2026-10-03 22:10:30 -07:00
Harbor404 6a508efac6 test(usage): isolate boot effect provider registration 2026-10-04 13:08:32 +08:00
YHH 11b0513747 Merge pull request #11903 from esengine/fix/feedback-keep-shots
fix(studio): keep feedback screenshots in the held draft
2026-10-03 22:03:25 -07:00
esengine 47d219e966 fix(studio): keep feedback screenshots in the held draft 2026-10-03 21:54:57 -07:00
YHH 72d4e9f28e Merge pull request #11711 from KHG420/codex/studio-export-json-encodings
fix(studio): export plugins using supported JSON encodings
2026-10-03 21:26:03 -07:00
Harbor404 46783d365f fix(usage): declare calendar range actions 2026-10-04 12:05:57 +08:00
YHH d486cfe71f Merge pull request #11808 from KHG420/codex/studio-remote-manifest-size
fix(install): require complete bounded remote manifests
2026-10-03 21:02:13 -07:00
xiexian 0f8dfa34f9 fix(studio): export plugins using supported JSON encodings 2026-10-04 11:58:15 +08:00
xiexian dabc3481d2 fix(install): require complete bounded remote manifests 2026-10-04 11:51:27 +08:00
YHH 0195f8241a Merge pull request #11897 from esengine/fix/model-switch-not-default
fix(serve): a session's model switch no longer rewrites default_model
2026-10-03 20:51:23 -07:00
esengine bc13eddb53 fix(serve): a session's model switch no longer rewrites default_model
POST /model persisted every switch as the user's default model, so changing
the model inside one conversation silently changed what every new session and
the next launch started on. The typed /model command, the terminal UI and ACP
never did this; only the HTTP picker path did.

The request now carries an explicit `default` flag. The Settings default-model
row and the first-run model choice send it; the composer picker does not, so
it changes only that session. A pane resolving through the hub's resolver
still never writes this machine's config.
2026-10-03 20:40:02 -07:00
YHH d98832f695 Merge pull request #11816 from esengine/feat/fix-11785
fix(mcp): redact endpoint credentials fail-closed in every display, preview and export surface
2026-10-03 19:32:40 -07:00
Harbor404 310ffda281 fix(usage): align source bars with chart tokens 2026-10-04 10:30:45 +08:00
YHH d7744a1616 Merge pull request #11895 from esengine/fix/powershell-parser-cold-start
fix(bash): give the PowerShell delete parser a cold-start budget
2026-10-03 19:22:45 -07:00
esengine 0da518ce84 fix(mcp): redact endpoint credentials fail-closed in every display, preview and export surface
One structural rule (secrets.RedactEndpoint / CredentialKey / RedactArgs)
replaces mcpsetup.RedactURL's query-only masking. Userinfo and fragments are
dropped or masked, query and fragment keys are decoded before classification,
unparseable endpoints render as <redacted>, and transport diagnostics keep
error identity while omitting peer-supplied prose.

Operational values (install, approval fingerprints, persistence) are untouched;
preview and plan responses add separate display fields that the desktop mirror
and confirmation UI render.

Rebased onto the launcher-aware NameFromArgv: names derive from the original
argv but never from a value the display projection masked, so build-flag values
such as `go run -exec` still resolve. Install classification reads the typed
HTTP status instead of sniffing the server name out of the message.

Fixes #11785
2026-10-03 19:19:58 -07:00
esengine 358fb4cff2 fix(bash): give the PowerShell delete parser a cold-start budget separate from per-call latency 2026-10-03 19:07:06 -07:00
YHH 7aeae1990d Merge pull request #11824 from esengine/feat/fix-images-fixture
test(boot): fix the shell used by the restart image effect test
2026-10-03 18:52:49 -07:00
YHH b2db65b417 Merge pull request #11831 from esengine/feat/fix-queue-withdraw
fix(studio): clear the composer on submit and restore a withdrawn queued message exactly once
2026-10-03 18:51:52 -07:00
YHH 43372e6ce7 Merge pull request #11893 from esengine/fix/focus-test-flaky
test(studio): wait for the plugin recovery focus move
2026-10-03 18:04:28 -07:00
esengine b650e362df test(studio): wait for the plugin recovery focus move instead of asserting it immediately
The primary button is focused from a passive effect that runs after the
element is committed, so asserting document.activeElement right after a
findBy* resolves races that effect. Use waitFor, as settings-layers does.
2026-10-03 17:37:55 -07:00
YHH 5bfdfb0bd6 Merge pull request #11891 from esengine/fix/release-credit-owner
fix(release): never credit the repository owner in release notes
2026-10-03 17:21:59 -07:00
YHH 3c060de3e2 Merge pull request #11890 from esengine/docs/studio-2.27.0-notes
docs(release): prepare Studio 2.27.0 notes
2026-10-03 17:14:40 -07:00
esengine de789afafb fix(release): never credit the repository owner in release notes 2026-10-03 17:12:08 -07:00
esengine c83f5931fc docs(release): prepare Studio 2.27.0 notes 2026-10-03 17:07:07 -07:00
YHH 028179b37f Merge pull request #11889 from esengine/perf/boot-test-close-catalogs-before-tempdir
test(boot): close process-global catalogs before the temp dir is removed
2026-10-03 16:31:54 -07:00
esengine 880dcc5b64 test(boot): close process-global catalogs before the temp dir is removed
testenv.TempDir retries RemoveAll for two seconds when a file stays held.
On Windows the usage and history SQLite catalogs, which the shared helpers
left open, held a file under nearly every test's directory, so each of those
tests paid the full retry budget at teardown. Closing the catalogs from the
helper's own cleanup, which runs before the removal, makes it converge on
the first attempt.
2026-10-03 16:22:09 -07:00
YHH 8576a0b0ff Merge pull request #11740 from KHG420/codex/studio-unicode-skill-inventory
fix(studio): align package skill inventory with runtime names
2026-10-03 15:53:09 -07:00
YHH 37056a8dba Merge pull request #11865 from KHG420/codex/studio-go-mcp-names
fix(studio): unify MCP launcher name inference
2026-10-03 15:52:29 -07:00
xiexian a078f8e30f fix(studio): unify MCP launcher name inference 2026-10-04 06:38:46 +08:00
YHH 875dd8e67a Merge pull request #11569 from KHG420/codex/studio-compatible-command-example
docs(ecosystem): add compatible command example and host proof
2026-10-03 15:19:23 -07:00
YHH 558b9cbbb2 Merge pull request #11814 from KHG420/codex/studio-theme-import-ignored-files
fix(studio): reject mixed theme archive selections
2026-10-03 15:18:08 -07:00
YHH 461e03770f Merge pull request #11811 from KHG420/codex/studio-theme-asset-freshness
fix(studio): revalidate theme assets with content ETags
2026-10-03 15:16:35 -07:00
YHH dbc79359c0 Merge pull request #11787 from KHG420/codex/studio-mcp-endpoint-transport-path
fix(studio): infer MCP transport from endpoint path segments
2026-10-03 15:14:38 -07:00
YHH 5dc827a1c0 Merge pull request #11821 from KHG420/codex/studio-publish-kind-keys
fix(studio): share keyboard navigation for market radios
2026-10-03 15:06:26 -07:00
YHH 9de8fe7374 Merge pull request #11886 from esengine/perf/boot-scan-limit
test(boot): make the workspace scan limit injectable (refs #11885)
2026-10-03 14:02:07 -07:00
YHH 075db5672f Merge pull request #11888 from esengine/fix/shellrun-quiet-timeout-test
test(shellrun): stop the quiet-timeout test racing interpreter startup
2026-10-03 13:52:23 -07:00
YHH 3dd8fd4dfa Merge pull request #11887 from esengine/perf/bash-probe-memo
perf(sandbox): remember a bash.exe that already passed the launch probe (refs #11885)
2026-10-03 13:51:38 -07:00
esengine 4a82273735 perf(sandbox): do not relaunch bash -c true for a bash.exe already proven under the same size and mtime
A successful Windows bash probe is remembered per executable identity (path, size, mtime) for the life of the process; failures are never remembered. Every boot.Build used to spawn Git bash for it.
2026-10-03 13:45:23 -07:00
esengine 65f5a0c6f3 test(boot): make the workspace scan limit injectable so the over-limit case needs 65 files, not 50,001
agent.Options.WorkspaceScanLimit (zero keeps the 50,000 production bound) is threaded from boot.Options. The incomplete-prose-scan effect test now sets it to 64 and writes 65 files instead of 50,001.
2026-10-03 13:44:58 -07:00
esengine 7e469c1c59 test(shellrun): inject the child in the quiet-timeout test so interpreter startup cannot race the deadline
The deadline starts at launch, so with a real interpreter the test measured startup time. Under load Git bash needed more than 500 ms and the pre-deadline write never landed.
2026-10-03 13:39:36 -07:00
YHH e190049a70 Merge branch 'studio' into codex/studio-theme-import-ignored-files 2026-10-03 13:11:29 -07:00
YHH a3fd97ab74 Merge pull request #11810 from KHG420/codex/studio-theme-import-lock
fix(studio): serialize theme import feedback
2026-10-03 13:00:46 -07:00
xiexian b8e25a4bb4 fix(studio): reject mixed theme archive selections 2026-10-04 03:56:56 +08:00
xiexian 98e1ebe28f fix(studio): serialize theme import feedback 2026-10-04 03:45:20 +08:00
YHH 963fd1eec1 Merge branch 'studio' into codex/studio-unicode-skill-inventory 2026-10-03 12:30:55 -07:00
YHH 09ba9cddc5 Merge pull request #11882 from esengine/fix/flaky-shellrun-quiet-timeout
test(shellrun): give the quiet-timeout case a deadline that outlasts PowerShell startup
2026-10-03 12:30:23 -07:00
YHH 599ba7cb77 Merge pull request #11883 from esengine/fix/flaky-remember-permission-waits
test(boot): bound permission-rule contention by writer count and process readiness by testenv.Budget
2026-10-03 12:27:25 -07:00
YHH 4e41da5a81 Merge pull request #11881 from esengine/fix/flaky-control-wait-budget
test(control): wait for turn events within testenv.Budget instead of fixed 2-10s
2026-10-03 12:26:21 -07:00
esengine 8e87a1557b test(boot): bound permission-rule contention by writer count and process readiness by testenv.Budget
TestRememberPermissionRuleSerializesConcurrentWriters queued 32 writers on a
lock that waits 5s, so a slow Windows filesystem ran the last waiters out of
time (lock timeout at 5.08s). The cross-process variant had the same shape:
each helper waited a fixed 5s for the others to spawn. Eight writers still
interleave, and the readiness waits now read the shared hang budget.
2026-10-03 12:07:30 -07:00
esengine 39fddef450 test(shellrun): give the quiet-timeout case a deadline that outlasts PowerShell startup
The deadline is armed at launch, so a 500ms budget races interpreter startup:
on a loaded Windows runner PowerShell had not printed anything when it
fired, and the test reported the pre-deadline write as lost. PowerShell now
gets a 10s deadline named for what it has to outlast; POSIX shells keep 500ms.
2026-10-03 12:05:48 -07:00
esengine 8f61e66cf1 test(control): wait for turn events within testenv.Budget instead of fixed 2-10s
Hang-catching waits in the control tests were hard-coded to 2, 3, 5 or 10
seconds. A whole turn through the real agent loop can exceed that on a
loaded Windows runner, so TestTurnOutcomeClassifiesPerseverationPause failed
with 'timed out waiting for TurnDone' on a run that passed on rerun. They now
read testenv.Budget(t), which is the single named bound for a wait that only
exists to report a hang.
2026-10-03 12:05:09 -07:00
xiexian 00c97a6036 fix(studio): align package skill inventory with runtime names 2026-10-04 02:43:46 +08:00
YHH 94d1a293f5 Merge branch 'studio' into codex/studio-compatible-command-example 2026-10-03 11:22:13 -07:00
YHH c66775519f Merge branch 'studio' into codex/studio-theme-asset-freshness 2026-10-03 11:22:04 -07:00
YHH a87f125b27 Merge pull request #11622 from Harbor404/fix/11619-ssh-login-path
fix(remote): cancel SSH session opening during bootstrap
2026-10-03 11:18:31 -07:00
Harbor404 c13fad9b1c fix(remote): limit session-open cancellation side effects 2026-10-04 02:04:27 +08:00
YHH 9a2a6bb03b Merge pull request #11857 from esengine/feat/fix-11846
fix(memory): back up legacy memory files before the V2 migration rewrites them
2026-10-03 10:44:08 -07:00
YHH f6b1c6b7f7 Merge pull request #11788 from KHG420/codex/studio-sdk-host-test-guide
docs(sdk): explain local tests and custom host shutdown
2026-10-03 10:32:30 -07:00
esengine 8787ef30a2 fix(memory): back up legacy memory files before the V2 migration rewrites them 2026-10-03 10:30:54 -07:00
xiexian 024b50c173 docs(sdk): explain local tests and custom host shutdown 2026-10-04 01:18:05 +08:00
xiexian 65c7316669 fix(studio): share market radio keyboard navigation 2026-10-04 01:10:46 +08:00
xiexian a4b5a9a485 docs(ecosystem): add compatible command example and host proof 2026-10-04 01:02:54 +08:00
YHH 26ab215cbf Merge pull request #11749 from KHG420/codex/studio-local-mcp-pending-scope
fix(studio): retain local scope for pending MCP installs
2026-10-03 09:40:19 -07:00
YHH a9de4f4f3d Merge pull request #11879 from esengine/feat/fix-device-ordinal-pr0
fix(serve): reuse the lowest free ordinal for Internet controllers
2026-10-03 09:37:41 -07:00
YHH d82fa6aee1 Merge pull request #11477 from KHG420/codex/studio-update-lock-feedback
fix(studio): show disabled update navigation and cover lock release
2026-10-03 09:30:00 -07:00
YHH 34f7203713 Merge pull request #11578 from KHG420/codex/studio-theme-author-guide
docs(studio): add current theme author guide and starter
2026-10-03 09:28:25 -07:00
YHH 6a30dfaca0 Merge pull request #11877 from esengine/feat/fix-snapshot-bound-test
test(boot): bound snapshot walk goroutines by pool size, not total growth
2026-10-03 09:26:56 -07:00
esengine 8e24f4c89c fix(serve): reuse the lowest free ordinal for Internet controllers
cloudPresence kept a monotonic counter, so every reconnect of the same phone
took the next number. Allocate the lowest ordinal not held by a live
connection instead; it stays fixed for the connection's lifetime.
2026-10-03 09:23:51 -07:00
xiexian 53a27ecb58 fix(studio): show disabled update navigation and cover lock release 2026-10-04 00:19:58 +08:00
YHH 8e5a124070 Merge branch 'studio' into fix/studio-11615-usage-ranges 2026-10-03 09:17:32 -07:00
esengine cdab4ade0b test(boot): bound walk goroutines by pool size, not total goroutine growth
The wide-workspace effect test compared total goroutine growth against a
magic 64, which host background work (sqlite watchers in the history
catalog) pushed past under load. Count only goroutines inside the walkers
and bound them by pool size times concurrent walk kinds; assert none
survive the turn.
2026-10-03 09:13:38 -07:00
YHH 7b09c445c5 Merge pull request #11869 from esengine/feat/fix-11838
fix(compaction): name why an automatic fold failed instead of "folded nothing"
2026-10-03 09:13:05 -07:00
YHH f87f3acd8f Merge pull request #11784 from KHG420/codex/studio-market-install-result-recovery
fix(studio): recover failed market install results
2026-10-03 09:09:16 -07:00
YHH bc73c23120 Merge pull request #11716 from KHG420/codex/studio-private-publish-summary
fix(studio): explain private market drafts before saving
2026-10-03 09:07:11 -07:00
Harbor404 419899ab5e fix(remote): cancel while opening an SSH session 2026-10-04 00:05:22 +08:00
xiexian 29791a36c6 docs(studio): add current theme author guide and starter 2026-10-04 00:04:23 +08:00
Harbor404 6d4b5dcb6a fix(usage): label sources without display names 2026-10-04 00:03:42 +08:00
YHH 949d237c34 Merge pull request #11875 from esengine/feat/fix-writepaths-win-test
test(builtin): compare ambiguous writer grant targets against the resolved root
2026-10-03 08:58:52 -07:00
YHH 1e6b185c2d Merge pull request #11651 from KHG420/codex/studio-plugin-failure-recovery
fix(studio): recover failed plugin installs through fresh previews
2026-10-03 08:55:22 -07:00
YHH 960a5a0105 Merge pull request #11796 from KHG420/codex/studio-package-refresh-recovery
fix(studio): recover from extension inventory read failures
2026-10-03 08:54:27 -07:00
esengine 6fe0755a24 fix(compaction): name why an automatic fold failed instead of "folded nothing"
A fold that was refused or failed ended with an aborted card reading
"folded nothing" and a blocked receipt whose code was empty; the cause lived
only in a sentence. Checkpoint rejections now carry a code per rule, summary
failures are classified by sentinel (truncated, timeout, input too large,
context changed, provider failure), and the code rides both the receipt and
the aborted compaction frame. The Studio card shows a localized cause, and
keeps its before/after token pair on one line when the row wraps.
2026-10-03 08:47:02 -07:00
xiexian c023b9f117 fix(studio): explain private market drafts before saving 2026-10-03 23:45:25 +08:00
esengine 9e2664b8b9 test(builtin): compare ambiguous writer grant targets against the resolved root
The Windows runner's temp dir is an 8.3 short name. The grant target for an
ambiguous path is resolved to the long form, so the expectation built from the
unresolved root never matched.
2026-10-03 08:45:06 -07:00
YHH 482f93af21 Merge pull request #11874 from esengine/feat/fix-market-own-review-test
test(studio): drive own-review regression through the real inventory reload
2026-10-03 08:38:35 -07:00
YHH fdc2b8d94b Merge pull request #11269 from zcxads666/fix-studio-inherited-subagent-effort
fix(boot): let inherited subagent effort yield to execution model (studio)
2026-10-03 08:34:56 -07:00
esengine 25b43266b7 test(studio): drive own-review regression through the real inventory reload
The regression held row and button references across the refetch that
PackageList.submit now triggers after a successful review submission, and
its deferred submitMarket fixtures never updated the inventory myMarket
returns. Query live rows after each reload and delegate to the mock's real
submitMarket so the reloaded inventory reflects the new status.
2026-10-03 08:29:18 -07:00
xiexian c0856e8231 fix(studio): revalidate theme assets with content ETags 2026-10-03 23:26:41 +08:00
zcxads666 0d9c11d0a5 fix: keep inherited subagent effort within the execution model's declared capability 2026-10-03 08:20:03 -07:00
YHH bf03b2eafb Merge pull request #11847 from KHG420/codex/studio-mcp-scope-keyboard
fix(studio): support keyboard MCP installation locations
2026-10-03 08:03:04 -07:00
YHH 8fd6d1ae63 Merge pull request #11568 from esengine/feat/share-port
feat(share): let the phone-access LAN link use a fixed port
2026-10-03 08:01:19 -07:00
YHH 68a311ad02 Merge pull request #11807 from KHG420/codex/studio-install-confirmation-lock
fix(studio): expose market confirmation busy and error states
2026-10-03 07:46:12 -07:00
YHH 97c35fbd83 Merge pull request #11845 from KHG420/codex/studio-publish-enter-submit
fix(studio): submit publishing drafts with Enter
2026-10-03 07:38:34 -07:00
YHH 5495a4b404 Merge pull request #11580 from KHG420/codex/studio-market-review-pending
fix(studio): serialize own-package review submissions
2026-10-03 07:34:00 -07:00
YHH 95985b806a Merge pull request #11800 from KHG420/codex/studio-publisher-feedback-semantics
fix(studio): add semantics to publisher feedback
2026-10-03 07:33:09 -07:00
YHH 99ddf11b31 Merge pull request #11813 from KHG420/codex/studio-theme-preview-recovery
fix(studio): retry previews after theme inventory refresh
2026-10-03 07:30:53 -07:00
YHH ed24735e30 Merge pull request #11832 from KHG420/codex/studio-sdk-provider-lifecycle
test(studio): cover installed SDK provider streams at boot
2026-10-03 07:30:37 -07:00
xiexian 4ddf8bd730 fix(studio): expose market confirmation busy and error states 2026-10-03 22:29:36 +08:00
xiexian d974353edf fix(studio): submit publishing drafts with Enter 2026-10-03 22:18:18 +08:00
YHH 70b380471e Merge pull request #11556 from KHG420/codex/studio-fullsidecar-demo-guide
docs(sdk): align fullsidecar demo guidance
2026-10-03 07:16:37 -07:00
YHH 8306c2f66a Merge pull request #11823 from esengine/feat/fix-11815
fix(session): let sessions that write disjoint paths of one workspace proceed in parallel
2026-10-03 07:06:44 -07:00
YHH 8c25d59ac3 Merge pull request #11812 from KHG420/codex/studio-theme-read-recovery
fix(studio): retain themes when inventory reads fail
2026-10-03 07:05:47 -07:00
YHH 5faff41805 Merge pull request #11792 from KHG420/codex/studio-conformance-scratch-cleanup
test(extension): clean conformance scratch before exiting
2026-10-03 07:01:40 -07:00
YHH c249eb6500 Merge pull request #11818 from KHG420/codex/studio-install-source-labels
fix(studio): name installation source inputs accessibly
2026-10-03 06:59:09 -07:00
YHH 8bc1d025a0 Merge pull request #11738 from KHG420/codex/studio-export-whole-env-refs
fix(pluginpkg): redact literals mistaken for environment references
2026-10-03 06:58:10 -07:00
xiexian 5350d3ac34 fix(studio): support keyboard MCP installation locations 2026-10-03 21:51:35 +08:00
YHH 85b5e76d4d Merge pull request #11819 from KHG420/codex/studio-plugin-toggle-reload
fix(studio): retain plugin switch reload outcomes
2026-10-03 06:48:26 -07:00
YHH 9b03193a00 Merge pull request #11809 from KHG420/codex/studio-mcp-operation-errors
fix(studio): show current MCP operation diagnostics
2026-10-03 06:47:36 -07:00
YHH 030b625208 Merge pull request #11805 from KHG420/codex/studio-mcp-inspection-source-lock
fix(studio): keep MCP inspection input stable while reading
2026-10-03 06:46:42 -07:00
YHH b2225b6d72 Merge pull request #11781 from KHG420/codex/studio-market-vote-signout-recovery
fix(studio): recover signed-out market vote writes
2026-10-03 06:41:16 -07:00
YHH ec5f629213 Merge pull request #11866 from esengine/feat/fix-studio-red
fix(shell): only a leading tilde makes a delete target non-literal
2026-10-03 06:32:50 -07:00
esengine ed6b2ea02f fix(session): resolve delegated writes before the grant check so valid targets are not refused 2026-10-03 06:31:29 -07:00
esengine 20f452eb3f fix(session): claim the paths the writers use, close the Windows alias gap and avoid cross-session deadlock 2026-10-03 06:31:29 -07:00
esengine 0a009c71dc fix(session): let sessions that write disjoint paths of one workspace proceed in parallel 2026-10-03 06:31:12 -07:00
YHH c8dcf82efd Merge pull request #11850 from KHG420/codex/sdk-ui-result-ack
fix(sdk): require explicit UI result acknowledgements
2026-10-03 06:21:19 -07:00
YHH 7d630f5ff0 Merge pull request #11841 from esengine/feat/audit-effort-switch
fix(boot): a subagent that names the parent's model inherits the parent's effort
2026-10-03 06:11:44 -07:00
xiexian df5b824df9 fix(sdk): require explicit UI result acknowledgements 2026-10-03 21:05:36 +08:00
esengine 3589efed7b fix(shell): judge delete targets by expansion shape, accept only 8.3 short-name tildes
A tilde inside a Windows 8.3 short-name segment (RUNNER~1) of a drive-letter
path is an ordinary character; any other tilde can expand to a home
directory and stays refused as non-literal. Unescaped braces are refused
too, since a brace word expands to several targets.

Also give the PowerShell delete-analysis subprocess test a hang guard
instead of a 15 s latency assertion that fails on loaded runners.
2026-10-03 06:00:55 -07:00
YHH f66930fd12 Merge pull request #11840 from esengine/feat/fix-11820
fix(state): bound the workspace snapshot walk so goroutines and threads stay limited
2026-10-03 05:59:51 -07:00
esengine 2a3c2cd1f9 fix(boot): a subagent that names the parent's model inherits the parent's effort 2026-10-03 05:53:42 -07:00
YHH 87f1912c1f Merge pull request #11854 from esengine/feat/fix-compact-ratio
fix(cli): validate compact-ratio against the config layer bounds
2026-10-03 05:52:10 -07:00
YHH 5be2913263 Merge pull request #11862 from esengine/feat/ops-events-workflow
ci(ops): register the ops events relay deploy workflow on the default branch
2026-10-03 05:31:04 -07:00
esengine 1e1dbaf07c ci(ops): register the ops events relay deploy workflow on the default branch
workflow_dispatch workflows must exist on the default branch; the job itself only runs from platform, like the other worker deploys.
2026-10-03 05:14:17 -07:00
xiexian 16aeb9124d fix(studio): add semantics to publisher feedback 2026-10-03 19:56:39 +08:00
xiexian 74d977a5c9 fix(studio): recover failed market install results 2026-10-03 19:48:51 +08:00
YHH b7682ae672 Merge pull request #11835 from KHG420/codex/studio-sdk-response-format
fix(sdk): validate provider response format types
2026-10-03 04:36:21 -07:00
YHH fca92a5675 Merge pull request #11826 from KHG420/codex/studio-fullsidecar-null-arguments
fix(sdk): handle null arguments in fullsidecar demo
2026-10-03 04:24:13 -07:00
YHH 4fdaa75397 Merge pull request #11828 from KHG420/codex/studio-sdk-tool-argument-presence
fix(sdk): require tool argument presence
2026-10-03 04:15:13 -07:00
YHH 474ba205d1 Merge pull request #11802 from KHG420/codex/studio-sdk-cancelled-host-calls
fix(sdk): stop already-cancelled host requests before writing
2026-10-03 04:12:43 -07:00
YHH 5717f930f0 Merge pull request #11798 from KHG420/codex/studio-sdk-shutdown-callback-recovery
fix(sdk): recover shutdown callback panics
2026-10-03 04:09:32 -07:00
YHH 28c45b59d0 Merge pull request #11829 from esengine/feat/docs-change-discipline
docs: add the change discipline rules to REASONIX.md
2026-10-03 03:56:40 -07:00
xiexian 2e9045a300 fix(sdk): include externalized reads in the intercept budget 2026-10-03 18:20:33 +08:00
esengine 9692e499bb fix(cli): validate compact-ratio against the config layer bounds 2026-10-03 03:20:23 -07:00
esengine 801fd6b216 fix(state): publish immutable observation objects with a non-replacing link so concurrent observers cannot race the rename 2026-10-03 03:19:33 -07:00
YHH e4b862cf77 Merge pull request #11804 from KHG420/codex/studio-copied-mcp-launcher
fix(studio): recognize copied MCP add launcher paths
2026-10-03 03:14:29 -07:00
xiexian 8ecfa8c084 fix(studio): infer MCP transport from endpoint path segments 2026-10-03 18:13:11 +08:00
YHH e01622522d Merge pull request #11793 from KHG420/codex/studio-sdk-notification-close
fix(sdk): synchronize notification queue shutdown
2026-10-03 03:05:52 -07:00
xiexian cf490285b0 fix(sdk): cancel provider contexts when streams finish 2026-10-03 18:02:43 +08:00
Will ff8e467102 test(e2ebench): prove every declared-solvable verification-stress task can pass
The reference-solution guard fired only for the train corpus. For every other corpus a missing solution/ was a silent skip, so a grader that can never pass stayed indistinguishable from a task with no solution - the case the rule above it exists to prevent. #11380 supplied the ten vs-pos solutions; this extends the guard to the whole verification-stress corpus and supplies the ten tasks it was still skipping.

The e2e suite keeps the skip, and the skip message now says why: its handwritten tasks do not commit a reference solution.

Verified: go test ./cmd/e2ebench -run TestCorpusGradersPassTheReferenceSolution is green across e2e, verification-stress and train. Removing any single solution/ fails the guard at corpus_test.go:254 (checked by hand for vs-neu-cfgkey), so the added solutions are what the guard grades.
2026-10-03 17:51:55 +08:00
YHH 744fbd4f33 Merge pull request #11759 from esengine/feat/tray-language
fix(studio): pass the system language to the kernel host so the tray follows it
2026-10-03 02:40:15 -07:00
YHH 3b8817d29b Merge pull request #11801 from KHG420/codex/studio-uv-global-options
fix(studio): derive MCP names through uv global options
2026-10-03 02:37:28 -07:00
YHH f2a0893b07 Merge pull request #11799 from KHG420/codex/studio-node-mcp-option-values
fix(studio): skip Node option values in MCP names
2026-10-03 02:36:30 -07:00
YHH d0d7631a7d Merge pull request #11779 from KHG420/codex/studio-mcp-command-continuations
fix(studio): parse continued MCP setup commands
2026-10-03 02:34:07 -07:00
esengine b441b0da8b fix(state): bound the workspace snapshot walk so goroutines and threads stay limited 2026-10-03 00:33:21 -07:00
xiexian 54c8e7ab68 feat(sdk): add installable offline provider example 2026-10-03 15:16:42 +08:00
xiexian 74b6705484 fix(sdk): validate provider response format types 2026-10-03 14:37:10 +08:00
xiexian a5fe9d6b5f test(studio): cover installed SDK provider streams at boot 2026-10-03 14:26:05 +08:00
esengine bce7224270 fix(studio): clear the composer on submit and restore a withdrawn queued message exactly once 2026-10-02 23:19:21 -07:00
esengine 647c1baa5b test(host): call assemble with the startup phase recorder in the tray language effect test 2026-10-02 23:19:01 -07:00
esengine 1bc7fc11e9 docs: add the change discipline rules to REASONIX.md 2026-10-02 22:55:56 -07:00
xiexian e741ffe34b fix(sdk): require tool argument presence 2026-10-03 13:38:53 +08:00
xiexian 3b4a2a7619 fix(sdk): handle null arguments in fullsidecar demo 2026-10-03 13:27:39 +08:00
YHH 6e1a0cccaa Merge pull request #11786 from esengine/feat/fix-11782
fix(shell): refuse recursive deletes whose target is not a literal path inside the granted roots
2026-10-02 22:04:08 -07:00
par73e a0cc22bfc0 fix(studio): expose GLM 5.2 and 5.3 reasoning effort levels 2026-10-03 13:02:02 +08:00
esengine 3552dc1412 test(boot): fix the shell used by the restart image effect test 2026-10-02 22:00:06 -07:00
esengine 265dd7a393 fix(i18n): treat the C and POSIX locales as an explicit English choice and test the tray language end to end 2026-10-02 21:26:52 -07:00
xiexian b407cdceb0 fix(studio): retain plugin switch reload outcomes 2026-10-03 12:21:02 +08:00
xiexian 1d9b15589b fix(studio): name installation source inputs accessibly 2026-10-03 11:57:41 +08:00
YHH f9344a7eed Merge pull request #11760 from esengine/feat/startup-handshake
feat(host): log elapsed milliseconds per startup phase
2026-10-02 20:26:57 -07:00
xiexian 0d2893219f fix(studio): retry previews after theme inventory refresh 2026-10-03 10:57:36 +08:00
xiexian f4bd08549a fix(studio): retain themes when inventory reads fail 2026-10-03 10:48:18 +08:00
xiexian d27be95211 fix(studio): show current MCP operation diagnostics 2026-10-03 10:09:34 +08:00
xiexian 5a10bb1d7f fix(studio): keep blocked market previews out of confirmation 2026-10-03 09:30:11 +08:00
YHH cc5d768001 Merge pull request #11803 from esengine/feat/fix-prev-resp
fix(responses): fall back to full history when a relay rejects previous_response_id
2026-10-02 18:28:13 -07:00
YHH aee132a2f1 Merge pull request #11780 from esengine/feat/fix-11776
fix(evidence): do not demand verification after supporting-only edits when no checks exist
2026-10-02 18:27:16 -07:00
esengine 34f599dcc0 test(shellsafe): cover the delete classification inside its own package 2026-10-02 18:27:03 -07:00
xiexian 5bdaed66d1 fix(studio): keep MCP inspection input stable while reading 2026-10-03 09:13:14 +08:00
xiexian 4ec2f582c2 fix(studio): recognize copied MCP add launcher paths 2026-10-03 09:04:15 +08:00
esengine 3c0a655e90 fix(responses): keep continuation after an expired response id 2026-10-02 18:00:37 -07:00
esengine 813e6932ed fix(evidence): require every mutated path to be a prose path inside the observed root 2026-10-02 17:58:22 -07:00
YHH 11a4734d07 Merge pull request #11504 from Harbor404/fix/powershell-shell-probe
fix(shell): skip a PowerShell Store alias that will not start; record which ran
2026-10-02 17:58:09 -07:00
esengine 6ec0de92be fix(responses): fall back to full history when a relay rejects previous_response_id
A relay that rejected the continuation field with a message the client did not recognise surfaced the HTTP 400 to the user, and the stored response id was kept so the next turn sent the same rejected request. Any HTTP 400 on a request that carried previous_response_id now retries once with the full history; a completed recovery stops sending the field for the client's lifetime, a failed one surfaces its own error naming the attempt.
2026-10-02 17:57:57 -07:00
YHH 35c8104af2 Merge pull request #11546 from Harbor404/feat/effort-model-same-switch-fastpath
perf(studio): skip rebuilds for unchanged model or effort
2026-10-02 17:57:12 -07:00
xiexian cf3460a48f fix(sdk): stop already-cancelled host requests before writing 2026-10-03 08:47:02 +08:00
xiexian a8a632e775 fix(studio): derive MCP names through uv global options 2026-10-03 08:34:35 +08:00
esengine 5069d522bb test(shell): correct the glob cause and make the backslash root case Windows-only 2026-10-02 17:30:05 -07:00
xiexian ee24b43d47 fix(studio): skip Node option values in MCP names 2026-10-03 08:15:19 +08:00
xiexian 92c6944d9b fix(sdk): recover shutdown callback panics 2026-10-03 08:07:59 +08:00
xiexian d52ea1e1d1 fix(studio): recover from extension inventory read failures 2026-10-03 07:59:04 +08:00
esengine 412dd1c865 test(shellparse): cover the delete analysis inside its own package and document the workspace-root refusal 2026-10-02 16:56:38 -07:00
esengine 0ef669e872 style(agent): use the shared receiver name for the prose scan check 2026-10-02 16:28:12 -07:00
xiexian 431dd159a8 fix(sdk): synchronize notification queue shutdown 2026-10-03 07:05:17 +08:00
esengine 72a59c76d4 fix(shell): judge only recursive deletes, attribute each refusal, and close the structural bypasses found in review
Revision after the security review: ordinary commands with dynamic executable names, non-recursive deletes and non-delete wrappers launch again; each refusal carries its own cause and remedy; bounded compound sequences with literal targets inside the granted roots are allowed; default-parameter, pipeline, alias, .NET, find, xargs, cmd and static interpreter payload deletes are judged; symlink components are resolved before dot-dot cleaning; the session temp root is a granted scope; the PowerShell parser is reused across calls; bilingual copy for the new codes.
2026-10-02 16:00:21 -07:00
esengine 83f13a3b1c Merge branch 'studio' of https://github.com/esengine/DeepSeek-Reasonix into HEAD 2026-10-02 15:59:59 -07:00
esengine 93c5419f94 test(evidence): make the prose-only tests independent of fixture files and filesystem case 2026-10-02 15:59:52 -07:00
Harbor404 93bb4eb606 Revert "fix(cli): align plugin doctor root diagnostics"
This reverts commit 41eeae6cd0.
2026-10-03 06:56:15 +08:00
Harbor404 791eca3111 Revert "fix(cli): align plugin doctor root diagnostics"
This reverts commit 73431b67e1.
2026-10-03 06:52:43 +08:00
xiexian b32768b6e0 test(extension): clean conformance scratch before exiting 2026-10-03 06:41:20 +08:00
YHH 7d5bcfd5a9 Merge pull request #11790 from esengine/feat/studio-red
fix(cli): print package warnings before plugin doctor rejects an agent root
2026-10-02 15:39:31 -07:00
esengine b8af495238 fix(cli): print package warnings before plugin doctor rejects an agent root
Doctor now validates declared agent roots fatally, which the warning test added by the root-diagnostics change did not expect, so the two merged changes failed together. The warnings are printed first and the root rejection keeps its exit status.
2026-10-02 15:28:27 -07:00
Harbor404 41eeae6cd0 fix(cli): align plugin doctor root diagnostics 2026-10-03 05:57:48 +08:00
Harbor404 fa5816d74e chore(merge): sync with latest studio 2026-10-03 05:57:46 +08:00
Harbor404 73431b67e1 fix(cli): align plugin doctor root diagnostics 2026-10-03 05:56:05 +08:00
Harbor404 38def5abc8 chore(merge): sync with latest studio 2026-10-03 05:53:54 +08:00
esengine 9d4f5ab8d1 test(evidence): cover prose-only waiver edge cases through boot.Build 2026-10-02 14:27:50 -07:00
esengine 5834500883 fix(shell): refuse recursive deletes whose target is not a literal path inside the granted roots
Approval alone did not stop a recursive delete: in unattended Auto and YOLO a PowerShell sequence whose first assignment failed non-terminally went on to delete the real home directory. A pre-launch gate now parses the command (bash AST, PowerShell parser run as data) and refuses recursive deletes whose target is the home directory, a drive or filesystem root, a workspace ancestor, an expansion, variable or glob, or outside the workspace and granted roots, with a typed shell.destructive_target code; parser failure is shell.analysis_unknown. The gate runs after approval and before every launch route.
2026-10-02 14:26:53 -07:00
YHH 3068d41e3d Merge pull request #11566 from KHG420/codex/studio-market-version-draft
feat(studio): prepare market release drafts from own packages
2026-10-02 14:16:34 -07:00
YHH 02d96f2b8b Merge pull request #11506 from Harbor404/fix/disabled-tools-followups
fix(mcp): preserve disabled tool policy
2026-10-02 14:14:46 -07:00
esengine 20ad469a89 wip: waive verification only in prose-only workspaces 2026-10-02 14:00:50 -07:00
Harbor404 ffc9c3b738 docs(tool): clarify disabled MCP comments 2026-10-03 04:58:46 +08:00
Harbor404 9200563b99 docs(shell): trim review comments 2026-10-03 04:57:05 +08:00
Harbor404 e5e30b6a99 test(boot): filter shell fallback notices 2026-10-03 04:55:28 +08:00
Harbor404 88c3af6913 chore(merge): sync with latest main 2026-10-03 04:53:47 +08:00
Harbor404 d90d071453 test(boot): isolate disabled MCP effect build 2026-10-03 04:53:18 +08:00
Harbor404 4c5df4360f chore(merge): sync with latest main 2026-10-03 04:52:52 +08:00
Harbor404 526544fdf3 docs(serve): trim switch comments 2026-10-03 04:52:32 +08:00
Harbor404 311b5885de chore(merge): sync with latest main 2026-10-03 04:51:26 +08:00
xiexian 7b1ba8b87d feat(studio): prepare market release drafts from own packages 2026-10-03 04:46:18 +08:00
YHH 4f8f8a5bd5 Merge pull request #11553 from KHG420/codex/studio-sdk-tool-example
docs(sdk): add an installable tool extension example
2026-10-02 13:25:12 -07:00
YHH 3c1ad1153b Merge pull request #11584 from KHG420/codex/studio-mcp-author-example
feat(examples): add a runnable stdio MCP plugin
2026-10-02 13:23:31 -07:00
YHH 323b1857f9 Merge pull request #11503 from KHG420/codex/studio-starter-sidecar-lifecycle
fix(sdk): make starter interceptor work on composed inputs
2026-10-02 13:21:33 -07:00
YHH 54b6f28f80 Merge pull request #11748 from KHG420/codex/studio-command-markdown-suffix
fix(studio): drop mixed-case Markdown command suffixes
2026-10-02 13:18:03 -07:00
YHH 7ef30437f7 Merge pull request #11768 from KHG420/codex/studio-mcp-url-scheme-case
fix(studio): recognize HTTP URL schemes regardless of case
2026-10-02 13:17:06 -07:00
YHH f725e9fb27 Merge pull request #11766 from KHG420/codex/studio-node-server-command-name
fix(studio): derive Node MCP names from script entry points
2026-10-02 13:16:08 -07:00
YHH 9ad79c5727 Merge pull request #11767 from KHG420/codex/studio-uv-dependency-server-name
fix(studio): skip uv dependency values when deriving MCP names
2026-10-02 13:12:13 -07:00
YHH ebc29fc2bc Merge pull request #11507 from KHG420/codex/studio-installed-hook-context
test(studio): verify installed hook context lifecycle
2026-10-02 13:04:51 -07:00
YHH b8e07b42a9 Merge pull request #11508 from KHG420/codex/studio-installed-command-effect
test(boot): verify copied slash commands across their lifecycle
2026-10-02 13:03:58 -07:00
YHH 971cea87dc Merge pull request #11777 from esengine/feat/fix-11769
fix(studio): show a signed-in account consistently when the identity service is unreachable
2026-10-02 12:56:43 -07:00
xiexian cc47e5a0ad fix(studio): recover signed-out market vote writes 2026-10-03 03:39:05 +08:00
YHH 594c16e421 Merge pull request #11725 from KHG420/codex/studio-export-valid-env-names
fix(pluginpkg): generate expandable numeric server aliases
2026-10-02 12:37:11 -07:00
YHH 66705ae660 Merge pull request #11689 from KHG420/codex/studio-plugin-root-diagnostics
fix(studio): diagnose native contribution roots that name files
2026-10-02 12:34:00 -07:00
YHH fb54b4cfef Merge pull request #11696 from KHG420/codex/studio-empty-plugin-guidance
fix(studio): correct empty plugin list install guidance
2026-10-02 12:33:01 -07:00
esengine 4b79709cdb fix(evidence): do not demand verification after supporting-only edits when no checks exist
A write to a markdown or text file in a workspace with no declared or captured checks still added a stale_verification debt and, in Balanced, a readiness floor demanding a verification command. When every proven mutation is a supporting-role path and nothing declares or captured a check, neither applies. Mixed, opaque, unproven or partially observed effects and declared checks keep their behaviour.
2026-10-02 12:32:43 -07:00
xiexian 9e0ef76d56 fix(studio): parse continued MCP setup commands 2026-10-03 03:23:59 +08:00
Harbor404 5b07c3dae9 test(shell): prove fallback notice reaches sink 2026-10-03 03:12:18 +08:00
Harbor404 71d23f0ba1 chore(merge): sync with latest main 2026-10-03 03:10:38 +08:00
Harbor404 b5b9f3d523 fix(agent): surface disabled tool refusals first 2026-10-03 03:10:01 +08:00
Harbor404 f65d5aec06 chore(merge): sync with latest main 2026-10-03 03:04:34 +08:00
Harbor404 56792a367c fix(acp): persist no-op config choices 2026-10-03 03:03:58 +08:00
Harbor404 3d9d65b19e chore(merge): sync with latest main 2026-10-03 02:59:47 +08:00
Harbor404 63bbb1334d docs(ui): remove session info helper comment 2026-10-03 02:59:04 +08:00
Harbor404 d2d5571a00 chore(merge): sync with latest main 2026-10-03 02:58:12 +08:00
esengine 69e7f2c7b6 fix(studio): show a signed-in account consistently when the identity service is unreachable
The sidebar row and the account panel disagreed when a token was present but the identity lookup failed: the row showed a signed-in state with a question-mark avatar while the panel drew the sign-in form and hid the error. Both now render the signed-in state, the identity error, a retry and confirmed sign-out.
2026-10-02 11:58:00 -07:00
Harbor404 e730dafd27 fix(usage): keep range errors inline 2026-10-03 02:57:13 +08:00
Harbor404 e1ca40f84a chore(merge): sync with latest main 2026-10-03 02:52:21 +08:00
YHH 15a6b02f1f Merge pull request #11765 from KHG420/codex/studio-registry-resolve-pagination
fix(studio): follow Registry pages for exact MCP installation names
2026-10-02 11:45:59 -07:00
YHH cb880f030c Merge pull request #11543 from Harbor404/fix/remote-open-absolute-workspace
fix(remote): open absolute Windows workspaces from tree
2026-10-02 11:42:48 -07:00
YHH e4f71647c8 Merge pull request #11764 from KHG420/codex/studio-python-server-command-name
fix(studio): derive Python MCP names from interpreter entry points
2026-10-02 11:41:51 -07:00
YHH 1cde2048cc Merge pull request #11698 from KHG420/codex/studio-ci-supervisor-crash-fixture
test(schedrun): wait for child startup before supervisor crash
2026-10-02 11:32:18 -07:00
xiexian 2c40d8905b fix(studio): skip uv dependency values when deriving MCP names 2026-10-03 02:19:40 +08:00
xiexian f8843f4b2c fix(cli): detect non-executable plugin runtimes in doctor 2026-10-03 02:15:08 +08:00
YHH 2902ca1bde Merge pull request #11705 from KHG420/codex/studio-ci-stage-fixture
test(gitcmd): mark rewritten staging fixture stat dirty
2026-10-02 11:10:50 -07:00
YHH c72c073c26 Merge pull request #11715 from KHG420/codex/studio-quoted-prose-paragraphs
fix(repolint): keep quoted paragraphs separate
2026-10-02 11:09:51 -07:00
YHH 8612f792e6 Merge pull request #11724 from KHG420/codex/studio-export-mcp-header-effect
test(boot): exercise exported MCP recipient headers
2026-10-02 11:07:31 -07:00
YHH e8aba147d9 Merge pull request #11699 from Guan0923/codex/rewind-backup-cleanup
fix(checkpoint): 回退成功后清理临时备份
2026-10-02 11:04:02 -07:00
YHH c8339e2cdd Merge pull request #11755 from KHG420/codex/studio-uvx-pinned-server-name
fix(studio): keep uvx version pins out of MCP server names
2026-10-02 10:56:34 -07:00
YHH aff4de8a9b Merge pull request #11756 from KHG420/codex/studio-uvx-from-server-name
fix(studio): skip uvx from values when deriving MCP names
2026-10-02 10:54:36 -07:00
YHH c8e7d97057 Merge pull request #11753 from KHG420/codex/studio-mcp-runner-extension-case
fix(studio): derive MCP names through mixed-case runner extensions
2026-10-02 10:47:49 -07:00
YHH 95334537fe Merge pull request #11752 from KHG420/codex/studio-mcp-empty-definitions
fix(studio): omit empty MCP definitions from pasted previews
2026-10-02 10:45:11 -07:00
YHH 46c6649939 Merge pull request #11758 from KHG420/codex/studio-sdk-served-tool-declarations
fix(sdk): declare only callable tool handlers
2026-10-02 10:43:12 -07:00
YHH 7f575027ed Merge pull request #11747 from KHG420/codex/studio-mcp-pasted-cli-command
fix(studio): parse copied MCP add commands as declarations
2026-10-02 10:37:47 -07:00
YHH 6c11051633 Merge pull request #11745 from KHG420/codex/studio-doctor-agent-roots
fix(studio): validate declared agent roots in plugin doctor
2026-10-02 10:36:48 -07:00
xiexian c4f6c84852 fix(studio): recognize HTTP URL schemes regardless of case 2026-10-03 01:13:22 +08:00
xiexian 9097d2a036 fix(studio): derive Node MCP names from script entry points 2026-10-03 00:38:57 +08:00
YHH e443274913 Merge pull request #11737 from KHG420/codex/studio-package-contribution-rows
fix(studio): replace duplicate contribution rows with current package inventory
2026-10-02 09:35:22 -07:00
YHH e9a0801a58 Merge pull request #11733 from KHG420/codex/studio-package-diagnostic-rows
fix(studio): refresh repeated compatibility issue rows
2026-10-02 09:34:24 -07:00
YHH 9d806ed477 Merge pull request #11736 from KHG420/codex/studio-switch-skill-store
fix(boot): retain configured skill discovery after Studio model switches
2026-10-02 09:18:31 -07:00
xiexian f2cef6dfa8 fix(studio): follow Registry pages for exact MCP installation names 2026-10-03 00:17:39 +08:00
xiexian cefd143bc1 fix(studio): derive Python MCP names from interpreter entry points 2026-10-03 00:00:16 +08:00
esengine 49b5b934a5 feat(host): log elapsed milliseconds per startup phase 2026-10-02 08:56:39 -07:00
esengine d3d3cba4ea fix(studio): pass the system language to the kernel host so the tray follows it 2026-10-02 08:56:31 -07:00
xiexian 9aa53444c7 fix(sdk): declare only callable tool handlers 2026-10-02 23:45:31 +08:00
xiexian 8742e86433 fix(studio): skip uvx from values when deriving MCP names 2026-10-02 23:12:14 +08:00
xiexian da0221a66f fix(studio): keep uvx version pins out of MCP server names 2026-10-02 23:04:40 +08:00
xiexian be46a8575f fix(studio): derive MCP names through mixed-case runner extensions 2026-10-02 22:53:17 +08:00
xiexian 7fb8810372 fix(studio): omit empty MCP definitions from pasted previews 2026-10-02 22:45:25 +08:00
xiexian b854806701 fix(studio): retain local scope for pending MCP installs 2026-10-02 22:27:30 +08:00
xiexian 9ce710a540 fix(studio): drop mixed-case Markdown command suffixes 2026-10-02 22:13:50 +08:00
xiexian 4a963d4b9f fix(studio): parse copied MCP add commands as declarations 2026-10-02 22:04:35 +08:00
xiexian 0f98adf813 fix(studio): validate declared agent roots in plugin doctor 2026-10-02 21:55:49 +08:00
YHH 7bdaae2025 Merge pull request #11731 from esengine/fix/11723-narrow-sidebar-overlap
fix(studio): keep the narrow workspace column legible
2026-10-02 06:36:17 -07:00
YHH db267ac05c Merge pull request #11732 from esengine/fix/11720-run-analysis-inline-detail
fix(studio): open a run-analysis record under the row that was clicked
2026-10-02 06:35:19 -07:00
YHH 9ef965a9d6 Merge pull request #11729 from esengine/fix/11727-menu-position-at-scale
fix(studio): place rail context menus correctly at a zoomed interface size
2026-10-02 06:34:22 -07:00
xiexian 01044c54b7 fix(pluginpkg): preserve only expandable whole environment references 2026-10-02 21:05:11 +08:00
xiexian 0bb6aff2e7 fix(studio): refresh duplicate package contribution rows 2026-10-02 20:53:08 +08:00
xiexian 2e423c43df fix(boot): preserve live skill discovery across Studio model switches 2026-10-02 20:44:44 +08:00
esengine 620aede3d8 fix(studio): open a run-analysis record under the row that was clicked
The record panel was rendered after the whole active-turns list, so with a few
hundred rows it sat thousands of pixels below the click. It now renders inside
the clicked row's list item (or under the signal track for a signal), the same
item stays mounted, and clicking again closes it.
2026-10-02 05:40:13 -07:00
esengine d3f2a601c3 fix(studio): keep the narrow workspace column legible
The session filter row gave four equal cells to labels with counts, so at the
old 176px floor the labels collided; the new-session and search rows wrapped
around their shortcut hints. Raise the column floor to 232px, let the filter
cells size to their labels, ellipsize labels, and drop counts and shortcut
hints below a container width.
2026-10-02 05:38:52 -07:00
YHH 91c13b306c Merge pull request #11726 from esengine/docs/release-2.26.0-notes
docs(release): prepare Studio 2.26.0 notes
2026-10-02 05:28:58 -07:00
xiexian 1bc3c46128 fix(studio): refresh repeated compatibility issue rows 2026-10-02 20:26:02 +08:00
esengine 001473b7a8 docs(release): keep 2.26.0 note bullets within the prose limit 2026-10-02 05:20:20 -07:00
esengine 1f11055c1f fix(studio): place rail context menus correctly at a zoomed interface size
The session and project menus wrote clientX/clientY into left/top, but the
interface scale is CSS zoom, so a fixed element's left/top is multiplied by the
zoom on its way in. Both now go through pinToViewport, which divides by the
zoom and clamps the measured box inside the viewport. The session menu's
max-height is divided by the zoom as well.
2026-10-02 05:17:40 -07:00
esengine 415445ffbc docs(release): mention the author line and Douyin in the 2.26.0 notes 2026-10-02 05:11:42 -07:00
esengine 0e0b79b8c5 docs(release): prepare Studio 2.26.0 notes 2026-10-02 05:11:42 -07:00
YHH 0d9792e8b0 Merge pull request #11718 from esengine/fix/studio-stale-default-model
fix(studio): start with a fallback model when the saved default model is not configured
2026-10-02 05:10:47 -07:00
xiexian 1e2b3189b9 fix(pluginpkg): generate expandable numeric server aliases 2026-10-02 20:04:13 +08:00
YHH b33fe75d7e Merge pull request #11712 from esengine/fix/11706-subagent-stuck-running
fix(studio): keep sub-agent progress previews out of the dispatching call's card
2026-10-02 05:01:00 -07:00
xiexian c1006585e5 test(boot): exercise exported MCP recipient headers 2026-10-02 19:56:51 +08:00
esengine d1dddb53f3 fix(studio): start with a fallback model when the saved default model is not configured
The official DeepSeek entry's model list migrates the retired
deepseek-v4-flash name to deepseek-flash, and qualified refs move with it,
but a bare default_model = "deepseek-v4-flash" (the shape a shared 1.x/Studio
config carries) was left behind. It then resolved to nothing, and because an
unnamed boot preserves an unknown default for its error, the Studio host's
only pane failed to build and the host exited 1 before its handshake.

- config: migrate a bare retired flash ref (default_model and every other
  model-ref field) to the official entry's successor, unless another
  provider still serves that name.
- boot: a new OpenOnFallbackModel option, set only by the Studio host and
  hub panes, lets an unnamed build pass over an unknown non-plugin default
  like a keyless one, open on the first configured chat model, and report
  default_model_unavailable. The config file is not written. run, the TUI
  and every other build keep the actionable unknown-model error and never
  move to another provider on their own.
- serve: removing the provider in use moves the conversation to the startup
  model when the saved default names nothing, instead of answering 500
  after the removal; session titles follow the same startup model.
2026-10-02 04:54:09 -07:00
esengine d2a8d0b190 fix(studio): keep sub-agent progress out of the dispatching call's card
A background sub-agent keeps emitting reasonix.subagent.* progress after the
dispatching call has returned its job id. Folding those frames into the call's
card re-opened it, renamed it and its execution, and nothing closed it again.
Progress now lands in per-call phase state beside the cards; the Subagents
panel reads a child as running while its call is open or its last phase is not
terminal.
2026-10-02 04:51:56 -07:00
YHH efd0a4430a Merge pull request #11704 from esengine/docs/readme-alipay
docs(readme): add Alipay to the Support section
2026-10-02 04:46:07 -07:00
YHH b6f7e2e8e8 Merge pull request #11714 from esengine/fix/11708-guidance-pending-chip
fix(studio): count in-flight guidance from the queue the panel draws
2026-10-02 04:37:24 -07:00
YHH 81d1c2e709 Merge pull request #11713 from esengine/fix/11707-queue-takeback-composer
fix(studio): put a taken-back queued line back in the composer
2026-10-02 04:36:23 -07:00
xiexian 3818e93430 fix(repolint): keep quoted paragraphs separate 2026-10-02 19:18:05 +08:00
esengine 6271a7e264 docs(readme): put the Douyin line in its own quote so no paragraph passes the prose width 2026-10-02 04:15:43 -07:00
esengine afb73be003 docs(readme): add Alipay next to WeChat Pay in the Support section 2026-10-02 04:12:28 -07:00
YHH 694d4d79c8 Merge pull request #11701 from esengine/docs/readme-douyin
docs(readme): add the Douyin account to the community links
2026-10-02 04:02:45 -07:00
YHH 77990ed9eb Merge pull request #11660 from esengine/feat/studio-community
feat(studio): add the community group, Discord and contributors to the app
2026-10-02 04:00:17 -07:00
esengine f4766d1369 fix(studio): put a taken-back queued line back in the composer
Take back cancelled the entry and dropped its text, so the label promised a
retrieval nothing performed. The body is now read before the entry is given
up and appended to the composer, under whatever is already typed. A line whose
body cannot be read stays queued rather than being lost.
2026-10-02 03:59:02 -07:00
esengine 7358ceb085 fix(studio): count in-flight guidance from the queue the panel draws
The header chip counted client-side pending rows, which a delivery reported
before its HTTP receipt left pending forever, so it named a line the queue
panel (the only place to act on one) no longer showed. It now counts the
kernel's waiting guidance through the same predicate the panel filters by,
and a receipt that arrives after its delivery no longer re-opens the line.
2026-10-02 03:56:57 -07:00
YHH d65ae94a50 Merge pull request #11682 from esengine/feat/cli-setup
feat(tui): first-run connection panel and /setup (/auth)
2026-10-02 03:42:17 -07:00
esengine 54ef19b12a feat(studio): add a Douyin entry and an author line to About 2026-10-02 03:42:00 -07:00
xiexian 21bb3f3564 test(gitcmd): mark rewritten staging fixture stat dirty 2026-10-02 18:37:33 +08:00
esengine ca96e644b4 docs(readme): add the Douyin account to the community links 2026-10-02 03:25:53 -07:00
esengine 5d7a599ffd feat(studio): add the community group, Discord and contributors to the app 2026-10-02 03:23:14 -07:00
Guan09 5aabf0cfbd fix(checkpoint): clean backups after committed rewinds 2026-10-02 18:06:20 +08:00
YHH c0d4b5a582 Merge pull request #11688 from KHG420/codex/studio-plugin-prompt-invocations
fix(studio): show qualified plugin prompt invocations
2026-10-02 03:04:41 -07:00
xiexian 8990aca7cc test(schedrun): wait for child startup before supervisor crash 2026-10-02 18:03:27 +08:00
YHH a2deb8cf51 Merge pull request #11684 from KHG420/codex/studio-theme-contribution-names
fix(studio): identify directory theme contributions by pack name
2026-10-02 02:54:44 -07:00
esengine 41f3c1e6dd feat(tui): add first-run connection panel and /setup (/auth)
The terminal UI opens a Configure connection panel when the session owes a
key, and /setup or /auth opens it at any time. The key is tested without
being stored, saved to the credential store only, and applied to the running
session when it belongs to the active connection; config.toml is untouched.
2026-10-02 02:54:20 -07:00
YHH ead1e05b4e Merge pull request #11683 from esengine/feat/cli-queue
feat(tui): /queue, /steer, /takeover, /status, /export and /copy
2026-10-02 02:52:49 -07:00
Harbor404 777e32333c Merge remote-tracking branch 'origin/studio' into feat/effort-model-same-switch-fastpath
# Conflicts:
#	internal/frontend/serve/serve.go
2026-10-02 17:48:26 +08:00
YHH c2b55b9824 Merge pull request #11694 from KHG420/codex/studio-native-prompt-author-example
docs(plugins): add native prompt author example
2026-10-02 02:46:36 -07:00
YHH faf26a3c81 Merge pull request #11695 from KHG420/codex/studio-plugin-hook-diagnostics
fix(studio): report plugin hook declaration warnings
2026-10-02 02:45:38 -07:00
YHH 6b9c38c2a0 Merge pull request #11686 from xxoingr/fix/deepseek-h2-preface
fix(provider): hold DeepSeek request bodies for the HTTP/2 server preface
2026-10-02 02:44:40 -07:00
xiexian c81500adfa fix(studio): correct empty plugin list install guidance 2026-10-02 17:29:12 +08:00
YHH 790fdfca4b Merge pull request #11685 from esengine/feat/cli-misc
feat: /cls /rename /todo /forget /reload /effort /verbose /diff-fold /sandbox /output-style /reasoning-language /theme /language /currency
2026-10-02 02:27:01 -07:00
xiexian 7a8dfa5499 fix(studio): report plugin hook declaration warnings 2026-10-02 17:17:59 +08:00
xiexian 4e76141a41 docs(plugins): add native prompt author example 2026-10-02 17:09:22 +08:00
YHH 921e7bdb95 Merge pull request #11691 from esengine/fix/11338-studio-subagent-rows
fix(studio): keep fleet worker tool rows inside their worker card
2026-10-02 02:06:15 -07:00
xiexian 77a30b1c9e fix(studio): show qualified plugin prompt invocations 2026-10-02 17:05:49 +08:00
esengine 6565ce0c85 fix(cli): warn when the project config overrides /language; use slices.Backward 2026-10-02 01:53:09 -07:00
esengine 7a70fa4bf8 feat(tui): add /queue, /steer, /takeover, /status, /export and /copy slash commands
The Studio terminal UI answers the 1.x commands that read or steer the
kernel's own state, with 1.x argument shapes and output. Queue verbs and
steer go through the existing inbox routes, so the controller still owns
admission and ordering. /export is a controller capability: the file is
created exclusively and never through a symlink. /takeover resumes the
target without taking a session from another process.
2026-10-02 01:38:49 -07:00
esengine 86eeae3d6d fix(cli): keep settings verbs workspace-scoped and user-level, route currency through a typed notice 2026-10-02 01:38:10 -07:00
esengine 932736c19e feat(tui): add /cls /todo /verbose /diff-fold /theme and an effect test for the settings verbs 2026-10-02 01:33:51 -07:00
esengine 7c2890aeff feat(control): answer /rename /forget /sandbox /output-style /language /currency /reasoning-language /effort and /reload as slash commands 2026-10-02 01:33:45 -07:00
esengine a5984a25bb fix(desktop): keep a fleet worker's tool calls inside the group card
foldTool looked for a call's parent only among top-level cards, so a
worker's own calls, whose parent is the per-worker task card nested in the
fleet group, fell through to the main list.
2026-10-02 01:32:32 -07:00
YHH b66b2c34ff Merge pull request #11687 from esengine/feat/cli-modes
feat(tui): YOLO on the mode cycle with one Ctrl+Y, git footer row, paste folding
2026-10-02 01:32:27 -07:00
xiexian 1b47d23ab3 fix(studio): diagnose native contribution roots that name files 2026-10-02 16:31:09 +08:00
YHH 51163562f1 Merge pull request #11681 from KHG420/codex/studio-plugin-guide-current-controls
docs(studio): align plugin guide with current controls
2026-10-02 01:28:37 -07:00
esengine 6749731ea3 feat(tui): fold multi-line pastes the way 1.x does
Pastes of five lines or a thousand characters become [Pasted text #N · M lines],
counted whatever row ending the terminal uses, and expand on send into the
labelled Begin/End block 1.x sends. Numbering continues past labels a resumed
session already holds, and panels receive pastes unfolded.
2026-10-02 01:10:30 -07:00
esengine 1ace88e63d feat(tui): show workspace@branch with dirt counts in the footer and name compaction as 1.x does
The footer's data row now leads with workspace@branch and the +added -removed ?untracked
counts from a new GET /workspace/git, read at start and after each turn. The compaction
meter label is back to the bare COMPACT word.
2026-10-02 01:10:30 -07:00
esengine db0c478900 feat(tui): put YOLO on the Shift+Tab cycle and enable it with one Ctrl+Y
The one-time confirmation gate is gone: YOLO is always a stop on the cycle and a
single Ctrl+Y enters it, as in the 1.x terminal UI. --yolo on the command line
keeps its one-time notice, and the sandbox still applies in every mode.
2026-10-02 01:10:30 -07:00
xxoingrandClaude Opus 5.5 18043ab882 fix(provider): hold DeepSeek request bodies for the HTTP/2 server preface
On a fresh HTTP/2 connection, api.deepseek.com's edge acknowledges an eagerly
sent request body (about 8 KB or more) with WINDOW_UPDATE before its own
SETTINGS frame. RFC 9113 §3.4 requires SETTINGS first, so Go's client aborts
with "received WindowUpdateFrame before a SETTINGS frame" and the turn fails
with connection error PROTOCOL_ERROR. Studio sends a ~30 KB body on every
turn, so every request fails on affected networks.

Send Expect: 100-continue on chat requests to the official DeepSeek host.
The transport then holds the body until the server answers, by which point
its preface has arrived. HTTP/2 stays negotiated and request bytes are
unchanged; other providers are unaffected.

Moving the header setup into chat_headers.go keeps openai.go within its
file-size budget.

Refs #11679

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 16:07:58 +08:00
xiexian 9c435af496 fix(studio): identify directory theme contributions by pack name 2026-10-02 16:05:58 +08:00
YHH 7c03770b1a Merge pull request #11674 from KHG420/codex/studio-plugin-theme-diagnostics
fix(studio): report plugin theme validation warnings
2026-10-02 00:41:28 -07:00
YHH 78c884b1f2 Merge pull request #11677 from KHG420/codex/studio-theme-glob-file-siblings
fix(plugins): skip file siblings in nested theme globs
2026-10-02 00:40:30 -07:00
xiexian 0f48be263d docs(studio): align plugin guide with current controls 2026-10-02 15:37:32 +08:00
YHH 0bced53fe4 Merge pull request #11670 from KHG420/codex/studio-plugin-replace-recovery-hint
fix(plugins): offer replacement in duplicate recovery hint
2026-10-02 00:29:37 -07:00
YHH b52bb7d4c3 Merge pull request #11676 from esengine/docs/readme-tagline
docs(readme): align the tagline with the repository description
2026-10-02 00:26:31 -07:00
xiexian b69954c912 fix(plugins): skip file siblings in nested theme globs 2026-10-02 15:19:17 +08:00
YHH 754dee6725 Merge pull request #11671 from KHG420/codex/studio-lease-test-distinct-pid
test(control): keep lease holder PID distinct from test process
2026-10-02 00:18:12 -07:00
esengine d03684b080 docs(readme): align the tagline with the repository description 2026-10-02 00:08:48 -07:00
xiexian b0578fca34 fix(studio): report plugin theme validation warnings 2026-10-02 15:03:19 +08:00
YHH 8f9c7806c6 Merge pull request #11664 from KHG420/codex/studio-local-link-path-alias
fix: recognize directory aliases in local link installs
2026-10-01 23:41:23 -07:00
xiexian 23f44c5171 test(control): keep lease holder PID distinct from test process 2026-10-02 14:38:59 +08:00
YHH 28383e9f92 Merge pull request #11663 from KHG420/codex/studio-subagent-author-example
docs: add a packaged read-only subagent exercise
2026-10-01 23:33:54 -07:00
YHH 0a4d0493ee Merge pull request #11658 from KHG420/codex/studio-plugin-agent-inventory
fix(plugin): show packaged subagents in capability inventory
2026-10-01 23:32:57 -07:00
YHH 765bdfc872 Merge pull request #11668 from KHG420/codex/studio-linked-plugin-remove
fix: clean up managed links when removing plugin packages
2026-10-01 23:32:05 -07:00
xiexian 13247c20e3 fix(plugins): offer replacement in duplicate recovery hint 2026-10-02 14:22:11 +08:00
xiexian b30ff93cac fix: recognize directory aliases in local link installs 2026-10-02 13:49:52 +08:00
xiexian e309ee2200 docs: add a packaged read-only subagent exercise 2026-10-02 13:39:32 +08:00
xiexian 782070a0df fix: clean up managed links when removing plugin packages 2026-10-02 13:32:25 +08:00
Harbor404 158d9e2b18 feat(studio): copy session handoff information 2026-10-02 13:31:01 +08:00
Harbor404 49dba2381a feat(usage): add calendar ranges and precise daily details 2026-10-02 13:22:33 +08:00
YHH 9a4d3dfaa7 Merge pull request #11657 from esengine/docs/community-links
docs: point the community links at the official QQ group and Discord
2026-10-01 22:08:19 -07:00
YHH 852b5e65aa Merge pull request #11655 from KHG420/codex/studio-own-install-result-retry
fix(studio): let authors re-preview failed package installs
2026-10-01 21:56:19 -07:00
xiexian c9f698352f fix(studio): recover failed plugin installs through fresh previews 2026-10-02 12:54:12 +08:00
xiexian 9393e594f2 fix(plugin): show packaged subagents in capability inventory 2026-10-02 12:44:36 +08:00
esengine 871687fee7 docs: point the community links at the official QQ group and Discord 2026-10-01 21:34:32 -07:00
xiexian b12683f48b fix(studio): let authors re-preview failed package installs 2026-10-02 12:27:00 +08:00
YHH 88ca5ae82b Merge pull request #11648 from KHG420/codex/studio-plugin-remove-help
fix(cli): show confirmation flag in plugin removal help
2026-10-01 21:13:27 -07:00
YHH a6f744d414 Merge pull request #11649 from KHG420/codex/studio-skill-invocation-catalog
fix(studio): honor skill invocation flags in capability catalog
2026-10-01 21:11:33 -07:00
YHH 580339980f Merge pull request #11646 from KHG420/codex/studio-scenario-skill-frontmatter
fix(studio): keep scenario skill frontmatter valid YAML
2026-10-01 20:45:18 -07:00
xiexian daec47c72a fix(studio): honor skill invocation flags in capability catalog 2026-10-02 11:36:06 +08:00
xiexian 1eb7516562 fix(cli): show confirmation flag in plugin removal help 2026-10-02 11:25:19 +08:00
xiexian f392dd2fa7 fix(studio): keep scenario skill frontmatter valid YAML 2026-10-02 11:13:03 +08:00
YHH c0a7ebe10d Merge pull request #11640 from esengine/fix/ask-stepper-back
fix(studio): keep the ask dialog on the next question after going back
2026-10-01 19:22:52 -07:00
esengine 63da41c794 fix(studio): keep the ask dialog on the next question after going back
Next used the first still-open question, so after going back it skipped answered questions, and with two questions it vanished in favour of Confirm. Stepping is now positional; only the last question looks for an open one.
2026-10-01 19:14:20 -07:00
YHH 1651a909f0 Merge pull request #11637 from esengine/fix/touch-enter-lint
fix(studio): keep Enter newline on touch-first devices (continues #11620)
2026-10-01 17:46:45 -07:00
YHH 8ea3bec3e2 Merge pull request #11635 from esengine/ci/windows-boot-timeout
ci(windows): give the Windows package budget 12m now that boot runs past 8m
2026-10-01 16:39:54 -07:00
esengine eba925da41 ci(windows): give the Windows package budget 12m now that boot runs past 8m 2026-10-01 16:29:29 -07:00
YHH d85fe68a17 Merge pull request #11634 from esengine/docs/studio-2.25.0-notes-2
docs(release): add the fixes merged since the first 2.25.0 notes
2026-10-01 15:05:19 -07:00
esengine 73aca5b612 docs(release): add the fixes merged since the first 2.25.0 notes 2026-10-01 14:57:20 -07:00
YHH 195ee6dcf3 Merge pull request #11590 from KHG420/codex/studio-context-hook-example
docs(studio): add a session-start context author example
2026-10-01 14:37:23 -07:00
esengine a7e6771ae5 fix(studio): keep the composer under the file-size ceiling and cover the touch-device send paths 2026-10-01 14:28:17 -07:00
YHH 0c88b9d0b4 Merge pull request #11632 from esengine/fix/footer-text-clip
fix(studio): stop single-line labels from clipping glyphs of tall fonts
2026-10-01 13:25:26 -07:00
esengine e8ac15d52a fix(studio): stop single-line labels from clipping glyphs of tall fonts
The workspace label in the sidebar footer, the composer's model name and the
workbench file name paired overflow clipping with line-height 1, so a UI font
whose ascent and descent exceed 1em lost the tops and bottoms of its glyphs.
They now use line-height 1.5; the rows centre their children, so nothing moves.
A style contract fails any new rule that clips a line tighter than 1.2.
2026-10-01 13:16:53 -07:00
YHH e4dd0ad1b4 Merge pull request #11629 from esengine/fix/meterrail-tabular-nums
fix(studio): keep the status rail from jumping as its numbers change
2026-10-01 12:20:14 -07:00
esengine 404af94b9e fix(studio): keep the status rail from jumping as its numbers change
The rail items re-declare the font shorthand, which resets
font-variant-numeric, so the digits were proportional and each item changed
width with its value. Restate tabular-nums in those rules and reserve the
width of a three-digit speed.
2026-10-01 12:10:06 -07:00
YHH 8de4c91010 Merge pull request #11624 from esengine/feat/remote-bootstrap-nvm
fix(remote): run bootstrap commands with the remote login-shell PATH
2026-10-01 11:25:20 -07:00
esengine b94c4aa944 fix(remote): run bootstrap commands with the remote login-shell PATH 2026-10-01 11:12:01 -07:00
YHH ef1a339ca9 Merge pull request #11613 from Harbor404/fix/studio-11574-browser-workspace
fix(studio): let browser deployments add workspaces by path
2026-10-01 11:08:02 -07:00
YHH 6d679edf67 Merge pull request #11614 from Harbor404/fix/studio-11586-provider-name-ime
fix(studio): hold Add while a source name is composing
2026-10-01 11:03:23 -07:00
xiexian 29c033cfd5 docs(studio): add session-start context author example 2026-10-02 01:28:24 +08:00
YHH 3eda0b98e4 Merge pull request #11618 from esengine/feat/feedback-unavailable-retry
fix(feedback): retry a transient submit response once and say what to do next
2026-10-01 10:02:38 -07:00
Harbor404 b5485b1649 fix(studio): keep Enter newline on touch-first devices 2026-10-02 01:00:05 +08:00
esengine 5e1ea240fb fix(feedback): retry transient submit responses once
A submit that gets an answer without a recognised service code (an uncoded
5xx or an undecodable success body) is retried once with the existing
backoff, keeping the idempotency key. Coded refusals, refused redirects and
replies are never retried. The failure message now says the typed text is
kept, to try again shortly, and points at the GitHub alternative.
2026-10-01 09:41:30 -07:00
Harbor404 c046c5281f fix(studio): keep add disabled during source-name IME
The source-name field intentionally hides validity errors while an IME candidate is still composing. The Add button did not share that state, so a completed form could submit a partial non-ASCII candidate before composition ended. Hold the button while composing and cover the name boundaries at the UI and serve boundary.
2026-10-01 22:45:16 +08:00
Harbor404 7ad19b82a5 fix(studio): add workspaces from a browser
Probe host capabilities before opening a native picker. Headless and remote browser clients now enter a server-side path and use the existing /tree/workspaces API, while the desktop shell keeps its native dialog.
2026-10-01 22:44:28 +08:00
YHH 7b34dd738d Merge pull request #11610 from Harbor404/fix/studio-11581-legacy-recovery-archive
fix(serve): archive a legacy recovery lineage atomically
2026-10-01 07:42:24 -07:00
YHH d77138966a Merge pull request #11611 from KHG420/codex/studio-mcp-result-retry
fix(studio): retain retry for returned MCP install failures
2026-10-01 07:40:24 -07:00
xiexian 4642a4cbee fix(studio): retain retry for returned MCP install failures 2026-10-01 22:18:28 +08:00
YHH 2df63d9f9a Merge pull request #11609 from KHG420/codex/studio-install-failure-reload
fix(studio): preserve install failures alongside reload errors
2026-10-01 07:17:26 -07:00
Harbor404 99e466f2cc fix(sessionstore): archive recovery lineage atomically
Archive a folded legacy recovery row together with its siblings, keep siblings open in a pane active, and restore sidecars if a multi-file update fails. Refs #11581.
2026-10-01 22:09:57 +08:00
YHH c145598d47 Merge pull request #11599 from KHG420/codex/studio-export-executable
fix(studio): keep exported plugin hooks executable after reinstall
2026-10-01 07:08:00 -07:00
xiexian 5ff8944e9f fix(studio): preserve install failures alongside reload errors 2026-10-01 22:01:39 +08:00
YHH e080b2b972 Merge pull request #11604 from KHG420/codex/studio-install-reload-reason
fix(studio): preserve installation reload failure reasons
2026-10-01 06:55:37 -07:00
YHH 614f9d3831 Merge pull request #11595 from KHG420/codex/studio-my-packages-account
fix(studio): scope My packages to the current account
2026-10-01 06:42:18 -07:00
YHH 9d53a3aad7 Merge pull request #11602 from KHG420/codex/studio-remove-reload-result
fix(studio): retain reload failures after package removal
2026-10-01 06:41:23 -07:00
YHH 8d306bd0e6 Merge pull request #11596 from no-name-touse/fix/onboarding-zoom
fix(studio): make onboarding layout follow zoom-adjusted width
2026-10-01 06:33:27 -07:00
YHH a9cae776f5 Merge pull request #11601 from esengine/fix/context-budget-notice-continues-task
fix(agent): tell the model compaction is automatic and the task continues
2026-10-01 06:32:36 -07:00
xiexian 13c1820de5 fix(studio): preserve installation reload failure reasons 2026-10-01 21:16:34 +08:00
xiexian 5d33e047f4 fix(studio): retain reload failures after package removal 2026-10-01 21:06:03 +08:00
esengine ce860db141 fix(agent): tell the model compaction is automatic and the task continues
The context-budget notice reported "room remaining" and, at the second
rung, told the model to land what it knows now. It never said that the
fold is automatic and the same task goes on, so a model near the trigger
read the figure as the end of its window, announced it would be
compacted, and handed the work back to the user (in-app feedback
FB-J2QR-HQ89).

Both rungs now state that the figure counts to the automatic compaction,
not to the end of the window, and carry one shared continuation clause:
keep working, do not stop, hand the work back or suggest a new session.
The notice still rides the turn tail and the typed ContextBudgetFigures
event is unchanged.

Two fixtures sat within a few tokens of the notice size and are widened.
2026-10-01 06:03:44 -07:00
YHH 688658585b Merge pull request #11600 from esengine/docs/studio-2.25.0-notes
docs(release): prepare Studio 2.25.0 notes
2026-10-01 06:00:43 -07:00
Harbor404 ac0a13dbdd Merge remote-tracking branch 'origin/studio' into feat/effort-model-same-switch-fastpath 2026-10-01 20:54:13 +08:00
Harbor404 7f9cb9dbdc fix(acp): remove unused session config helper 2026-10-01 20:54:11 +08:00
esengine eb6ba928be docs(release): prepare Studio 2.25.0 notes 2026-10-01 05:51:27 -07:00
Harbor404 b47f9144a8 Merge remote-tracking branch 'origin/studio' into ci-reasonix-11504 2026-10-01 20:49:30 +08:00
Harbor404 82a06451dd fix(shell): reject a Store alias that will not start 2026-10-01 20:49:24 +08:00
YHH ac7836f048 Merge pull request #11592 from KHG420/codex/studio-review-refresh-order
fix(studio): keep review results after concurrent install refresh
2026-10-01 05:45:51 -07:00
Harbor404 b1f7ba5dd8 Merge remote-tracking branch 'origin/studio' into ci-reasonix-11504 2026-10-01 20:45:24 +08:00
YHH ac7d7be97d Merge pull request #11588 from Guan0923/codex/session-title-context-menu
fix(studio): 右键打开会话菜单并调整版本角标间距
2026-10-01 05:45:01 -07:00
Harbor404 c33429c731 Merge remote-tracking branch 'origin/studio' into fix/remote-open-absolute-workspace
# Conflicts:
#	internal/platform/remote/bootstrap/resolve_workspace_test.go
2026-10-01 20:44:49 +08:00
Harbor404 1e3bb12e68 Merge remote-tracking branch 'origin/studio' into fix/disabled-tools-followups 2026-10-01 20:42:20 +08:00
Harbor404 29d06f6064 fix(mcp): address disabled tool policy review 2026-10-01 20:41:43 +08:00
xiexian a2e20b8a2f fix(studio): preserve executable bits in exported plugins 2026-10-01 20:34:59 +08:00
YHH 0be8aaf783 Merge pull request #11488 from esengine/fix/host-session-sweep-off-boot-path
fix(serve): sweep session history in the background, not inside the build
2026-10-01 05:25:29 -07:00
YHH 1c12f7c174 Merge pull request #11563 from esengine/fix/inbox-skip-requeues
fix(inbox): a skipped question requeues the guidance queued into its turn
2026-10-01 05:15:47 -07:00
esengine 07b2453403 fix(serve): sweep session history in the background instead of inside the build
Every runtime build ran ReconcileCleanupPending inline: a handful of stat and
read calls per transcript in the session directory. On a Windows box with 8000
sessions the sweep took 11 s of an 11.8 s build and 29 s at 20000 sessions
(about 1.4 ms per session, warm), and it sits before the host handshake, so a
cold start with a large history waits on it. The shell gave up at 20 s.

The Studio host, hub.Open, workspace switch and rebuild paths now hand boot a
reconciler that runs the sweep in a goroutine, once per directory at a time.
8000 sessions: build 11.8 s -> 1.0 s.

Refs #11434
2026-10-01 05:14:42 -07:00
xiexian b619b3dbfe fix(studio): scope author package views to the current account 2026-10-01 20:14:15 +08:00
YHH 4cdd4bde93 Merge pull request #11541 from esengine/fix/remote-open-absolute-workspace
fix(remote): a Windows absolute workspace is not joined after the remote home
2026-10-01 05:09:56 -07:00
挽风 8ac91c3399 fix(studio): make onboarding layout follow zoom-adjusted width 2026-10-01 20:05:59 +08:00
esengine 9fc7f5022c fix(inbox): a skipped question requeues the guidance queued into its turn
Skipping an ask ends the turn through the same cancel as the stop button, so
guidance the user had queued into it was held uncertain and the queue paused.
The cancel now carries a typed cause: only the user declining a question
returns the undelivered item to the queue as an ordinary follow-up and lets
dispatch continue. Stop, errors and crashes keep the pause, and a stop that
lands after a skip still wins. The requeue only moves an accepted steer, so a
repeat delivers nothing twice.

Refs #11524
2026-10-01 05:03:36 -07:00
xiexian 7d6687d03b fix(studio): refresh inventory after review submission 2026-10-01 19:53:38 +08:00
YHH af710d8784 Merge pull request #11585 from esengine/fix/add-source-name-inline
fix(studio): show the source name rule beside the field, not as a connection failure
2026-10-01 04:46:51 -07:00
Guan09 723b2b8ef2 fix(studio): 右键打开会话菜单并调整版本角标间距 2026-10-01 19:35:36 +08:00
esengine 3afb4dea49 fix(studio): explain an unusable source name beside the field, not as a connection failure
The add-source form only learned that a name such as a Chinese one is not
allowed after the kernel refused the save, and then showed the refusal under
the title "cannot connect". The name rule now shows inline as the name is
typed (with the allowed characters stated), the add button waits for a usable
name, coded name refusals from the kernel land on the field, and any other
failed save is titled as a save failure. The identifier rule is unchanged.

Reported through in-app feedback FB-WJ8B-C1XH.
2026-10-01 04:34:52 -07:00
YHH 79b0547997 Merge pull request #11533 from esengine/feat/project-reveal-menu
feat(desktop): show a project's folder in the file manager from the sidebar menu
2026-10-01 04:25:14 -07:00
xiexian 3f35e37388 feat(examples): add a runnable stdio MCP plugin 2026-10-01 19:14:56 +08:00
YHH e6d0d4aebe Merge pull request #11545 from esengine/fix/tray-icon-blurry
fix(studio): sharpen the Windows tray icon at scaled displays
2026-10-01 04:13:59 -07:00
esengine 7b7e09fdcd fix(serve): touch the disk only with the window's own listed root
Refs #11524
2026-10-01 04:13:47 -07:00
xiexian 4d9ba18ae0 fix(studio): serialize own-package review submissions 2026-10-01 18:44:17 +08:00
YHH 631bd6b111 Merge pull request #11419 from BuGlessRB/open/diff-fence-stream-perf
fix(cli): colour a streaming diff fence hunk by hunk / 修复(cli):流式 diff 围栏逐 hunk 着色
2026-10-01 02:57:08 -07:00
YHH 7ac760e44d Merge pull request #11558 from KHG420/codex/studio-market-vote-retry
fix(studio): retry failed market vote lookups
2026-10-01 02:56:13 -07:00
YHH 9dcfdf2e7c Merge pull request #11565 from esengine/fix/onboarding-scroll
fix(studio): make the first-run connect card scroll in short windows
2026-10-01 02:35:06 -07:00
esengine cac890152a feat(share): let the phone-access LAN link use a fixed port
An optional user-level [serve] share_port makes the direct link listen on a
chosen port instead of a random one. Unset keeps today's behaviour. The range is
1024-65535, a project reasonix.toml cannot set it, and the bind range is
unchanged. A taken port is a typed refusal (share.port_in_use). The settings
page saves it to the user config; changing it moves an open door and
phones re-pair.

Refs #11540
2026-10-01 02:31:52 -07:00
YHH f86eb89b74 Merge pull request #11559 from esengine/fix/cancel-flag-follow-up
fix(control): flag a turn cancelled only when it ended on the cancel sentinel
2026-10-01 02:30:14 -07:00
esengine 6292d66e90 fix(studio): make the first-run connect card scroll in short windows
The onboarding stage only had a min-height, so it grew with its content and
never overflowed itself while the body clipped it. Once the connection result
was showing, the Start button sat below the window with nothing to scroll.
The stage is now the window's height and scrolls; the shell no longer shrinks
or acts as a scroll container. Adds a browser guard (perf/onboarding.mjs).
2026-10-01 02:24:17 -07:00
YHH 3bb9dce90a Merge pull request #11562 from esengine/docs/hooks-guide
docs: add a Hooks section to the guide and reasonix-guide skill
2026-10-01 02:23:54 -07:00
Harbor404 ef8c8cbfb0 fix(studio): refresh provider build identity on same selection 2026-10-01 17:20:04 +08:00
Harbor404 a0d1380335 Merge origin/studio into feat/effort-model-same-switch-fastpath 2026-10-01 17:20:03 +08:00
YHH 5d3a70950c Merge pull request #11552 from esengine/fix/11524-notices-localized
fix(notices): word the context-budget and unapplied-guidance notices from typed codes
2026-10-01 02:19:11 -07:00
esengine a27298c462 docs: document hooks (events, settings.json schema, exit codes, scope)
A model told a user that Reasonix has no hooks. The guide's hooks section only
covered SessionStart, and the bundled reasonix-guide skill had no settings
schema, exit-code convention or worked example.
2026-10-01 02:14:37 -07:00
YHH f84126a76f Merge pull request #11555 from esengine/fix/inbox-block-code
fix(inbox): carry why a queue item stopped as a typed code the desktop words itself
2026-10-01 02:09:05 -07:00
Stephen R. van den Berg e8c7feeeef fix(cli): colour a streaming diff fence hunk by hunk
A ```diff fence rendered through the colourised built-in path on every
frame, and a colourised row costs ~1.4 ms to lay out (chroma via
regexp2) against ~1.3 µs for a plain one. While a fence streams every
delta re-renders the whole growing body, so a multifile diff pegged a
core and the display crawled. Changes:

- Each "@@ " hunk header settles the rows before it, so render that
  prefix and leave only the in-progress hunk on the plain rail: the diff
  colours in as it streams instead of only at the closing fence. A
  closed fence settles the whole body. The formatter runs on each
  settled prefix too, so its output appears hunk by hunk.

- Keep the already-formatted rows on screen while a settled body's run
  is pending: growing the body by one hunk changed its key and redrew
  the whole section on the plain rail until the new run landed, so the
  delta output flashed back to plain at every hunk. The renderer now
  draws the largest settled prefix whose result has landed and leaves
  only the newly settled remainder (and the in-progress hunk) on the
  rail.

- Memoize the colourised rows per hunk (hunk, path, width, rail, theme).
  A completed hunk never changes, so it is highlighted once however many
  frames redraw it; caching the whole body instead would re-highlight
  every earlier hunk at each "@@ " and is quadratic in the hunk count
  (measured: 60 hunks, 79 KB took 40 s with a body memo, 2 s per-hunk).
  The theme is in the key so a runtime theme switch cannot serve the old
  palette's colours.

- A fence still with fewer than two hunks keeps the plain rail, and a
  closed fence whose configured [cli].diff_formatter result is still
  pending also draws the rail, since that output supersedes the built-in
  rows anyway; a landed-but-failed run falls back to the built-in.

- Hold the transcript viewport still when the content shrinks: a settled
  diff collapsing its raw preamble to one formatted line frees rows at
  the bottom, and following them back up made the screen jump. The
  position now holds, the freed rows stay blank, and later rows fill
  them, so scrolling resumes only when the output actually grows past
  what is shown. The hold has only a lower bound, so a shrink larger
  than the viewport would hold the position past the content and blank
  the whole transcript — a collapsing multifile fence, or /clear
  restarting over a shorter one — so the view re-anchors to its tail
  instead. A manual scroll or resize releases the hold.

- Coalesce the stream frames the TUI hands the model: waitUpdate drains
  everything already queued into one updateMsg, so a burst of deltas
  costs one render instead of one per delta. Order is kept and a Gap
  still triggers a history reload.

- Fix the file-header misdetection: a removed SQL "-- x" line renders
  "--- x", which trimDiffPreamble/diffSectionStart mistook for a
  "--- "/"+++ " file header, dropping the "@@" hunk header (line numbers
  reset to 0) or the rows themselves when a removed "--- x" sat before
  an added "+++ y". A pair is a file header only when a "@@ " hunk
  follows it, and countDiff no longer skips "--- "/"+++ " rows.

- Keep a streaming multi-file diff's next file header on the plain rail:
  splitAtLastHunk settled everything before the last "@@ " header, which
  included the next file's "--- "/"+++ " pair (and its git preamble) once
  that file's first hunk header had arrived but no hunk of it had
  completed. isFileHeaderPair then saw no "@@ " after the pair, so the
  settled renderer read it as a removed/added row of the previous file's
  last hunk and counted it in that file's stat. A trailing dangling file
  header now moves from the settled part into the tail until its "@@ "
  arrives.

Tests: the multi-file cases TestSplitAtLastHunk was missing and an
end-to-end streamed test; a theme-switch test pinning the per-hunk memo's
theme key; and a benchmark replaying a 4-file x 15-hunk stream, redrawn
per streamed line.

fix(cli): highlight a streaming diff fence's hunk once

splitDiffSections appends a newline to every section, so splitHunks
returns a section's last hunk with a trailing newline and every earlier
hunk without. hunkRowsCached keyed the memo on the raw hunk, so one hunk
carried two keys over a stream: it was highlighted once while it was its
section's last hunk and again once a following hunk arrived. Every hunk
but a file's last was therefore highlighted twice, at ~1.4 ms a row.

Trim the trailing newline before keying. diffBody already trims, so the
rendered rows are unchanged; the streaming benchmark over a 4-file,
30-hunk, 1816-line diff drops from 7.8 s to 5.6 s.

TestStreamingDiffHunkMemoisedOnce pins one memo entry per hunk: it sees
three entries for two hunks before this change, two after.

Fold the writer-tool preview before highlighting it too. diffBody laid
out every row and then dropped all but maxLines, so a write_file card's
~24-row preview colourised the whole diff: ~772 ms per repaint for a
199-line file, paid on every message while the call runs. Counting the
fold from the source and laying out only the kept rows prices a
2000-line diff like a 24-line one.

BenchmarkDiffBlockPreview prices both shapes through a diffPreviewFold
seam, which TestDiffBodyFoldSeamSameRows proves draws the same rows: a
2000-line preview is 6.3 s and 86 MB with the whole body laid out, 71 ms
and 1.0 MB folded, and flat from 24 lines up.

docs(cli): correct diff-fence comment coherence

Four comments described behaviour the code does not have:

- diffRowCount's doc counted one row per non-blank line, but diffBody draws no
  row for a "@@ " header, so it over-counted by the hunk count.
- renderCodeRail's doc claimed the in-progress hunk and the pending-formatter
  placeholder, both drawn by renderRailText, not here.
- splitDiffSections' doc named only the fence path, omitting DiffText, and
  described the plain-rail fallback where DiffText drops a headerless section.
- the file header claimed md.go still sits at the 800-line ceiling.

Reword each to the constraint that holds now.
2026-10-01 11:01:45 +02:00
esengine f836dc6a3a fix(inbox): carry why a queue item stopped as a typed code the desktop words itself
A held queue item showed the kernel's English diagnostic (for example
"steer accepted but unapplied before turn exit") in a Chinese UI. Items now
also carry a stable BlockCode and the desktop words it in the UI language;
unknown codes fall back to the diagnostic.
2026-10-01 01:56:28 -07:00
YHH 69cb060066 Merge pull request #11548 from esengine/fix/storage-move-keeps-project-list
fix(storage): carry the remembered project list when the state root moves
2026-10-01 01:48:11 -07:00
esengine 6328dfa0b5 fix(control): flag a turn cancelled only when it ended on the cancel sentinel
A real failure that raced the stop button was reported as a cancellation and
hidden. TurnDone.Cancelled now requires Err to be nil or context.Canceled. The
desktop also reads "Cancelled" instead of "Interrupted" after the user's own
cancel.

Refs #11524
2026-10-01 01:43:02 -07:00
xiexian 9bb0aa28fd fix(studio): retry failed market vote lookups 2026-10-01 16:34:22 +08:00
YHH 3a754cebdb Merge pull request #11547 from KHG420/codex/studio-skill-author-invocation-comment
docs(skill): clarify authoring invocation policy
2026-10-01 01:34:04 -07:00
esengine 6694a1b81a fix(storage): carry the state root's loose entries when it moves
Settings > Storage moved sessions and projects but left other top-level state
behind while the code reads only the new root: the remembered project list
(serve-workspaces.json), user-level REASONIX/AGENTS/CLAUDE instructions,
memory/global, schedules, trusted seals, machine-id.key and the MCP migration
marker. All are now owned entries, so a move carries them.

Installs already moved get them back at boot: each entry is merged once without
overwriting and the old copy is renamed *.adopted. The project list is merged
under its lock and written atomically by a new leaf package shared with serve,
and file copies publish whole files. A guard test scans the tree for paths
joined under the state root so a future entry cannot be forgotten.
2026-10-01 01:33:31 -07:00
YHH 003000be21 Merge pull request #11532 from KHG420/codex/studio-publish-draft-lock
fix(studio): keep the publishing draft stable while submitting
2026-10-01 01:29:07 -07:00
Harbor404 fceb6b8ab9 Merge latest studio into UNC round-trip fix 2026-10-01 16:23:00 +08:00
YHH 92a1677fda Merge pull request #11551 from esengine/fix/11524-cancel-not-error
fix(desktop): do not draw a user-cancelled turn as an error card
2026-10-01 01:22:05 -07:00
Harbor404 0a5e45417d Merge latest studio into UNC round-trip fix 2026-10-01 16:21:05 +08:00
esengine e4f1f80a76 fix(notices): word the context-budget and unapplied-guidance notices from typed codes
Both host notices reached every frontend as kernel English, so a Chinese UI
showed an English card. The context-budget notice now carries a code and a JSON
figures payload, the unapplied-guidance notice carries the user's text as
Detail, and the desktop card and the TUI word them from those in the UI
language. Unknown codes and undecodable payloads still fall back to the
kernel's text.

Refs #11524
2026-10-01 01:20:40 -07:00
xiexian 552209fa46 docs(sdk): add an installable tool extension example 2026-10-01 16:16:56 +08:00
xiexian 8fdfb89127 docs(sdk): align fullsidecar demo guidance 2026-10-01 16:11:25 +08:00
YHH 9ced3d1577 Merge pull request #11542 from KHG420/codex/studio-fullsidecar-host-proof
docs(sdk): add fullsidecar installation and host checks
2026-10-01 01:04:54 -07:00
Harbor404 d6e0505dc6 chore(remote): narrow this PR to the UNC round trip 2026-10-01 16:02:51 +08:00
Harbor404 42f42d2d19 fix(acp): keep queued config order on no-op switches 2026-10-01 16:02:04 +08:00
Harbor404 e2b6e8fd31 Merge remote PR history into rebased branch 2026-10-01 15:57:36 +08:00
Harbor404 fe4b15b2f6 fix(remote): open absolute Windows workspaces from tree 2026-10-01 15:57:23 +08:00
esengine 5caa03eca1 fix(desktop): do not draw a user-cancelled turn as an error card
Skipping an ask (or stopping a turn) ends it with the kernel's Cancelled flag
set and context.Canceled as Err. The transcript appended Err as an error card
regardless of the flag, so the user's own choice read as "context canceled".
The flag is the identity; Err is not drawn when it is set. An effect test pins
the kernel side through boot.Build.

Refs #11524
2026-10-01 00:45:03 -07:00
xiexian 309ea9aa0f docs(skill): clarify authoring invocation policy 2026-10-01 15:42:19 +08:00
Harbor404 dd73c2159c perf(studio): skip rebuilds for unchanged model or effort 2026-10-01 15:37:50 +08:00
xiexian 15155c3a67 fix(studio): keep the publishing draft stable while submitting 2026-10-01 15:36:14 +08:00
esengine 7f7a063139 fix(studio): give the Windows tray icon a file at exactly the size Windows asks for 2026-10-01 00:36:08 -07:00
YHH 8c608c8bba Merge pull request #11523 from KHG420/codex/studio-skill-dependency-guide
docs(skills): explain and verify MCP dependency readiness
2026-10-01 00:33:50 -07:00
YHH e9a863c36d Merge pull request #11304 from Guan0923/codex/user-message-copy
feat(studio): 重设计用户消息操作栏并新增复制功能
2026-10-01 00:30:47 -07:00
YHH 0d30c68641 Merge pull request #11528 from KHG420/codex/studio-source-disabled-style
fix(studio): distinguish the busy plugin source without fading text
2026-10-01 00:27:32 -07:00
YHH dc8f746f5e Merge pull request #11537 from KHG420/codex/studio-skill-invocation-comment
docs(skills): distinguish manual listing from model invocation
2026-10-01 00:26:38 -07:00
Harbor404 8f5768e118 fix(remote): open absolute Windows workspaces from tree 2026-10-01 15:26:08 +08:00
Harbor404 277f5614a8 Merge remote-tracking branch 'origin/studio' into ci-reasonix-11504 2026-10-01 15:25:45 +08:00
YHH f6d948c60b Merge pull request #11522 from KHG420/codex/studio-export-result-lifecycle
fix(studio): keep package export feedback current and visible
2026-10-01 00:25:07 -07:00
esengine b2f36909eb fix(remote): a Windows absolute workspace is not joined after the remote home
resolveWorkspace only knew a leading slash as rooted, so a drive-letter path such as C:\Users\u\x (what the remote tree reports as a project root) was appended to home and the serve never started. Rootedness is now asked of the target machine.
2026-10-01 00:24:00 -07:00
Harbor404 12e6f9d3ae Merge fork/fix/powershell-shell-probe after studio rebase 2026-10-01 15:20:35 +08:00
xiexian b5f2f0c025 test(extensions): verify installed fullsidecar host effects 2026-10-01 15:14:53 +08:00
Harbor404 439e868ed3 style(boot): trim shell diagnostic comment 2026-10-01 15:12:11 +08:00
Harbor404 de5ba24bcc fix(boot): log the resolved shell at debug level
Headless `run` must leave stderr empty unless --debug is passed, so the
boot record of the resolved shell interpreter cannot be an Info log. It is a
diagnostic; the always-on counterpart is the Warn shellrun emits when a
launch actually fails.
2026-10-01 15:12:11 +08:00
Harbor404 ac2db59a33 fix(shell): keep the PowerShell probe within lint budgets
Trim repolint comment blocks and move launch-failure logging out of RunForeground so the function stays within the 120-line limit. No behavior change.

Signed-off-by: Harbor404 <[email protected]>
2026-10-01 15:12:11 +08:00
Harbor404 bac803e68c fix(shell): only trust a PowerShell that starts, and record which ran
A pinned [tools.shell] path was honoured on existence alone, so a pwsh.exe
that stats fine but will not start was held for the whole session while every
command failed at launch — the failure #10633 reported, still reachable
through the pinned-path branch after #10617 reworked auto-detection.

- Prove a pinned PowerShell the way the bash arm already proves its own, and
  fall back to detection with a warning when it will not start.
- VerifyShell proves a pinned PowerShell too, so the settings screen refuses
  one where it was typed rather than on every later command.
- powerShellLaunches answers false for a path that is not there: a missing
  executable is not launchable, so callers that gate on it alone now agree.
- resolveShell takes the launch probe as an argument, which puts the decision
  table ("pwsh will not start, 5.1 will") under test on any host.
- Detection that finds nothing says so instead of silently returning bare bash.
- Boot records the interpreter the session resolved to, and a launch-phase
  spawn failure records the shell, its path, the caller and the error. The
  desktop relays the sidecar's stderr into desktop-shell/logs/, which the
  report found empty.

Windows end-to-end is not verified locally; the fallback is covered by the
injected probe on Linux and macOS.
2026-10-01 15:12:11 +08:00
YHH c9daeddf3e Merge pull request #11530 from esengine/fix/editmenu-locale
fix(electron): label the edit menus in the interface language
2026-09-30 23:52:52 -07:00
xiexian 8dd9294495 docs(skills): distinguish manual listing from model invocation 2026-10-01 14:48:59 +08:00
esengine f2dc940a29 test(desktop): cover the host-only route, remote projects and old shells
Refs #11524
2026-09-30 23:47:02 -07:00
xiexian 9d930f67f4 docs(skills): explain and verify MCP dependency readiness 2026-10-01 14:45:56 +08:00
esengine c0766fbe59 fix(electron): keep every platform Edit menu item, test the rebuild rule
The hand-written Edit menu dropped Paste and Match Style, Delete,
Substitutions and Speech; restore them with the same roles (structure checked
against the role-based menu in a real Electron). The menu factory is now
Electron-free and unit-tested, the language follows the first preferred system
language like the page, and the redundant second menu install is gone.

Refs #11524
2026-09-30 23:45:39 -07:00
Guan09 73e2fb91af fix(studio): restore action hit areas and unify hover feedback 2026-10-01 14:43:36 +08:00
xiexian 4df81041b1 fix(studio): dim the busy plugin source input 2026-10-01 14:41:29 +08:00
YHH 4bcda5691d Merge pull request #11511 from KHG420/codex/studio-skill-catalog-guide
docs(skills): explain the catalog projection and cache boundary
2026-09-30 23:32:07 -07:00
esengine 383e6369ac refactor(desktop): read the shell's ability to reveal from the host, not the hub 2026-09-30 23:30:59 -07:00
esengine 6bb625fcf7 fix(desktop): extract the reveal menu item, add refusal wording 2026-09-30 23:22:30 -07:00
YHH 8d963086ea Merge pull request #11529 from esengine/feat/subagent-bg-rows
feat(studio): sub-agent transcript entry in the deck, show-all for clipped nested output
2026-09-30 23:21:57 -07:00
esengine 85df91d4ef feat(desktop): show a project's folder in the file manager from the sidebar menu
The project menu offered only sort and remove-from-list. Add a reveal item that
asks the hub where a listed project lives (GET /host/workspaces/locate, window
only, refuses any folder the window does not list) and has the shell select it,
so it needs no open pane. Remote hosts draw in their own rail and never reach
this menu; a project whose folder is gone shows the item disabled with the
reason.

Refs #11524
2026-09-30 23:21:09 -07:00
xiexian af2dbb252d fix(studio): keep package export feedback current and visible 2026-10-01 14:15:30 +08:00
esengine 8de4b4851c fix(electron): label the edit menus in the interface language
Role-only menu items take their text from Electron's built-in English
catalogue even when the app locale is zh-CN (verified on a real Electron:
getLocale() == zh-CN, labels Undo/Cut/Copy/Paste/Select All). Keep the roles
for the clipboard work and give each item an explicit zh/en label chosen by the
page's saved language (rx-lang), falling back to the machine locale exactly as
the page does. The macOS Edit menu is rebuilt when the language preference
changes.

Refs #11524
2026-09-30 23:15:27 -07:00
esengine fb3d9d7433 fix(studio): register the new actions, trap focus in the transcript overlay, cap its output
Registers tool.show-all, agent.open, agent.close and agent.focus-trap, moves
focus into the overlay and back to the deck chip, caps the overlay's rendered
output at 200000 characters with a note, keeps the sub-agent count stable, wraps
nested output, and drops a stray .agents rule that changed the sidebar spacing.
2026-09-30 23:13:00 -07:00
Harbor404 0a2a8b15ed fix(boot): log the resolved shell at debug level
Headless `run` must leave stderr empty unless --debug is passed, so the
boot record of the resolved shell interpreter cannot be an Info log. It is a
diagnostic; the always-on counterpart is the Warn shellrun emits when a
launch actually fails.
2026-10-01 14:11:01 +08:00
YHH 66029c7dec Merge pull request #11521 from KHG420/codex/studio-plugin-export-refusal
fix(studio): preserve plugin export failure reasons
2026-09-30 23:07:39 -07:00
esengine 43b210573b feat(studio): sub-agent rows open a full transcript, and clipped nested output offers show-all
The sub-agent list stays after delegates finish and each row opens that
sub-agent's whole transcript. A nested call whose output exceeds the 400
character preview now says so with a show-all control instead of cutting.
2026-09-30 23:02:34 -07:00
xiexian 422b47b3a0 docs(skills): describe the turn-projected catalog 2026-10-01 13:39:24 +08:00
YHH d80c290d89 Merge pull request #11519 from KHG420/codex/studio-plugin-source-confirmation
fix(studio): keep the confirmed plugin source stable during preview
2026-09-30 22:29:28 -07:00
YHH 594cbf664a Merge pull request #11520 from KHG420/codex/studio-package-action-errors
fix(studio): expose failed package operations alongside diagnostics
2026-09-30 22:28:38 -07:00
YHH 7bb8031e85 Merge pull request #11514 from KHG420/codex/studio-shared-project-skill
docs(skills): verify sharing a project playbook across collaborators
2026-09-30 22:10:17 -07:00
xiexian 188df0245b fix(studio): preserve plugin export refusal details 2026-10-01 13:04:18 +08:00
xiexian c2df8e3ed6 fix(studio): reveal package action failures with diagnostics 2026-10-01 12:54:56 +08:00
xiexian 104d01ba07 fix(studio): keep plugin source stable during preview 2026-10-01 12:43:45 +08:00
YHH e977923203 Merge pull request #11509 from KHG420/codex/studio-mcp-partial-retry
fix(studio): preserve partial MCP installation results on retry
2026-09-30 21:34:17 -07:00
YHH 5450ed38e9 Merge pull request #11510 from KHG420/codex/studio-backup-plugin-owner
fix(studio): isolate plugin selections during backup restore
2026-09-30 21:33:27 -07:00
xiexian 3fcce85ca7 docs(skills): cover repository sharing and personal activation 2026-10-01 12:26:06 +08:00
Harbor404 1650571850 fix(shell): keep the PowerShell probe within lint budgets
Trim repolint comment blocks and move launch-failure logging out of RunForeground so the function stays within the 120-line limit. No behavior change.

Signed-off-by: Harbor404 <[email protected]>
2026-10-01 12:07:06 +08:00
xiexian d6cc51fe76 fix(studio): keep restored plugin installers with their selection 2026-10-01 11:50:07 +08:00
xiexian abca1a62c5 fix(studio): retain partial MCP outcomes and retry remaining servers 2026-10-01 11:45:26 +08:00
YHH b70b86e7a7 Merge pull request #11494 from esengine/fix/headless-trust-silence
fix(run): say why a headless run in an untrusted folder did nothing
2026-09-30 20:38:05 -07:00
xiexian 86f5ea0c5a fix(sdk): make starter interceptor work on composed inputs 2026-10-01 11:36:41 +08:00
YHH 754166fc32 Merge pull request #11502 from KHG420/codex/studio-plugin-install-confirmation
fix(studio): preserve new plugin confirmation during install
2026-09-30 20:34:00 -07:00
YHH 0aeb204660 Merge pull request #11500 from KHG420/codex/studio-mcp-install-controls
fix(studio): keep MCP install confirmation stable while pending
2026-09-30 20:33:10 -07:00
YHH 1fa7030ced Merge pull request #11499 from KHG420/codex/studio-mcp-partial-install-notification
fix(studio): refresh inventory after partial MCP installation
2026-09-30 20:32:20 -07:00
YHH 43661cdec1 Merge pull request #11498 from KHG420/codex/studio-mcp-install-connection
fix(studio): reset MCP installation state on connection changes
2026-09-30 20:31:30 -07:00
YHH e07bc5faa8 Merge pull request #11496 from KHG420/codex/studio-mcp-operation-owner
fix(studio): scope MCP row confirmations and responses
2026-09-30 20:30:40 -07:00
YHH a968fd8881 Merge pull request #11497 from KHG420/codex/studio-inspection-shortcut-guard
fix(studio): guard installation inspection shortcuts
2026-09-30 20:29:50 -07:00
YHH 420a9231c5 Merge pull request #11458 from KHG420/codex/studio-project-order-11420
feat(studio): persist manual project order without changing launch project
2026-09-30 20:29:00 -07:00
YHH 11b84e5891 Merge pull request #11481 from KHG420/codex/studio-frontend-page-example
docs(studio): add a local frontend delivery example
2026-09-30 20:28:10 -07:00
YHH 0495d1f294 Merge pull request #11485 from KHG420/codex/studio-author-settled-notification
fix(studio): preserve author install notifications after sign-out
2026-09-30 20:27:20 -07:00
YHH 0040dec2a0 Merge pull request #11486 from KHG420/codex/studio-runtime-reload-connection
fix(studio): scope runtime reload state to its connection
2026-09-30 20:26:31 -07:00
YHH 4b94a02c27 Merge pull request #11489 from KHG420/codex/studio-package-operation-connection
fix(studio): reset package operation state on connection change
2026-09-30 20:25:41 -07:00
YHH 28a9010d0e Merge pull request #11475 from KHG420/codex/studio-url-elicitation-11348
feat(mcp): support consent-based URL elicitation
2026-09-30 20:24:40 -07:00
xiexian 2b4d79ceb5 test(boot): cover copied command lifecycle at provider boundary 2026-10-01 11:22:34 +08:00
xiexian 37924b57e4 test(studio): verify installed hook context lifecycle 2026-10-01 11:09:51 +08:00
Harbor404 e69108a843 fix(mcp): preserve disabled tool policy
Project configuration could replace a user server entry and drop disabled_tools, while a stale call to a filtered tool was reported as unknown. Merge user and project disables, reject empty names, and carry a typed refusal through boot and hot-added MCP registration.

Move an existing contextual-tool helper unchanged so execute_one.go does not grow past the file-size ratchet.
2026-10-01 11:09:15 +08:00
Harbor404 9b5ca5ff71 fix(shell): only trust a PowerShell that starts, and record which ran
A pinned [tools.shell] path was honoured on existence alone, so a pwsh.exe
that stats fine but will not start was held for the whole session while every
command failed at launch — the failure #10633 reported, still reachable
through the pinned-path branch after #10617 reworked auto-detection.

- Prove a pinned PowerShell the way the bash arm already proves its own, and
  fall back to detection with a warning when it will not start.
- VerifyShell proves a pinned PowerShell too, so the settings screen refuses
  one where it was typed rather than on every later command.
- powerShellLaunches answers false for a path that is not there: a missing
  executable is not launchable, so callers that gate on it alone now agree.
- resolveShell takes the launch probe as an argument, which puts the decision
  table ("pwsh will not start, 5.1 will") under test on any host.
- Detection that finds nothing says so instead of silently returning bare bash.
- Boot records the interpreter the session resolved to, and a launch-phase
  spawn failure records the shell, its path, the caller and the error. The
  desktop relays the sidecar's stderr into desktop-shell/logs/, which the
  report found empty.

Windows end-to-end is not verified locally; the fallback is covered by the
injected probe on Linux and macOS.
2026-10-01 11:07:32 +08:00
xiexian 71fb27901b fix(studio): preserve new plugin confirmation during install 2026-10-01 10:42:52 +08:00
xiexian 223c55b95f fix(studio): keep MCP install confirmation stable while pending 2026-10-01 10:34:49 +08:00
xiexian d84543d259 fix(studio): refresh inventory after partial MCP installation 2026-10-01 10:17:49 +08:00
xiexian 0247623274 fix(studio): reset MCP installation state on connection changes 2026-10-01 10:05:31 +08:00
YHH 13f238e6f4 Merge pull request #11492 from KHG420/codex/studio-mcp-operation-guard
fix(studio): guard conflicting MCP row operations
2026-09-30 19:00:24 -07:00
YHH 0209b345a0 Merge pull request #11495 from KHG420/codex/studio-skill-operation-owner
fix(studio): scope skill operation results and refresh current inventory
2026-09-30 18:57:14 -07:00
esengine 8fa67e544e fix(run): say why a headless run in an untrusted folder did nothing
A run in a folder with no trust decision refused every edit and command
under the asking default and exited 0 with an empty stderr (plain text
run) and only the generic 'no interactive approver' reason for the model.

The refusal now carries permission.untrusted_folder. The model reads the
cause and the remedy, the text run prints refused tools, code and remedy on
stderr, the structured result's denial carries a remedy, and
--fail-on-unverified exits 3 for it. Exit 0 and the trust gate itself are
unchanged.

Refs #11493
2026-09-30 18:55:48 -07:00
xiexian fe850bc160 fix(studio): guard installation inspection shortcuts 2026-10-01 09:50:50 +08:00
xiexian f527fa023d fix(studio): scope MCP row confirmations and responses 2026-10-01 09:41:52 +08:00
YHH d98ae85fb0 Merge pull request #11490 from esengine/fix/feedback-reply-test-race
test(feedback): read the reply stub's hits under its lock
2026-09-30 18:34:38 -07:00
xiexian 687186fcdd fix(studio): scope skill results and refresh current inventory 2026-10-01 09:31:31 +08:00
xiexian d30fd833d9 fix(studio): guard conflicting MCP row operations 2026-10-01 09:08:42 +08:00
esengine 459c2ae5c4 test(feedback): read the reply stub's hits under its lock 2026-09-30 18:00:24 -07:00
xiexian 33199377da fix(studio): reset package operation state on connection change 2026-10-01 08:57:14 +08:00
xiexian 1f1c469b16 fix(studio): scope runtime reload state to its connection 2026-10-01 08:51:01 +08:00
xiexian 7fe57fc25a fix(studio): preserve author install notifications after sign-out 2026-10-01 08:43:39 +08:00
YHH 6cc249f1d4 Merge pull request #11482 from esengine/release/studio-2.24.0-notes
docs(release): Studio 2.24.0 release notes
2026-09-30 17:36:02 -07:00
xiexian e5a801c603 feat(studio): persist manual project order without changing launch project 2026-10-01 08:35:14 +08:00
esengine fe5ea48568 docs(release): Studio 2.24.0 release notes 2026-09-30 17:29:36 -07:00
YHH 3aa259f2e2 Merge pull request #11480 from KHG420/codex/studio-publish-connection-state
fix(studio): reset publish form when its owner changes
2026-09-30 17:26:57 -07:00
YHH ed9c424991 Merge pull request #11474 from KHG420/codex/studio-api-notes-example
docs(studio): add a local API documentation scenario
2026-09-30 17:26:07 -07:00
YHH 9328ef003a Merge pull request #11478 from KHG420/codex/studio-market-connection-state
fix(studio): refresh market state across runtime connections
2026-09-30 17:24:07 -07:00
xiexian 824f95613a feat(mcp): support consent-based URL elicitation 2026-10-01 08:19:31 +08:00
xiexian 03d5346869 docs(studio): add a local frontend delivery example 2026-10-01 08:15:01 +08:00
YHH 490f3d0bfe Merge pull request #11479 from esengine/fix/11434-host-handshake
fix(studio): wait longer for a cold kernel start, retry an early exit once, and name the cause
2026-09-30 17:03:11 -07:00
esengine 64c8aa5170 fix(studio): wait longer for a cold kernel start, retry an early exit once, and name the cause
The shell gave the kernel 20 s to handshake and reported every failure as a
sentence. The wait is now 60 s (REASONIX_STUDIO_HANDSHAKE_TIMEOUT_MS), a small
starting window appears after 3 s, an exit or spawn failure within 10 s is
retried once, and launch failures carry a typed code (timeout, exited, spawn,
overflow) with a matching explanation in the error box.

Refs #11434
2026-09-30 16:54:16 -07:00
xiexian 00d9c2e490 docs(studio): add a source-linked API guide example 2026-10-01 07:48:20 +08:00
xiexian ff1163da75 fix(studio): refresh market state across runtime connections 2026-10-01 07:47:55 +08:00
xiexian 6cd9593404 fix(studio): reset publish form when its owner changes 2026-10-01 07:44:43 +08:00
YHH b3d7dd50fc Merge pull request #11476 from KHG420/codex/studio-compatible-mcp-ownership
fix(studio): preserve package ownership on explicit MCP connection
2026-09-30 16:37:16 -07:00
YHH f8e541a86b Merge pull request #11466 from KHG420/codex/studio-author-apply-generation
fix(studio): isolate author install responses by connection
2026-09-30 16:35:26 -07:00
YHH b5ea839c94 Merge pull request #11446 from esengine/feat/feedback-replies-ui
feat(studio): reply threads, needs-input and unread badge in the feedback dialog
2026-09-30 16:07:35 -07:00
xiexian 4c8eda7344 fix(studio): preserve package ownership on explicit MCP connection 2026-10-01 06:59:24 +08:00
xiexian dfd8aac901 fix(studio): isolate author installs across connection changes 2026-10-01 06:56:28 +08:00
YHH f69e2c5798 Merge pull request #11472 from KHG420/codex/studio-issue-fix-example
docs(plugins): add a runnable repository issue exercise
2026-09-30 15:39:20 -07:00
YHH 1918bb4f55 Merge pull request #11357 from BuGlessRB/open/ask-autosubmit
feat(cli): auto-submit a fully answered ask batch, gated on auto_submit / 功能(cli):多题问询答完最后一题即自动提交,由 auto_submit 控制
2026-09-30 15:38:35 -07:00
YHH 53d21288df Merge pull request #11465 from KHG420/codex/studio-market-retry-focus
fix(studio): preserve focus through market read recovery
2026-09-30 15:36:09 -07:00
YHH 3c0c265c22 Merge pull request #11467 from KHG420/codex/studio-compatible-mcp-effect
test(plugins): cover compatible MCP install lifecycle
2026-09-30 15:15:30 -07:00
YHH e179b51c52 Merge pull request #11469 from KHG420/codex/studio-update-feedback
fix(studio): preserve applying updates across settings controls
2026-09-30 15:10:44 -07:00
YHH 28b6680353 Merge pull request #11468 from KHG420/codex/studio-disabled-mcp-tools-5444
feat(studio): support disabling individual MCP tools
2026-09-30 15:02:44 -07:00
xiexian 788d2b8d41 fix(studio): preserve keyboard focus across market read recovery 2026-10-01 05:54:19 +08:00
YHH f5e0d83f0d Merge pull request #11454 from KHG420/codex/studio-hook-event-labels-11383
fix(studio): localize automation event labels
2026-09-30 14:48:18 -07:00
xiexian 3b21d25de8 docs(plugins): add a runnable repository issue exercise 2026-10-01 05:42:27 +08:00
xiexian c3b51178cb fix(studio): preserve applying updates across settings controls 2026-10-01 05:26:48 +08:00
YHH 18df489e23 Merge pull request #11449 from KHG420/codex/studio-marketplace-subdir-11378
fix(studio): install git-subdir marketplace plugins
2026-09-30 14:16:47 -07:00
YHH 5598442a99 Merge pull request #11459 from KHG420/codex/studio-bundled-skill-effect
test(studio): verify copied skill references reach the provider
2026-09-30 14:15:50 -07:00
YHH 3b8bb5492b Merge pull request #11460 from KHG420/codex/studio-update-panel-guard
fix(studio): isolate inline package updates through apply
2026-09-30 14:13:47 -07:00
xiexian 1718074787 test(plugins): cover compatible MCP install lifecycle 2026-10-01 05:11:41 +08:00
xiexian bb013c4bc9 feat(studio): filter disabled MCP tools before registration 2026-10-01 05:09:47 +08:00
YHH 1cbd447539 Merge pull request #11456 from KHG420/codex/studio-author-read-races
test(studio): cover stale author package reads
2026-09-30 14:09:11 -07:00
Stephen R. van den Berg 5b609815c5 feat(cli): auto-submit a fully answered ask batch, gated on auto_submit
Answering the last question of a multi-question ask with nothing left
unanswered commits the batch immediately, skipping the extra confirmation
Enter; an incomplete batch jumps to the first unanswered question instead. The
behaviour is gated on a new top-level `auto_submit` option (default false):
with it on the ask drops its Submit tab, and without it the Submit tab is shown
and still needs its explicit Enter.

`auto_submit` is a user preference: LoadForRoot holds it across the project
merge so a cloned repository cannot turn it on, and neither the annotated
project render nor the project delta carries it. Answering moves on to the next
unanswered question, so answering one the panel was thrown back to skips ahead
to the next gap rather than stopping on the already-answered question that
follows it; only the last question, with nothing left unanswered, commits. With
auto-submit on there is no Submit tab to page onto, so right stops at the last
question rather than landing on a hidden tab that commits.

- config: new top-level auto_submit, user/global only; rendered in the user's annotated TOML and omitted from a project render and the project delta.
- tui: Options.AutoSubmit; nextQuestion advances to the next unanswered question and commits on the last; right stops at the last question instead of a hidden Submit tab.
- program_test.go: the commit, next-unanswered-after-skip-back, skipped-question, hidden-tab, no-option and arrow-stops-at-last cases.
- docs: auto_submit in CONFIG_PATHS.md, reasonix.example.toml, and the Guide shortcut tables (en and zh-CN).
2026-09-30 22:42:33 +02:00
Stephen R. van den Berg 0102bf3a6a refactor(config): split provider-source scope and the [ui] section into files
Move the providerSourceScope type out of config.go and the [ui] table render
out of render.go into their own files, so both sit under their recorded
repolint budgets with room for the options that follow.
2026-09-30 22:42:33 +02:00
YHH 873990724d Merge pull request #11445 from esengine/feat/feedback-replies-kernel
feat(feedback): reply threads, triage statuses and unread state in the client
2026-09-30 13:38:50 -07:00
xiexian 9d950f34bc fix(studio): describe automation events in the UI language 2026-10-01 04:38:08 +08:00
xiexian e9882d667e fix(studio): keep package updates isolated until apply settles 2026-10-01 04:27:31 +08:00
YHH 0af416ce89 Merge pull request #11453 from KHG420/codex/studio-install-preview-i18n
fix(studio): localize installation trust disclosures
2026-09-30 13:24:20 -07:00
YHH ee625f5e41 Merge pull request #11443 from KHG420/codex/studio-own-installed-entry
fix(studio): locate capabilities after author installs
2026-09-30 13:23:25 -07:00
xiexian d5a5a6e70f test(studio): verify copied skill references reach the provider 2026-10-01 04:13:52 +08:00
YHH 53b82d1362 Merge pull request #11442 from KHG420/codex/studio-market-retry
fix(studio): retry failed market list and detail reads
2026-09-30 13:10:30 -07:00
xiexian 5c78af6b09 fix(studio): install git-subdir marketplace plugins 2026-10-01 04:09:53 +08:00
xiexian dfbe776afb fix(studio): localize installation trust disclosures 2026-10-01 04:06:09 +08:00
xiexian 0056f8386b fix(studio): locate capabilities after author installs 2026-10-01 03:53:40 +08:00
YHH bf8210aebf Merge pull request #11439 from esengine/fix/skill-invocation-flags
fix(skill): honour disable-model-invocation, user-invocable and argument-hint
2026-09-30 12:53:16 -07:00
xiexian 88966f614f test(studio): cover stale author package reads 2026-10-01 03:46:07 +08:00
YHH 46542dd558 Merge pull request #11450 from KHG420/codex/studio-package-operation-guard
fix(studio): guard concurrent package operations
2026-09-30 12:36:43 -07:00
YHH 4376074c23 Merge pull request #11447 from KHG420/codex/studio-plugin-update-effect
test(studio): verify plugin updates replace MCP contributions
2026-09-30 12:35:53 -07:00
YHH ff6f93280e Merge pull request #11444 from KHG420/codex/studio-author-read-retry
fix(studio): retry failed author market reads
2026-09-30 12:34:57 -07:00
xiexian 651d2bd4df fix(studio): retry failed market list and detail reads 2026-10-01 03:32:43 +08:00
YHH d6eed9aee4 Merge pull request #11422 from esengine/feat/model-overrides-11392
feat(studio): per-model context window and max output in the provider form
2026-09-30 12:18:34 -07:00
YHH 695802235e Merge pull request #11435 from esengine/feat/feedback-ui
feat(studio): feedback dialog with screenshots, environment block and my-feedback list
2026-09-30 12:17:36 -07:00
esengine 5d786d6de0 feat(studio): reply threads, needs-input and unread badge in the feedback dialog
My feedback shows the thread under each report as plain-text bubbles, a
needs-your-input chip with an inline reply box (byte counter, errors per code),
status chips for answered and closed, and a New mark that stays for the visit
in which the replies were read. The sidebar entry and the command palette item
carry an unread count that is read when the app opens and when the page opens,
never on a timer. The form copy says a report becomes public only if it is
filed as an issue, and keeps the warning about secrets and screenshots.

Refs #11424
2026-09-30 12:16:20 -07:00
esengine 01a52ce15e feat(feedback): reply threads, triage statuses and unread state in the client
The kernel reads the new statuses (needs_info, answered, closed), each report's
thread and needsInput, keeps the last-seen reply id per report locally and
exposes unread/hasNew for an entry badge. A reply goes through the controller
port, serve (POST /feedback/{receipt}/reply and /seen) and the TUI
(/feedback show, /feedback reply with --yes as the first token). The new
worker codes become sentinels: feedback.reply_limit, feedback.not_replyable
and feedback.challenge_required. A reply is never retried. Thread text is
cleaned of escape sequences before any frontend sees it. Submit copy no longer
says every report becomes public.

Refs #11424
2026-09-30 12:16:12 -07:00
YHH ad99a35714 Merge pull request #11452 from esengine/ci/feedback-sync-workersdev
ci(feedback-sync): reach the worker through workers.dev
2026-09-30 12:13:05 -07:00
esengine 74318f9d49 ci(feedback-sync): reach the worker through workers.dev 2026-09-30 11:58:16 -07:00
esengine a237c5843e fix(skill): refuse user-only skills as task profiles and in capability routing 2026-09-30 11:43:20 -07:00
YHH fa85a69b9d Merge pull request #11448 from esengine/fix/feedback-sync-403-diag
fix(feedback): show the response origin and body snippet when the worker refuses the sync token
2026-09-30 11:42:27 -07:00
xiexian 1320621cbe fix(studio): guard concurrent package operations 2026-10-01 02:37:10 +08:00
esengine c116fd76ec fix(feedback): show the response origin and body snippet when the worker refuses the sync token 2026-09-30 11:32:11 -07:00
xiexian e3ae0e78ab test(studio): verify plugin updates replace MCP contributions 2026-10-01 02:27:33 +08:00
YHH 6d9266fc8e Merge pull request #11440 from esengine/feat/feedback-sync-replies
feat(feedback): mirror reporter replies, publish only released items and images
2026-09-30 11:18:25 -07:00
xiexian d2a86112a4 fix(studio): retry failed author market reads 2026-10-01 02:14:44 +08:00
esengine d08999485a feat(feedback): mirror reporter replies to their issue, publish only released items and images
The worker now holds new submissions by default. The converter still
creates issues only for received items, links only images the worker marks
released, and posts one idempotent bot comment per reporter reply on items
that have an issue, then acks it. Contact is never read by the converter,
which a test pins.

Refs #11424
2026-09-30 10:52:34 -07:00
YHH 42ef9dd191 Merge pull request #11438 from esengine/fix/remote-error-diagnosis-studio
fix(remote): classify relay connection failures and show the specific cause
2026-09-30 10:00:04 -07:00
esengine cf2146408a fix(skill): honour disable-model-invocation, user-invocable and argument-hint 2026-09-30 09:53:07 -07:00
esengine 226984ba69 fix(remote): say why a relay connection failed instead of one generic sentence
A browser cannot read the status of a refused WebSocket upgrade, so a
rate limit, a refused origin, an expired ticket, a network loss and an
unreachable gateway all read as "relay temporarily unavailable". When the
socket errors before opening, one probe round (offline check, the gateway
health route, and an attachment preflight that only an allowed origin passes)
now classifies the failure by typed code; a 429 from the account service
carries its Retry-After. The notice names the cause, offers reconnect
(counting down a rate limit), and a reconnect that runs out of retries ends
with the last attempt's cause, or idle when the relay had reclaimed the
lease. The generic sentence remains only when the probe itself fails.
2026-09-30 09:51:57 -07:00
YHH f309fed993 Merge pull request #11432 from esengine/feat/feedback-client
feat(feedback): in-app feedback client, controller port, serve endpoints, TUI /feedback
2026-09-30 09:07:05 -07:00
esengine 6db27d94ae feat(studio): feedback dialog with screenshots, environment block and my-feedback list
Refs #11424
2026-09-30 08:52:25 -07:00
esengine f72102c8a6 feat(feedback): in-app feedback client, controller port, serve endpoints and TUI /feedback
Adds internal/platform/feedback: env collection, local redaction (the
crashreport implementation, now exported), image re-encode with a metadata
self-check, idempotent submit with retry, persisted install identity and
receipts, and GET /v1/feedback/mine with typed sentinel errors.

The controller exposes it as the Feedback port (SessionAPI), serve answers
GET /feedback/env, GET /feedback/mine, POST /feedback and POST /feedback/name
with dotted refusal codes, and /feedback [list|name|<category> --yes <text>]
is a controller slash command so the TUI inherits it. Nothing reaches a model
request or the cache-stable prefix.

Refs #11424
2026-09-30 08:45:43 -07:00
YHH 7733545274 Merge pull request #11427 from esengine/feat/feedback-sync
ci(feedback): converter and status sync for in-app feedback
2026-09-30 08:25:58 -07:00
YHH fa39e7db7f Merge pull request #11379 from chuiwenwei/feat/studio-index-corpus-v2
feat(bench): give the index corpus a measured efficiency substrate
2026-09-30 08:20:39 -07:00
YHH 21b3b35210 Merge pull request #11423 from esengine/fix/11421-git-bash-discovery
fix(sandbox): find Git Bash outside Program Files when a WSL bash shadows it on PATH
2026-09-30 08:04:41 -07:00
esengine 714c4dc935 ci(feedback): sync in-app feedback into issues and report status back
Adds a scheduled converter (scripts/feedback-sync.mjs) that turns pending
Studio feedback into issues, idempotently via a hidden marker, and reports
in_progress/fixed/wontfix/duplicate back to the worker. A fix recorded as
"next" is upgraded to its studio-v tag once the tag exists.
2026-09-30 08:04:34 -07:00
Guan09 a2a429e3aa fix(studio): tighten user message action spacing 2026-09-30 23:02:44 +08:00
esengine 85810c192d fix(sandbox): find Git Bash outside Program Files when a WSL bash shadows it on PATH
exec.LookPath returns only the first bash.exe on PATH, which is normally the
WSL launcher in System32, and the fallback list covered only the default
Program Files roots. A Git for Windows install elsewhere (with just its cmd
directory on PATH) was therefore never detected, so Studio offered PowerShell
only. Candidates now also come from every PATH directory and from the Git
tree the git.exe on PATH belongs to, and the WSL launcher is rejected in the
candidate loops too.

Fixes #11421
2026-09-30 07:51:57 -07:00
Will 5e2985ab6f feat(bench): fill the index substrate with six tasks that hold on both arms
Screened 87 candidates, staged: one pass over the pool, then two more only for
the candidates that were clean on both boundary arms. The six that held on both
arms in all three passes stay, the rest are dropped, so the efficiency substrate
only contains tasks that qualify:

  quarter  i62-epochlatch, i37-dispatchlag
  half     i106-budgetseal, i70-ingestfloor
  default  i47-tenantlease, i51-routedelay

All six are SnippetStop, SnippetThenRead or DefensiveRead in each of their
eighteen judged cells - nothing post-sufficient.

What the screening found: the answer kind decides whether a candidate holds.
Half-tier candidates whose answer was a bare number never survived (0 of 8);
the same tier with a codename answer survived 11 of 20. The dirty class in both
cases was PostSufficientRetrieval - the model re-checking a value it already had
- so the shape that needs no checking is the one that holds.

Also: i07 and i10 were re-measured after the review asked for it (their old
numbers came from the grep shape they no longer use), NeverSufficient is
reported separately rather than counted as clean, and the i11/i12 rows are gone
because those tasks are not in the corpus.
2026-09-30 22:49:27 +08:00
YHH 6f5c150339 Merge pull request #11425 from esengine/fix/11418-studio-launch-workspace
fix(studio): do not open the app's own install folder as the first workspace
2026-09-30 07:40:21 -07:00
YHH 46c784ba5e Merge pull request #11402 from esengine/ci/studio-cli-pointer
ci(release): studio writes the CLI update pointer the installed updaters read
2026-09-30 07:31:32 -07:00
esengine fb3a57133b fix(studio): do not open the app's own install folder as the first workspace
The host took its working directory as the first pane's project. A Start menu
launch inherits the install directory and a Finder launch the filesystem root,
so the app's folder was listed in the sidebar again after every removal. The
directory now counts only when it is outside the app's own directory and not a
filesystem root; otherwise the first remembered folder that still exists is
opened, then the home directory.

Fixes #11418
2026-09-30 07:22:40 -07:00
esengine b5b91b1c71 feat(studio): set context window and max output per model on a provider
The provider form only edited one window and one output cap for every model
on a connection. model_overrides already carried both per model and the
kernel resolves them for requests and compaction, so the edit endpoint and
the form now read and write them.

A model with no entry inherits the connection's value, shown as a grey
placeholder; a blank field is never sent as an override, and clearing one
removes the entry.
2026-09-30 07:19:36 -07:00
esengine 7db17aff95 ci(release): studio writes the CLI update pointer the installed updaters read
A cli-pointer job publishes the Studio release's CLI archives as a GitHub
release vX.Y.Z (the only shape the 1.x updater accepts), records it
immutably in R2, then advances cli/{stable,preview}/latest.json. It reuses
the 1.x manifest validators and pointer ordering, only moves forward, and
is gated by STUDIO_PUBLISHES_CLI.

cli-gate requires CLI_PUBLISH_FROZEN so two lines never write the CLI
channels. cli-tag creates the vX.Y.Z tag with the release tag identity in
one inline step of a job that runs no repository code. An existing release
is trusted on its own checksums, never compared with a rebuild.
2026-09-30 07:16:14 -07:00
YHH e29dad555f Merge pull request #11417 from esengine/feat/scheduled-exec-3c
fix(schedule): close the remaining review findings before the ticker lands
2026-09-30 06:14:01 -07:00
esengine 539f2368e9 fix(schedule): close the remaining review findings before the ticker lands
- The host creates the schedule store directory (0700) before a command's
  sandbox is built, so the forbid-read mask exists for it on Linux and on macOS
  paths that go through a symlink.
- Document in schedule/doc.go that the confirmed digest defends only against
  sandboxed writers (Windows, sandbox off, yolo and MCP/plugin processes can
  still write the store).
- Only the model's own usage report for an executor request counts toward
  metering; estimates and side calls no longer let unmetered requests slip past.
- The job handle is released on the ready-refused, ready-timeout and cancelled
  paths.
- A stored session path must be a .jsonl file in a sessions directory under the
  state root.
- Tests: the report's untrusted mark, the stderr sanitising, the supervisor
  watch that cancels and forces the process out, and bubblewrap tests for the
  forbidden-directory mask. The child's own state check is dropped; Start
  refuses a run that is not running.

Refs #11406
2026-09-30 06:01:41 -07:00
YHH eb4641d630 Merge pull request #11416 from esengine/feat/scheduled-exec-3b
fix(schedule): close the review findings on the supervised child
2026-09-30 05:57:01 -07:00
esengine e51f8f59f6 fix(schedule): close the review findings on the supervised child
- A run whose provider reports no usage is stopped after two unreported
  requests and charged the whole per-run cap instead of 0.
- The start of a run is one manifest transition guarded by a token that only
  travels over the supervisor's pipe (its hash is what the manifest holds); the
  child announces it holds the run's lease before it is released, and the
  supervisor holds a supervision lock from before the spawn until the run is
  settled, so the reaper never sees a gap.
- The read-only posture runs no config migration, so it rewrites no config file.
- Seatbelt denies writes as well as reads under forbid-read directories, as the
  bubblewrap mask already did, so a blind overwrite of the schedule store fails.
- Windows refuses to run a child that a Job Object cannot hold; the job handle is
  released; a child whose supervisor left is forced out after a grace period.
- The stored report is marked untrusted, the session path must lie under the
  state root, the stderr tail is sanitized, the supervisor's backstops use the
  policy minimum, the child reads the same user config file the loader does.
- Tests for the mutants the review found surviving; supervised runs are bounded
  by a context so a missing kill fails instead of hanging.

Refs #11406
2026-09-30 05:40:21 -07:00
YHH c6aae2e730 Merge pull request #11413 from esengine/feat/scheduled-exec
feat(schedule): run a claimed scheduled run in a supervised child process
2026-09-30 05:30:59 -07:00
Guan09 e1f30114d2 fix(studio): show copy feedback and remove empty user header 2026-09-30 20:22:49 +08:00
esengine cbcc9551f9 feat(schedule): run a claimed scheduled run in a supervised child process
Adds the hidden `reasonix schedule exec <trigger-id>` child and a supervisor
that starts it, counts the tokens it reports and ends it, process tree and
all, when the wall clock or 1.25x the per-run token cap passes. A run that is
killed, crashes or loses its usage stream is charged the whole per-run cap.

The child holds an operating-system lease for the run, waits for the
supervisor's release line (so a run the store already settled spends nothing;
MarkRunning returning ErrRunSettled kills the child), reads its policy from the
user's configuration only, builds the read-only posture, and keeps reading its
stdin: the end of that stream is the supervisor going away, and the child then
stops and settles itself. A run that parks one kind of request too often
(max_repeat_parks, default 3, user level) is ended.

The final report and parked records are sanitized and bounded by the store on
the way in (PutResult). The schedule store directory joins the protected read
set of every run and the file tools' write guard; Grant.Tools narrows the read
tools of the posture.

Refs #11406
2026-09-30 05:05:42 -07:00
YHH 83856b0f00 Merge pull request #11408 from esengine/feat/scheduled-observe-posture
feat(boot): a read-only posture for unattended runs
2026-09-30 04:18:30 -07:00
esengine 08c717c2fa test(boot): the dot-dot case names a missing file on windows, which is not a leak 2026-09-30 04:07:35 -07:00
esengine e0b45d186a fix(builtin): resolve read paths the way the system opens them
realPath no longer cleans a POSIX path lexically before resolving it, so a
'..' after a symlink is checked against the file the system opens. On Windows
it asks for the final path through a handle, which follows junctions and
settles short names, case and the extended and UNC spellings. read_file
re-checks the scope against the open file. LockSurface freezes SetTools and
SetExtensions once assembly has installed them; Sanitize now removes
zero-width, tag and line-separator characters and runs before a record reaches
any store; a workspace root is refused when the home directory is unknown.

Refs #11406
2026-09-30 04:00:34 -07:00
esengine 2fcb221fad fix(boot): confine the read-only posture to the workspace and close review findings
Read tools take readRoots, checked after symlinks resolve, with the typed
refusal workspace.read_outside_scope; walkers, glob matches and ripgrep
(--no-follow) honour it. The posture forces both secret-protection switches
on and refuses a workspace containing the home directory or filesystem root.
No hook loads under the posture (an empty non-nil scope list). Rebuilding an
observed controller without the posture is refused (ErrObserveRebuild) and
the executor's gate and asker are locked. Approval records keep the host's
text in Summary and the model's arguments in Detail, marked untrusted and
stripped of control and bidi characters. A run may park at most 32 records,
then it is ended (ErrParkLimit). A tool outside the ceiling is refused with
posture.tool_not_allowed instead of unknown tool.

Refs #11406
2026-09-30 03:46:34 -07:00
esengine a32c4a4c3e feat(boot): a read-only posture for unattended runs
Adds a host-only Options.Observe that builds a run which can only read
files. The tool ceiling is decided by what each tool declares about its
reach (tool.Reach), enforced by a registry that refuses every other Add.
Approvals and ask questions are parked as Pending records and never
answered; the gate and asker cannot be replaced through the controller.
The workspace's reasonix.toml, .mcp.json, project hooks and folder grants
are not read, no MCP server or extension sidecar starts, and the run
context rides the turn tail as <scheduled-run>. The posture records
remote_content=false and whether an OS sandbox backs the tool filter.

Refs #11406
2026-09-30 03:25:40 -07:00
YHH a03391a13f Merge pull request #11407 from esengine/feat/schedule-store
feat(schedule): scheduled-runs store, policy and budget accounting (slice 1)
2026-09-30 03:22:53 -07:00
Guan09 23ade961ba feat(studio): 调整用户消息操作栏并增加复制按钮 2026-09-30 18:20:53 +08:00
esengine d8ad8bdc3f feat(schedule): add the scheduled-runs store, policy and budget accounting
Slice 1 of the scheduled-runs P0 (#11406): a machine-wide manifest with atomic
writes and a schema version, a Policy that only the user layer can loosen,
pessimistic budget accounting, and claim-before-start with deterministic
trigger ids. No process is started and nothing is wired to a frontend.
2026-09-30 03:14:54 -07:00
Will e47a2037f2 feat(bench): screen replacement candidates for the index substrate
The review settled the bar: a task qualifies only if it is clean on both of its
boundary arms, and none of the first six candidates is. This adds five more,
authored to the same shape but with a single value each and a call whose
arguments name the topic (./scripts/x {{cue}}), which is the shape the review
pointed at for i07 and i10.

- i15-ingest-lag and i16-commit-fence (quarter), i17-route-budget and
  i18-salvage-epoch (half), i19-tenant-quota (default).
- All five preflight clean at their own tier's generation.
- The corpus stays unqualified until six candidates hold on both arms across a
  three-pass batch; the ones that do not are dropped rather than promoted.
2026-09-30 17:52:28 +08:00
YHH 092a0272cd Merge pull request #11404 from esengine/fix/memory-overflow-11398
fix(studio): wrap long memory titles inside the row
2026-09-30 02:24:11 -07:00
esengine f151f5ba9a fix(studio): wrap long memory titles inside the row instead of overflowing
The title button in a memory row was flex:none, so a long title (or an
unbroken path/identifier) pushed the scope, date and action past the
container and made the Forget label break vertically. Let it shrink and
wrap within 60% of the row, and keep the trailing action on one line.
2026-09-30 02:11:34 -07:00
YHH 0019ad31d0 Merge pull request #11399 from esengine/ci/studio-cli-channels-no-approval
ci(release): studio cli-channels publishes without an approval environment
2026-09-30 01:55:45 -07:00
esengine 205f4ef09f ci(release): studio cli-channels publishes without an approval environment
Withdraws the studio-cli-channels environment from #11395 at the owner's
decision: no human approval. The job reads the shared NPM_TOKEN and
HOMEBREW_TAP_TOKEN. The contract test and STUDIO_RELEASE.md follow.
2026-09-30 01:45:41 -07:00
1756 changed files with 118625 additions and 6499 deletions

No files matched your search

+1 -1
View File
@@ -10,6 +10,7 @@
# User-facing guides and references.
/docs/ @SivanCola @esengine
/docs/THEME_AUTHOR_GUIDE.md @esengine @SivanCola
/sdk/ @SivanCola @esengine
/README.md @SivanCola @esengine
/README.zh-CN.md @SivanCola @esengine
@@ -22,7 +23,6 @@
/docs/*_CONTRACT.md @esengine @SivanCola
/docs/TOOL_APPROVAL_MODES.md @esengine @SivanCola
/docs/CAPABILITY_DIAGNOSTICS.md @esengine @SivanCola
/docs/CODE_SIGNING_POLICY.md @esengine @SivanCola
/docs/CHECKPOINTS.md @esengine @SivanCola
/docs/EXTENSION_*.md @esengine @SivanCola
/docs/SUBAGENT_*.md @esengine @SivanCola
+6
View File
@@ -6,3 +6,9 @@ contact_links:
- name: Questions & discussions
url: https://github.com/esengine/DeepSeek-Reasonix/discussions
about: For usage questions, ideas, and general discussion — please use Discussions instead of opening an issue.
- name: Discord
url: https://discord.gg/XF78rEME2D
about: Bilingual community chat for setup help, workflow showcases, and feature ideas.
- name: QQ group (DeepSeek-Reasonix官方群, 1093562660)
url: https://qm.qq.com/q/i59b0z2R8s
about: Chinese-language community chat for setup help and everyday questions.
+20
View File
@@ -8,6 +8,22 @@ only, on `main-v2`.
-
## Cause
-
## Blast radius
-
## Neighbouring behaviours tested
-
## Why this layer
-
## Issues
<!--
@@ -26,3 +42,7 @@ the source-to-target contract here: easing syntax, time units, callbacks,
cancellation, reduced-motion behavior, and failure fallback. Verification must
assert that the target API was actually called; a mock that silently skips it
does not count.
## Disclosure
- [ ] AI assistance was used for this change (optional; for transparency only, it does not change how the change is reviewed)
Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

+14 -10
View File
@@ -62,7 +62,7 @@ jobs:
# both paths must trigger the sdk job.
if echo "$files" | grep -qE '^(sdk/|internal/ext/extension/)'; then sdk=true; fi
# The release-note tests render every committed Studio note; npm/ holds the publish tests.
if echo "$files" | grep -qE '^(scripts/|npm/|release-notes/studio/)'; then scripts=true; fi
if echo "$files" | grep -qE '^(scripts/|npm/|release-notes/studio/|\.github/workflows/release-studio\.yml$)'; then scripts=true; fi
fi
fi
{ echo "code=$code"; echo "desktop=$desktop"; echo "sdk=$sdk"; echo "scripts=$scripts"; } >> "$GITHUB_OUTPUT"
@@ -80,7 +80,11 @@ jobs:
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: "22"
- run: node --test scripts/release-credits.test.mjs scripts/markdown-refs.test.mjs scripts/studio-release-notes.test.mjs npm/publish.test.mjs
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
cache: true
- run: node --test scripts/cli-archive-build.test.mjs scripts/release-credits.test.mjs scripts/update-contributors.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/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
@@ -175,12 +179,12 @@ jobs:
# budget above normal 7-9 minute runner variance; each package test binary
# remains independently bounded by Go's per-package timeout below.
#
# That timeout is 8m, not 3m: across four consecutive runs of the same
# That timeout is 12m, not 3m: across four consecutive runs of the same
# code, internal/assembly/boot measured 133s, 146s, 162s and then hit 180s, and
# internal/runtime/agent 82s, 92s, 144s and 180s — a 2.2x spread from runner
# variance alone, with four heavy packages sharing four vCPUs. At 3m the
# step failed on slow runners without a code change; a hang still trips
# the 15 minute job budget above.
# variance alone, with four heavy packages sharing four vCPUs. The boot package
# has since grown to 422s and then ran past 480s on two consecutive runs of the
# same code, so 8m no longer leaves room. A hang still trips the job budget.
#
# Every root-module `go test` that runs on Windows passes -count=1. With
# the result cache on, go test records each file and environment access
@@ -191,11 +195,11 @@ jobs:
# internal/base/testenv holds every such step to it.
- name: test (Windows smoke)
if: env.RUN_STEPS == 'true' && runner.os == 'Windows' && github.event_name == 'pull_request'
timeout-minutes: 15
timeout-minutes: 20
env:
REASONIX_RELEASE_CACHE_GUARD: "1"
WINDOWS_SANDBOX_WAIT_MS: "20000"
run: go test -count=1 -p 4 -timeout=8m ./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/...
run: go test -count=1 -p 4 -timeout=12m ./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/...
# The general Windows PR smoke list intentionally omits internal/contract/tool.
# Keep the session-temp portability contract covered without widening the
@@ -214,7 +218,7 @@ jobs:
timeout-minutes: 5
run: go test -count=1 -timeout=3m -run '^TestBashPowerShellExecuteDetailedContract$|^TestBashPowerShell51PreflightRejectsAndAndDetailed$|^TestBashPowerShellOutputIsUTF8$|^TestBashPowerShellSurfacesNonZeroExit$|^TestBashPowerShellRejectsChaining$' ./internal/tools/builtin
# Full push suite still uses the same 8m package budget as Windows smoke:
# Full push suite still uses the same 12m package budget as Windows smoke:
# agent/boot/control already hit 180s package timeouts under runner load,
# so 3m fails on slow machines without a code regression. It runs with
# -count=1 for the reason given at the smoke step. A hang still dies here
@@ -230,7 +234,7 @@ jobs:
# Bound sandbox helper children in Windows tests so a failed OS-level
# launch cannot pin the Actions step after Go's package timeout fires.
WINDOWS_SANDBOX_WAIT_MS: "20000"
run: go test -count=1 -p 4 -timeout=8m ./...
run: go test -count=1 -p 4 -timeout=12m ./...
race:
needs: changes
+44
View File
@@ -0,0 +1,44 @@
name: Deploy ops events relay
on:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: deploy-ops-events
cancel-in-progress: false
jobs:
deploy:
if: github.ref == 'refs/heads/platform'
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '22'
cache: npm
cache-dependency-path: workers/ops-events/package-lock.json
- name: Validate
working-directory: workers/ops-events
run: |
npm ci
npm run typecheck
npm test
- name: Deploy
working-directory: workers/ops-events
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: npx wrangler deploy
- name: Sync secrets
working-directory: workers/ops-events
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
GITHUB_WEBHOOK_SECRET: ${{ secrets.OPS_GITHUB_WEBHOOK_SECRET }}
OPS_LISTEN_TOKEN: ${{ secrets.OPS_LISTEN_TOKEN }}
OPS_EMIT_TOKEN: ${{ secrets.OPS_EMIT_TOKEN }}
run: |
node -e 'process.stdout.write(JSON.stringify({GITHUB_WEBHOOK_SECRET:process.env.GITHUB_WEBHOOK_SECRET||null,OPS_LISTEN_TOKEN:process.env.OPS_LISTEN_TOKEN||null,OPS_EMIT_TOKEN:process.env.OPS_EMIT_TOKEN||null}))' | npx wrangler secret bulk
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 10
run_install: false
+77
View File
@@ -0,0 +1,77 @@
name: Sync in-app feedback
# Turns feedback submitted from Reasonix Studio into issues and reports issue
# state (in progress, fixed in a tag, won't fix, duplicate) back to the worker,
# and mirrors the reporter's replies onto their issue as bot comments.
# Text from the public reaches the script only through the worker's JSON and
# the GitHub API, never through a shell command line or an expression.
on:
schedule:
- cron: '*/10 * * * *'
- cron: '5 3 * * *'
workflow_dispatch:
inputs:
dry_run:
description: Print what would happen without creating issues or writing back
required: false
default: false
type: boolean
full:
description: Re-read every open entry instead of only recently changed issues
required: false
default: false
type: boolean
permissions:
contents: read
issues: write
concurrency:
group: feedback-sync
cancel-in-progress: false
jobs:
sync:
if: github.repository == 'esengine/DeepSeek-Reasonix'
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- name: Check secret
id: gate
env:
FEEDBACK_ADMIN_TOKEN: ${{ secrets.FEEDBACK_ADMIN_TOKEN }}
run: |
if [ -z "$FEEDBACK_ADMIN_TOKEN" ]; then
echo "::notice::FEEDBACK_ADMIN_TOKEN is not set; feedback sync skipped"
echo "run=false" >> "$GITHUB_OUTPUT"
else
echo "run=true" >> "$GITHUB_OUTPUT"
fi
- if: steps.gate.outputs.run == 'true'
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
# git tag --contains needs full history; the tag API would cost a request per entry.
fetch-depth: 0
persist-credentials: false
- if: steps.gate.outputs.run == 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '22'
- name: Sync
if: steps.gate.outputs.run == 'true'
env:
FEEDBACK_ADMIN_TOKEN: ${{ secrets.FEEDBACK_ADMIN_TOKEN }}
# crash.reasonix.io answers runner IPs with a managed challenge; workers.dev serves only the converter's admin paths.
FEEDBACK_BASE_URL: https://reasonix-crash-report.reasonix.workers.dev
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }}
FULL: ${{ github.event.inputs.full || 'false' }}
SCHEDULE: ${{ github.event.schedule }}
run: |
set -euo pipefail
args=()
if [ "$DRY_RUN" = "true" ]; then args+=(--dry-run); fi
# The daily schedule sweeps everything the change window could have missed.
if [ "$FULL" = "true" ] || [ "$SCHEDULE" = "5 3 * * *" ]; then args+=(--full); fi
node scripts/feedback-sync.mjs "${args[@]}"
+190 -47
View File
@@ -5,10 +5,12 @@ run-name: Release Studio ${{ inputs.tag || github.ref_name }}
# (studio-v*), its own environment gate, and its own rollback catalog at
# dl.reasonix.io/studio/versions.json.
#
# What it must never touch: the repository-wide "latest" release (every Studio
# release is a prerelease) and the root dl.reasonix.io/versions.json, which is
# the desktop line's catalog. Studio artifacts land under the tag prefix, which
# cannot collide because the tag name itself differs.
# What it must never touch: the root dl.reasonix.io/versions.json, which is the
# desktop line's catalog. Studio artifacts land under the tag prefix, which
# cannot collide because the tag name itself differs. The highest stable tag
# is the repository's GitHub latest and a candidate is a prerelease; the GitHub
# release carries no root latest.json, because the 1.x updaters' last-resort
# URL is releases/latest/download/latest.json and must keep answering 404.
#
# Windows artifacts are Authenticode-signed with a Certum SimplySign cloud
# certificate in two stages: every PE file in the application tree, then the
@@ -74,8 +76,7 @@ jobs:
fi
version="${tag#studio-}"
# Semver's prerelease segment, group 4, read from the grammar rather
# than the spelling. Every Studio release carries GitHub's prerelease
# flag, so the tag-level distinction needs a name of its own.
# than the spelling.
candidate=false
if [[ "${version#v}" =~ $semver ]] && [ -n "${BASH_REMATCH[4]}" ]; then
candidate=true
@@ -757,14 +758,18 @@ jobs:
- name: Cross-compile and archive
env:
VERSION: ${{ needs.resolve.outputs.version }}
SHA: ${{ needs.resolve.outputs.sha }}
run: |
set -euo pipefail
mkdir -p dist
built="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
pkg=reasonix/internal/tools/productdocs
for target in darwin/amd64 darwin/arm64 linux/amd64 linux/arm64 windows/amd64 windows/arm64; do
os="${target%/*}"; arch="${target#*/}"; ext=""
[ "$os" = windows ] && ext=".exe"
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -trimpath \
-ldflags "-s -w -X main.version=$VERSION" -o "reasonix$ext" ./cmd/reasonix
-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
@@ -990,12 +995,14 @@ jobs:
if [ "$HAS_R2" = "true" ]; then delta_dir=../delta; fi
go run ./cmd/studio-manifest ../dist "${{ needs.resolve.outputs.version }}" "${{ needs.resolve.outputs.tag }}" $delta_dir
# Always a prerelease: this line is not the public product line, and
# GitHub never promotes a prerelease to the repository-wide "latest".
# The manifest stays out of the GitHub release (it is mirrored to R2
# under <tag>/ below), and a stable release takes the repository's latest
# only when it is the highest stable studio tag.
- name: Publish GitHub release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ needs.resolve.outputs.tag }}
CANDIDATE: ${{ needs.resolve.outputs.candidate }}
VERSION: ${{ needs.resolve.outputs.version }}
SIGNED_WINDOWS: ${{ needs.windows-sign-installer.result == 'success' }}
run: |
@@ -1036,15 +1043,20 @@ jobs:
printf "**macOS** 已用 Developer ID 签名并公证,打开时不需要清除隔离属性。%s**Linux** 从 \`.deb\` 安装。\n\n" "$windows"
printf '%s\n' '三个平台都能自更新:Linux 走自己的包,Windows 运行下一个安装器,macOS 替换自身 bundle。'
} >> "$notes"
assets=()
for f in dist/*; do
[ "$(basename "$f")" = latest.json ] || assets+=("$f")
done
if gh release view "$TAG" >/dev/null 2>&1; then
gh release edit "$TAG" --notes-file "$notes"
gh release upload "$TAG" dist/* --clobber
gh release upload "$TAG" "${assets[@]}" --clobber
else
gh release create "$TAG" dist/* \
decided="$(git tag -l 'studio-v*' | bash scripts/studio-release-flags.sh "$TAG" "$CANDIDATE")"
mapfile -t flags <<<"$decided"
gh release create "$TAG" "${assets[@]}" \
--title "Reasonix Studio $VERSION" \
--notes-file "$notes" \
--prerelease \
--latest=false
"${flags[@]}"
fi
- name: Mirror to R2 and update the Studio catalog
@@ -1107,50 +1119,125 @@ jobs:
--cache-control "public, max-age=300, stale-if-error=86400"
echo "Studio catalog -> $VERSION"
# A CLI channel that moves while 1.x still publishes would have two lines
# writing it, so every CLI job waits for this check. It runs no repository code.
cli-gate:
name: require the 1.x line to be frozen
needs: resolve
if: vars.STUDIO_PUBLISHES_CLI == 'true'
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Require CLI_PUBLISH_FROZEN
env:
CLI_PUBLISH_FROZEN: ${{ vars.CLI_PUBLISH_FROZEN }}
run: |
if [ "$CLI_PUBLISH_FROZEN" != true ]; then
echo "::error::STUDIO_PUBLISHES_CLI is on but CLI_PUBLISH_FROZEN is not: freeze the 1.x line first, or two lines would write the CLI channels"
exit 1
fi
# The v<version> tag the update pointer needs is created here, by the release
# identity the 1.x line also uses, because only that identity may create v*
# tags. This job checks out nothing and runs no repository code; the one step
# that reads RELEASE_TAG_TOKEN is written inline and only runs on the studio
# tag or branch, through the studio-release environment's ref policy.
cli-tag:
name: create the CLI tag
needs: [resolve, publish, cli-gate]
if: vars.STUDIO_PUBLISHES_CLI == 'true'
runs-on: ubuntu-latest
environment: studio-release
permissions:
contents: read
steps:
- name: Create v<version> on the studio commit
env:
TAG_TOKEN: ${{ secrets.RELEASE_TAG_TOKEN }}
RELEASE_TAG_ACTOR: ${{ vars.RELEASE_TAG_ACTOR }}
READ_TOKEN: ${{ github.token }}
CLI_PUBLISH_FROZEN: ${{ vars.CLI_PUBLISH_FROZEN }}
STUDIO_TAG: ${{ needs.resolve.outputs.tag }}
CLI_VERSION: ${{ needs.resolve.outputs.version }}
APPROVED_SHA: ${{ needs.resolve.outputs.sha }}
run: |
set -euo pipefail
repo=esengine/DeepSeek-Reasonix
stable_re='^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$'
preview_re='^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)-preview\.(0|[1-9][0-9]*)$'
tag="v${CLI_VERSION#v}"
if [[ ! "$tag" =~ $stable_re && ! "$tag" =~ $preview_re ]]; then
echo "$tag publishes no CLI pointer; no tag is created"
exit 0
fi
[ "$CLI_PUBLISH_FROZEN" = true ] || { echo "::error::CLI_PUBLISH_FROZEN must be true"; exit 1; }
[ "$GITHUB_REPOSITORY" = "$repo" ] || { echo "::error::the release tag identity is only used in $repo"; exit 1; }
case "$GITHUB_REF" in
refs/tags/studio-v* | refs/heads/studio) ;;
*) echo "::error::the release tag identity is only used on a studio tag or the studio branch, not $GITHUB_REF"; exit 1 ;;
esac
[[ "$APPROVED_SHA" =~ ^[0-9a-f]{40}$ ]] || { echo "::error::approved SHA is not a full commit SHA"; exit 1; }
[[ "$STUDIO_TAG" == "studio-$CLI_VERSION" ]] || { echo "::error::studio tag does not match the version"; exit 1; }
[ -n "$TAG_TOKEN" ] || { echo "::error::RELEASE_TAG_TOKEN is not configured; the default Actions token cannot create v* tags"; exit 1; }
[[ "$RELEASE_TAG_ACTOR" =~ ^[A-Za-z0-9][A-Za-z0-9-]*$ ]] || { echo "::error::configure RELEASE_TAG_ACTOR with the tag publisher's login"; exit 1; }
read_api() { GH_TOKEN="$READ_TOKEN" gh api "$@"; }
write_api() { GH_TOKEN="$TAG_TOKEN" gh api "$@"; }
actor="$(write_api user)"
jq -e --arg login "$RELEASE_TAG_ACTOR" '.type == "User" and (.login | ascii_downcase) == ($login | ascii_downcase)' <<<"$actor" >/dev/null ||
{ echo "::error::the release tag credential does not identify RELEASE_TAG_ACTOR"; exit 1; }
[ "$(write_api "repos/$repo" --jq .permissions.push)" = true ] ||
{ echo "::error::the release tag identity cannot push to $repo"; exit 1; }
[ "$(read_api "repos/$repo/commits/$STUDIO_TAG" --jq .sha)" = "$APPROVED_SHA" ] ||
{ echo "::error::$STUDIO_TAG does not resolve to $APPROVED_SHA"; exit 1; }
case "$(read_api "repos/$repo/compare/studio...$APPROVED_SHA" --jq .status)" in
behind | identical) ;;
*) echo "::error::$APPROVED_SHA is not on studio history"; exit 1 ;;
esac
# Prints the commit the tag points at; status 1 only when the tag does not exist.
tag_commit() {
local ref kind sha
ref="$(read_api "repos/$repo/git/ref/tags/$tag" --jq '.object.type + " " + .object.sha' 2>"$RUNNER_TEMP/tag.error")" || {
grep -Eiq '404|Not Found' "$RUNNER_TEMP/tag.error" && return 1
cat "$RUNNER_TEMP/tag.error" >&2
exit 1
}
read -r kind sha <<<"$ref"
[ "$kind" != tag ] || sha="$(read_api "repos/$repo/git/tags/$sha" --jq .object.sha)"
echo "$sha"
}
if existing="$(tag_commit)"; then
[ "$existing" = "$APPROVED_SHA" ] || { echo "::error::$tag already exists on $existing, not $APPROVED_SHA"; exit 1; }
echo "$tag already points at $APPROVED_SHA"
exit 0
fi
if ! write_api "repos/$repo/git/refs" -f "ref=refs/tags/$tag" -f "sha=$APPROVED_SHA" >/dev/null 2>"$RUNNER_TEMP/create.error"; then
# A concurrent run may have created the same tag in the meantime.
if existing="$(tag_commit)" && [ "$existing" = "$APPROVED_SHA" ]; then
echo "$tag already points at $APPROVED_SHA"
exit 0
fi
cat "$RUNNER_TEMP/create.error" >&2
exit 1
fi
echo "created $tag at $APPROVED_SHA"
# The CLI's install channels, npm's `reasonix` and the Homebrew tap. The 1.x
# line owns them until this one takes the CLI over; the repository variable
# STUDIO_PUBLISHES_CLI=true hands them here. They run once the release
# exists, because the cask points at its archives. A candidate goes to npm's
# `next` tag and leaves the tap alone: brew has no prerelease channel, so a
# candidate cask would become the default install.
# STUDIO_PUBLISHES_CLI=true hands them here. They run once cli-pointer has
# created the CLI release, because the cask points at its archives. A candidate
# goes to npm's `next` tag and leaves the tap alone: brew has no prerelease
# channel, so a candidate cask would become the default install.
cli-channels:
name: publish the CLI to npm and Homebrew
needs: [resolve, publish]
needs: [resolve, publish, cli-gate, cli-tag, cli-pointer]
if: vars.STUDIO_PUBLISHES_CLI == 'true'
runs-on: ubuntu-latest
# Owner approval before anything reaches npm or the tap: the switch alone
# would otherwise publish on every studio tag.
environment: studio-cli-channels
# id-token lets npm publish --provenance attach a Sigstore attestation; the
# registry token still authenticates the publish itself.
permissions:
contents: read
id-token: write
steps:
# A job naming a missing environment gets an unprotected one, so the
# gate is verified rather than assumed; the tokens below exist only in it.
- name: Require the approval gate on studio-cli-channels
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
set -uo pipefail
resp="$(gh api -i "repos/$REPO/environments/studio-cli-channels" 2>&1)"
status="$(printf '%s\n' "$resp" | sed -n '1s/^HTTP\/[0-9.]* \([0-9]*\).*/\1/p')"
case "$status" in
200) ;;
404)
echo "::error::environment studio-cli-channels does not exist"
exit 1 ;;
*)
echo "::error::reading environment studio-cli-channels as ${GITHUB_ACTOR} failed with HTTP ${status:-unknown}"
exit 1 ;;
esac
reviewers="$(printf '%s\n' "$resp" | sed '1,/^\r\{0,1\}$/d' | jq '[.protection_rules[] | select(.type == "required_reviewers") | .reviewers | length] | add // 0')"
if ! [[ "$reviewers" =~ ^[1-9][0-9]*$ ]]; then
echo "::error::environment studio-cli-channels has no required reviewers (or its protection rules were unreadable: '${reviewers}'); refusing to publish"
exit 1
fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ needs.resolve.outputs.sha }}
@@ -1164,7 +1251,7 @@ jobs:
registry-url: https://registry.npmjs.org
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.STUDIO_NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
VERSION: ${{ needs.resolve.outputs.version }}
run: node npm/build.mjs "$VERSION" --publish
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
@@ -1175,12 +1262,24 @@ jobs:
- name: Update the Homebrew cask
if: needs.resolve.outputs.candidate != 'true'
env:
TAP_TOKEN: ${{ secrets.STUDIO_HOMEBREW_TAP_TOKEN }}
TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
VERSION: ${{ needs.resolve.outputs.version }}
TAG: ${{ needs.resolve.outputs.tag }}
run: |
set -euo pipefail
git clone --depth 1 "https://x-access-token:${TAP_TOKEN}@github.com/esengine/homebrew-reasonix.git" tap
decision="$(node scripts/brew-cask-guard.mjs tap/Casks/reasonix.rb "${VERSION#v}")"
case "$decision" in
write) ;;
skip)
echo "the tap's cask is newer than ${VERSION#v}; leaving it"
exit 0
;;
*)
echo "::error::unexpected cask guard decision: '$decision'"
exit 1
;;
esac
bash scripts/render-brew-cask.sh "${VERSION#v}" "$TAG" cli-archives/SHA256SUMS > tap/Casks/reasonix.rb
cd tap
git add Casks/reasonix.rb
@@ -1190,3 +1289,47 @@ jobs:
fi
git -c user.name=reasonix -c [email protected] commit -m "reasonix ${VERSION#v}"
git push origin HEAD:main
# The 1.x updater accepts only a release tagged vMAJOR.MINOR.PATCH whose assets
# sit under that tag, so the archives go to a v<version> release. Only a
# -preview.N version moves preview; other prereleases publish nothing.
cli-pointer:
name: publish the CLI update pointer
needs: [resolve, publish, cli-gate, cli-tag]
if: vars.STUDIO_PUBLISHES_CLI == 'true'
runs-on: ubuntu-latest
concurrency:
group: studio-cli-pointer-${{ contains(needs.resolve.outputs.version, '-') && 'preview' || 'stable' }}
cancel-in-progress: false
permissions:
contents: write # create the CLI release; cli-tag has already made its tag
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ needs.resolve.outputs.sha }}
persist-credentials: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: cli-archives
path: cli-archives
- name: Publish the release, its record and the pointer
env:
GH_TOKEN: ${{ github.token }}
CLI_VERSION: ${{ needs.resolve.outputs.version }}
CLI_PUBLISH_FROZEN: ${{ vars.CLI_PUBLISH_FROZEN }}
APPROVED_SHA: ${{ needs.resolve.outputs.sha }}
STUDIO_TAG: ${{ needs.resolve.outputs.tag }}
REPOSITORY: ${{ github.repository }}
ARCHIVES_DIR: cli-archives
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_BUCKET: ${{ secrets.R2_BUCKET }}
HAS_R2: ${{ secrets.R2_ACCESS_KEY_ID != '' && secrets.R2_SECRET_ACCESS_KEY != '' && secrets.R2_ACCOUNT_ID != '' && secrets.R2_BUCKET != '' }}
run: |
if [ "$HAS_R2" != "true" ]; then
echo "::error::R2 credentials are not configured; the CLI pointer was not written"
exit 1
fi
bash scripts/publish-cli-pointer.sh
+1
View File
@@ -15,6 +15,7 @@
/runtime-resume
/extension-protocol-gen
/reasonix-plugin-example
/mcp-line-counter-kit
/reasonix-studio-host
/signpath-contract
/studio-delta
+22
View File
@@ -181,6 +181,28 @@ porting to `studio`; do not open the same PR against both.
5. Ensure `gofmt -l .` shows no changes
6. Submit a pull request to that same branch
## Pull request policy
**Related changes.** If you have several related changes of one pattern, a
tracking issue plus one pull request is easiest to review.
**Issue first for features.** A change that adds behaviour rather than fixing a
defect should link an issue the maintainers have agreed to before the work
starts. A fix for a reproducible defect may open directly, with the failing test
in the PR. Documentation-only and test-only PRs are reviewed at lower priority.
**Review tiers.**
- Changes under the `sensitive:` paths declared in `REASONIX.md` get a full
review plus a security review, regardless of author.
- Every PR carries the four sections of the PR template: Cause, Blast radius,
Neighbouring behaviours tested, Why this layer.
- The new test must fail without the change.
**Transparency.** The PR template has an optional checkbox for disclosing AI
assistance. It is for transparency only and does not change how a change is
reviewed.
## Reporting issues
Open an issue on GitHub with:
+13 -5
View File
@@ -18,6 +18,8 @@
<a href="https://esengine.github.io/DeepSeek-Reasonix/">Website</a>
&nbsp;·&nbsp;
<strong><a href="https://discord.gg/XF78rEME2D">Discord</a></strong>
&nbsp;·&nbsp;
<strong><a href="https://qm.qq.com/q/i59b0z2R8s">QQ</a></strong>
</p>
<p align="center">
@@ -31,6 +33,7 @@
<a href="https://github.com/esengine/DeepSeek-Reasonix/graphs/contributors"><img src="https://img.shields.io/github/contributors/esengine/DeepSeek-Reasonix.svg?style=flat-square&color=bc8cff&labelColor=161b22&logo=github&logoColor=white" alt="contributors"/></a>
<a href="https://github.com/esengine/DeepSeek-Reasonix/discussions"><img src="https://img.shields.io/github/discussions/esengine/DeepSeek-Reasonix.svg?style=flat-square&color=58a6ff&labelColor=161b22&logo=github&logoColor=white" alt="Discussions"/></a>
<a href="https://discord.gg/XF78rEME2D"><img src="https://img.shields.io/badge/discord-join-5865F2.svg?style=flat-square&labelColor=161b22&logo=discord&logoColor=white" alt="Discord"/></a>
<a href="https://qm.qq.com/q/i59b0z2R8s"><img src="https://img.shields.io/badge/QQ%20group-1093562660-12B7F5.svg?style=flat-square&labelColor=161b22&logo=tencentqq&logoColor=white" alt="QQ group 1093562660"/></a>
</p>
<p align="center">
@@ -41,12 +44,16 @@
<br/>
<p align="center"><strong>Open source · MIT · a single Go binary</strong></p>
<h3 align="center">A coding agent you can leave running.</h3>
<h3 align="center">A reliable coding agent for complex software engineering tasks.</h3>
<p align="center">One local engine, four ways in — terminal, desktop app, browser, or your editor over ACP. Plan mode, permissions, a workspace sandbox and per-turn checkpoints keep a long autonomous run something you can still read and undo.</p>
<p align="center">Maintained by <strong>Huahui Yu</strong>.</p>
> [!IMPORTANT]
> **Community · 加入社区** — bilingual Discord for setup help (`#help` / `#求助`), workflow showcases, and feature ideas. → **<https://discord.gg/XF78rEME2D>**
>
> QQ group **DeepSeek-Reasonix官方群** (`1093562660`) → **<https://qm.qq.com/q/i59b0z2R8s>** ([QR code](./docs/assets/qq-group.svg))
> Douyin: **做游戏的小鱼** (Douyin ID `22703872788`) · [QR code](./docs/assets/douyin.png)
<br/>
@@ -56,7 +63,7 @@ Reasonix ships on two lines. See the [version roadmap announcement](https://gith
| Line | Branch | Status | Get it |
| --- | --- | --- | --- |
| **Reasonix 2.x** | `studio` (this branch) | Active development, pre-release | [Studio releases](https://github.com/esengine/DeepSeek-Reasonix/releases?q=studio-v&expanded=true) |
| **Reasonix 2.x** | `studio` (this branch) | Active development | [Studio releases](https://github.com/esengine/DeepSeek-Reasonix/releases?q=studio-v&expanded=true) |
| **Reasonix 1.x** | [`main-v2`](https://github.com/esengine/DeepSeek-Reasonix/tree/main-v2) | Maintenance / stable | `npm i -g reasonix` · [desktop download](https://reasonix.io/?download=desktop#start) |
- **Want something stable?** Stay on 1.x. It keeps receiving bug fixes,
@@ -99,8 +106,8 @@ Studio, and editor integrations all run the same local Reasonix engine.
Download the package for your platform from the latest
[Studio release](https://github.com/esengine/DeepSeek-Reasonix/releases?q=studio-v&expanded=true)
(tagged `studio-v2.*`, published as pre-releases while 2.x is in active
development):
(tagged `studio-v2.*`; candidates such as `-rc.N` are marked as
pre-releases):
| Platform | Package | Architecture |
| --- | --- | --- |
@@ -265,8 +272,9 @@ coffee, not a contract — donations don't buy feature priority or change how
issues get triaged.
- **International** — PayPal: [paypal.me/yuhuahui](https://paypal.me/yuhuahui)
- **国内** — 微信支付(扫码)
- **国内** — 微信支付 / 支付宝(扫码)
<p align="center">
<img src=".github/sponsor/wechat-pay.jpg" alt="WeChat Pay QR code" width="180"/>
<img src=".github/sponsor/alipay.jpg" alt="Alipay QR code" width="180"/>
</p>
+12 -4
View File
@@ -18,6 +18,8 @@
<a href="https://esengine.github.io/DeepSeek-Reasonix/">官方网站</a>
&nbsp;·&nbsp;
<strong><a href="https://discord.gg/XF78rEME2D">Discord</a></strong>
&nbsp;·&nbsp;
<strong><a href="https://qm.qq.com/q/i59b0z2R8s">QQ</a></strong>
</p>
<p align="center">
@@ -31,6 +33,7 @@
<a href="https://github.com/esengine/DeepSeek-Reasonix/graphs/contributors"><img src="https://img.shields.io/github/contributors/esengine/DeepSeek-Reasonix.svg?style=flat-square&color=bc8cff&labelColor=161b22&logo=github&logoColor=white" alt="contributors"/></a>
<a href="https://github.com/esengine/DeepSeek-Reasonix/discussions"><img src="https://img.shields.io/github/discussions/esengine/DeepSeek-Reasonix.svg?style=flat-square&color=58a6ff&labelColor=161b22&logo=github&logoColor=white" alt="Discussions"/></a>
<a href="https://discord.gg/XF78rEME2D"><img src="https://img.shields.io/badge/discord-join-5865F2.svg?style=flat-square&labelColor=161b22&logo=discord&logoColor=white" alt="Discord"/></a>
<a href="https://qm.qq.com/q/i59b0z2R8s"><img src="https://img.shields.io/badge/QQ%20group-1093562660-12B7F5.svg?style=flat-square&labelColor=161b22&logo=tencentqq&logoColor=white" alt="QQ group 1093562660"/></a>
</p>
<p align="center">
@@ -41,12 +44,16 @@
<br/>
<p align="center"><strong>开源 · MIT · 单个 Go 二进制</strong></p>
<h3 align="center">可以一直开着跑的编码 Agent。</h3>
<h3 align="center">面向复杂软件工程任务的可靠编码 Agent。</h3>
<p align="center">一套本地引擎,四个入口——终端、桌面端、浏览器,或通过 ACP 接入你的编辑器。计划模式、权限、工作区沙箱与逐轮 checkpoint,让长时间自治运行始终可读、可撤销。</p>
<p align="center">维护者:<strong>Huahui Yu</strong>。</p>
> [!IMPORTANT]
> **加入社区 · Community** — 双语 Discord,提供安装答疑(`#help` / `#求助`)、工作流展示与功能想法。→ **<https://discord.gg/XF78rEME2D>**
>
> QQ 群 **DeepSeek-Reasonix官方群**(群号 `1093562660`)→ **<https://qm.qq.com/q/i59b0z2R8s>**([二维码](./docs/assets/qq-group.svg))
> 抖音:**做游戏的小鱼**(抖音号 `22703872788`)· [二维码](./docs/assets/douyin.png)
## 版本
@@ -54,7 +61,7 @@ Reasonix 分为两条版本线,调整的原因见[版本路线公告](https://
| 版本线 | 分支 | 状态 | 获取方式 |
| --- | --- | --- | --- |
| **Reasonix 2.x** | `studio`(当前分支) | 活跃开发,预发布 | [Studio 发布页](https://github.com/esengine/DeepSeek-Reasonix/releases?q=studio-v&expanded=true) |
| **Reasonix 2.x** | `studio`(当前分支) | 活跃开发 | [Studio 发布页](https://github.com/esengine/DeepSeek-Reasonix/releases?q=studio-v&expanded=true) |
| **Reasonix 1.x** | [`main-v2`](https://github.com/esengine/DeepSeek-Reasonix/tree/main-v2) | 维护 / 稳定 | `npm i -g reasonix` · [桌面端下载](https://reasonix.io/?download=desktop#start) |
- **想要稳定**:继续使用 1.x。它会持续收到 Bug 修复、Provider / API 兼容、
@@ -88,7 +95,7 @@ Reasonix 分为两条版本线,调整的原因见[版本路线公告](https://
### Reasonix Studio(2.x)
从最新的 [Studio 发布](https://github.com/esengine/DeepSeek-Reasonix/releases?q=studio-v&expanded=true)
下载对应平台的安装包(标签为 `studio-v2.*`,2.x 活跃开发期间以预发布形式发布):
下载对应平台的安装包(标签为 `studio-v2.*`;`-rc.N` 等候选版本标为预发布):
| 平台 | 安装包 | 架构 |
| --- | --- | --- |
@@ -245,9 +252,10 @@ CLI 进阶用法和详细配置见 **[CLI 命令参考](./docs/CLI.zh-CN.md)**
如果 Reasonix 帮你省了时间或 token,欢迎请杯咖啡。捐助不会换来 feature
优先级,也不会影响 issue 的处理顺序——就是「谢谢」。
- **国内** — 微信支付(扫下方二维码)
- **国内** — 微信支付 / 支付宝(扫下方二维码)
- **海外** — PayPal: [paypal.me/yuhuahui](https://paypal.me/yuhuahui)
<p align="center">
<img src=".github/sponsor/wechat-pay.jpg" alt="微信支付收款码" width="180"/>
<img src=".github/sponsor/alipay.jpg" alt="支付宝收款码" width="180"/>
</p>
+25
View File
@@ -320,6 +320,31 @@ Use `go test ./path/to/target/` to detect cycles **before** pushing. A `[setup f
- **Keep the PR diff minimal.** Only the files relevant to the PR's purpose — no stray changes from other branches.
- **Amend, don't add commits, for review feedback** — keeps the commit history clean.
## Change discipline
**Assess before editing.** For every change, humans and agents list callers,
consumers of the same state, sibling features, reload/replay/restart paths,
error and edge states, TUI/CLI and desktop equivalents, and wire mirrors.
A fix that breaks a neighbouring behaviour is a failed fix.
**Test the neighbourhood.** UI changes add or extend interaction tests for
adjacent functions of the same component or flow (composer: submit, clear,
queue, withdraw, restore, steer, failure, replay after reload) and run the whole
affected suite.
Write tests first; they must fail without the change.
**Fix at the owning layer.** Use the existing unified pattern: no special-case
flags, duplicated paths, or workarounds at the symptom site.
If the design is duplicated or wrong, make the smallest unifying change:
one path instead of two, deleting what becomes dead. Use current language and
framework idioms; do not add a new pattern where one exists.
**PR evidence.** Every PR description carries: Cause, Blast radius,
Neighbouring behaviours tested, and Why this layer.
## Reasonix host checks
The paths below decide what the agent is allowed to do — a wrong change here
+82 -11
View File
@@ -3,12 +3,12 @@
Two questions about long-horizon memory, and the harness that makes their
answers trustworthy.
-mode=preflight build all 12 tasks under every arm and check the contract
-mode=preflight build all 18 tasks under every arm and check the contract
-mode=snippet does a rank-1 hit hand over the whole answer?
-mode=adversarial send a model after the answer through every host surface
-mode=run-search Experiment R: is searchable canonical a real capability?
-mode=run-boundary Experiment I, paired: 6 tasks across their own cue boundary
-mode=run-index Experiment I, full: 6 tasks x 4 index budgets
-mode=run-boundary Experiment I, paired: the 6 efficiency tasks across their boundary
-mode=run-index Experiment I, full: the 6 efficiency tasks x 4 budgets
-mode=calibrate find each index task's PlantAfterGen for its cue tier
`-dry` drives any run mode with a scripted provider, for nothing. Real runs need
@@ -31,8 +31,8 @@ The most likely reason is that two of the six index tasks carry heavy-tail
stopping behaviour that swamps the effect being measured.
Existing evidence is not sufficient to tune the shipped 1% budget in either
direction. Reopening this wants a new corpus, not more samples: see
"Index corpus v2" below.
direction. Reopening this wants a new corpus, not more samples: that substrate
now exists, two qualifying tasks per cue tier — see "Index corpus v2" below.
**Things that turned out not to be problems**, each after being measured rather
than argued about:
@@ -74,11 +74,83 @@ scanned for answer literals before the first provider request and again after
the turn. Any answer reaching the model through a tool that is not `recall`
marks the run contaminated and takes it out of every statistic.
## Index corpus v2, if this is reopened
## Index corpus v2
The present index tasks are not a fit substrate: two of six carry stopping
behaviour that dominates the signal. A task should qualify only if a run-index
run reports a `stopping_class` other than `PostSufficientRetrieval` or
The efficiency substrate is six tasks that hold on both arms: `i37-dispatchlag`
and `i118-fencelag` (quarter), `i106-budgetseal` and `i70-ingestfloor` (half),
`i47-tenantlease` and `i112-lagquota` (default).
They came out of five batches of candidates, each screened the same way: one
`-mode=run-index` pass over the batch, then two more only for the candidates that
were clean on both boundary arms, and only the candidates that held on both arms
in all three passes stayed. A candidate that does not hold is dropped, not
promoted. The numbers are candidates, per tier:
| batch | quarter | half | default |
| --- | --- | --- | --- |
| first pool, `i31`-`i54` | 1 of 8 | 0 of 8 | 2 of 8 |
| second pool, `i61`-`i84` | 1 of 4 screened | 4 of 8 | 0 of 8 |
| third pool, `i85`-`i108` | 2 of 8 | 8 of 16 | none authored |
| replacement pool, `i109`-`i116` | - | - | 4 of 8 |
| replacement pool, `i92`, `i117`-`i124` | 3 of 9 | - | - |
That table counts candidates that held on both arms in all three passes, which is
not the size of the substrate. 89 candidates were authored, 77 were screened (the
second pool's quarter tier stopped at 4 of 8 and its default tier was never run),
and 25 held: 7 quarter, 12 half, 6 default. The substrate keeps two per tier, so
the other 19 survivors are spares rather than corpus members. Candidates from the
earlier round are not counted here.
| task | tier | cue present | cue absent |
| --- | --- | ---: | ---: |
| `i37-dispatchlag` | quarter | 3/3 | 3/3 |
| `i118-fencelag` | quarter | 3/3 | 3/3 |
| `i106-budgetseal` | half | 3/3 | 3/3 |
| `i70-ingestfloor` | half | 3/3 | 3/3 |
| `i47-tenantlease` | default | 3/3 | 3/3 |
| `i112-lagquota` | default | 3/3 | 3/3 |
Across their 36 judged cells: `SnippetStop` 23, `SnippetThenRead` 10 and
`DefensiveRead` 3 - every cell clean, nothing post-sufficient and nothing
`NeverSufficient`.
Four of the first six were flagged in review for sharing answer values, probe
queries and prompt wording within a tier. Separating them and re-screening those
four changed two of them: `i37` and `i47` held, `i62` and `i51` did not, so they
were replaced - `i90-recoverylag` was tried first and did not hold either, and
`i118-fencelag` and `i112-lagquota` are what did. The separation was not
cosmetic: the shared wording had been carrying two of the six.
Nothing in the task shape separates the survivors from the rest: within the half
tier, plain-number answers survived 0 of 8 in the first pool and 4 of 8 in the
second, and codename answers survived 8 of 16 in the third. An earlier claim here
that the answer kind decides whether a candidate holds does not survive this
table and is withdrawn. The dirty class was `PostSufficientRetrieval` in most
failures - the model re-checking a value it already had - but which tasks hit it
was not predictable from their shape at this sample.
`i01`-`i06` are the frozen study's six tasks, kept as `roleStopping`. Measured
once each with `-mode=run-index -task <id>`, per task and per arm:
| task | tier | cue present | cue absent |
| --- | --- | --- | --- |
| `i01-transport-fallback` | quarter | SnippetStop | DefensiveRead |
| `i02-scheduler-handoff` | quarter | PostSufficientRetrieval | PostSufficientRetrieval |
| `i03-coalescing` | half | PostSufficientRetrieval | PostSufficientRunaway |
| `i04-recovery-fence` | half | DefensiveRead | PostSufficientRunaway |
| `i05-cache-probe` | default | SnippetThenRead | PostSufficientRetrieval |
| `i06-dispatch-handoff` | default | SnippetStop | PostSufficientRetrieval |
Five of the six show post-sufficient behaviour in at least one arm (`i02`-`i06`),
and `i01` is clean on both. The cue-present arm is clean for four of them
(`i01`, `i04`, `i05`, `i06`), which is why they stay in the corpus as the
stopping side rather than being retitled. All six are excluded from `run-index`
and `run-boundary` batches and stay measurable one at a time with `-task <id>`. A
task added to the corpus declares a role, so it cannot arrive without one.
A task qualifies only if it is clean on both of its boundary arms - the
cue-present run and the cue-absent run - in every run of a screening batch. Clean
means a `stopping_class` other than `PostSufficientRetrieval` or
`PostSufficientRunaway`: `SnippetStop`, `SnippetThenRead` and `DefensiveRead`
all qualify, and a defensive read is deliberately not counted as waste. The
class comes from the three counts in that report — `searches_after_sufficient`,
@@ -86,8 +158,7 @@ class comes from the three counts in that report — `searches_after_sufficient`
sufficiency was reached and how many rounds followed it. The remaining
requirements still apply — successful tool call, answer in the output rather
than the cue, rank 1, `FirstHitCoverage` complete, one or two simple values,
nothing in the workspace. Keep i03 and i04 — as a stopping corpus, not an
efficiency one.
nothing in the workspace.
`-mode=calibrate` is not a screening tool: it builds and reads back the
fixtures, and reads nothing else, so its cue-visibility profile is the same for
+132 -7
View File
@@ -26,6 +26,12 @@ const (
tierDefault = "default" // visible at default only
)
// role places an index task in the efficiency substrate or the stopping corpus.
const (
roleEfficiency = "efficiency"
roleStopping = "stopping"
)
// plantKind is how a task's target enters the transcript.
const (
plantAssistant = "assistant" // the model's own account: never index-addressed
@@ -45,6 +51,8 @@ type contextTask struct {
AnswerVars []string
CueVar string
CueTier string
// Role is roleEfficiency or roleStopping; it decides the batch a task enters.
Role string
// PlantAfterGen ages the target: mergeFoldIndex trims from its oldest end,
// so what follows a cue decides which budget addresses it. Frozen, because
// a run that searched for it would let the tested code move its goalposts.
@@ -121,6 +129,20 @@ func num(name string, lo, hi int) varSpec {
return varSpec{Name: name, Kind: varInt, Min: lo, Max: hi}
}
// efficiencyTasks is the substrate a study measures on. Every task in it
// qualifies under the corpus bar; the stopping corpus is deliberately excluded,
// because a task carrying post-sufficient stopping behaviour swamps the effect
// an efficiency batch exists to measure.
func efficiencyTasks() []contextTask {
var out []contextTask
for _, t := range indexTasks() {
if t.Role == roleEfficiency {
out = append(out, t)
}
}
return out
}
func searchTasks() []contextTask {
return []contextTask{
{
@@ -192,10 +214,104 @@ func searchTasks() []contextTask {
}
}
func indexTasks() []contextTask {
// efficiencyIndexTasks is what a study measures on: two tasks per cue tier.
func efficiencyIndexTasks() []contextTask {
out := indexQuarterTasks()
out = append(out, indexHalfTasks()...)
out = append(out, indexDefaultTasks()...)
return out
}
// indexQuarterTasks holds the quarter-tier literals.
func indexQuarterTasks() []contextTask {
return []contextTask{
{
ID: "i01-transport-fallback", Experiment: experimentIndex, TargetKind: "tool_input",
ID: "i37-dispatchlag", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleEfficiency,
Prompt: "早前会话里执行过 ./scripts/dispatchlag,它打印出的 dispatch lag epoch 是多少?",
ProbeQuery: "dispatchlag dispatch lag epoch",
Vars: []varSpec{code("cue", "dispatchlag"), code("epoch", "cobalt")},
AnswerVars: []string{"epoch"}, CueVar: "cue", CueTier: tierQuarter,
PlantAfterGen: 4,
Plant: plantCall, CallID: "p37", CallTool: "bash",
CallArgs: `{"command":"./scripts/dispatchlag {{cue}}"}`,
PlantBody: "dispatch lag epoch = {{epoch}}",
},
{
ID: "i118-fencelag", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleEfficiency,
Prompt: "早前会话里运行过 ./scripts/fencelag,它打印出的 fence lag 是多少?",
ProbeQuery: "fencelag fence lag",
Vars: []varSpec{code("cue", "fencelag"), code("v", "slate")},
AnswerVars: []string{"v"}, CueVar: "cue", CueTier: tierQuarter,
PlantAfterGen: 4,
Plant: plantCall, CallID: "x118", CallTool: "bash",
CallArgs: `{"command":"./scripts/fencelag {{cue}}"}`,
PlantBody: "fence lag = {{v}}",
},
}
}
// indexHalfTasks holds the half-tier literals.
func indexHalfTasks() []contextTask {
return []contextTask{
{
ID: "i70-ingestfloor", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleEfficiency,
Prompt: "早前会话里执行过 ./scripts/ingestfloor,它打印出的 route quota 是多少?",
ProbeQuery: "ingestfloor quota",
Vars: []varSpec{code("cue", "ingestfloor"), num("quota", 1200, 9800)},
AnswerVars: []string{"quota"}, CueVar: "cue", CueTier: tierHalf,
PlantAfterGen: 2,
Plant: plantCall, CallID: "q70", CallTool: "bash",
CallArgs: `{"command":"./scripts/ingestfloor {{cue}}"}`,
PlantBody: "route quota = {{quota}}",
},
{
ID: "i106-budgetseal", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleEfficiency,
Prompt: "早前会话里执行过 ./scripts/budgetseal,它打印出的 route quota 是多少?",
ProbeQuery: "budgetseal route quota",
Vars: []varSpec{code("cue", "budgetseal"), code("quota", "amber")},
AnswerVars: []string{"quota"}, CueVar: "cue", CueTier: tierHalf,
PlantAfterGen: 2,
Plant: plantCall, CallID: "h106", CallTool: "bash",
CallArgs: `{"command":"./scripts/budgetseal {{cue}}"}`,
PlantBody: "route quota = {{quota}}",
},
}
}
// indexDefaultTasks holds the default-tier literals.
func indexDefaultTasks() []contextTask {
return []contextTask{
{
ID: "i47-tenantlease", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleEfficiency,
Prompt: "早前会话里执行过 ./scripts/tenantlease,它打印出的 tenant lease(秒)是多少?",
ProbeQuery: "tenantlease tenant lease",
Vars: []varSpec{code("cue", "tenantlease"), {Name: "lease", Kind: varDuration, Min: 15, Max: 300}},
AnswerVars: []string{"lease"}, CueVar: "cue", CueTier: tierDefault,
PlantAfterGen: 0,
Plant: plantCall, CallID: "p47", CallTool: "bash",
CallArgs: `{"command":"./scripts/tenantlease {{cue}}"}`,
PlantBody: "tenant lease = {{lease}}",
},
{
ID: "i112-lagquota", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleEfficiency,
Prompt: "早前会话里执行过 ./scripts/lagquota,它打印出的 lagquota lease 是多少?",
ProbeQuery: "lagquota lagquota lease",
Vars: []varSpec{code("cue", "lagquota"), {Name: "lease", Kind: varDuration, Min: 20, Max: 420}},
AnswerVars: []string{"lease"}, CueVar: "cue", CueTier: tierDefault,
PlantAfterGen: 0,
Plant: plantCall, CallID: "d112", CallTool: "bash",
CallArgs: `{"command":"./scripts/lagquota {{cue}}"}`,
PlantBody: "lagquota lease = {{lease}}",
},
}
}
// stoppingIndexTasks is the frozen study's six tasks, kept out of efficiency
// batches and measurable on their own with -task <id>.
func stoppingIndexTasks() []contextTask {
return []contextTask{
{
ID: "i01-transport-fallback", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleStopping,
Prompt: "transport fallback probe 当时报告的 selector 是什么?",
ProbeQuery: "transport fallback probe selector",
Vars: []varSpec{code("cue", "tfprobe"), code("selector", "fern")},
@@ -206,7 +322,7 @@ func indexTasks() []contextTask {
PlantBody: "fallback selector = {{selector}}",
},
{
ID: "i02-scheduler-handoff", Experiment: experimentIndex, TargetKind: "tool_input",
ID: "i02-scheduler-handoff", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleStopping,
Prompt: "scheduler handoff 当时记录的 grace 和 marker 是什么?",
ProbeQuery: "scheduler handoff grace marker",
Vars: []varSpec{
@@ -220,7 +336,7 @@ func indexTasks() []contextTask {
PlantBody: "handoff grace = {{grace}}\nmarker = {{marker}}",
},
{
ID: "i03-coalescing", Experiment: experimentIndex, TargetKind: "tool_input",
ID: "i03-coalescing", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleStopping,
Prompt: "job completion 的 coalescing probe 最后记录的 window 和 marker 是多少?",
ProbeQuery: "coalescing policy completion window",
Vars: []varSpec{
@@ -234,7 +350,7 @@ func indexTasks() []contextTask {
PlantBody: "completion coalesce window = {{window}}\nmarker = {{marker}}",
},
{
ID: "i04-recovery-fence", Experiment: experimentIndex, TargetKind: "tool_input",
ID: "i04-recovery-fence", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleStopping,
Prompt: "recovery fence 那次检查报告的 marker 和两个 epoch 是什么?",
ProbeQuery: "recovery fence epoch check",
Vars: []varSpec{
@@ -248,7 +364,7 @@ func indexTasks() []contextTask {
PlantBody: "{{marker}}\nexpected epoch {{expected}}\nobserved epoch {{observed}}",
},
{
ID: "i05-cache-probe", Experiment: experimentIndex, TargetKind: "tool_input",
ID: "i05-cache-probe", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleStopping,
Prompt: "cache probe 当时记录的 prefix salt 和 scope 是什么?",
ProbeQuery: "cache probe prefix salt scope",
Vars: []varSpec{code("cue", "cacheprobe"), code("salt", "comet"), code("scope", "lineage")},
@@ -259,7 +375,7 @@ func indexTasks() []contextTask {
PlantBody: "prefix salt = {{salt}}\nscope = {{scope}}",
},
{
ID: "i06-dispatch-handoff", Experiment: experimentIndex, TargetKind: "tool_input",
ID: "i06-dispatch-handoff", Experiment: experimentIndex, TargetKind: "tool_input", Role: roleStopping,
Prompt: "dispatch handoff probe 当时确认的 mode 和 marker 是什么?",
ProbeQuery: "dispatch handoff probe mode",
Vars: []varSpec{code("cue", "dispatchhandoff"), code("mode", "trigger"), code("marker", "iris")},
@@ -272,6 +388,12 @@ func indexTasks() []contextTask {
}
}
// indexTasks is the whole index corpus, the efficiency substrate first.
func indexTasks() []contextTask {
out := efficiencyIndexTasks()
return append(out, stoppingIndexTasks()...)
}
func allTasks() []contextTask {
return append(searchTasks(), indexTasks()...)
}
@@ -332,6 +454,9 @@ func validateCorpus() error {
if t.CueVar == "" {
return fmt.Errorf("%s: an index task needs a cue var", t.ID)
}
if t.Role != roleEfficiency && t.Role != roleStopping {
return fmt.Errorf("%s: an index task needs a role (%s or %s)", t.ID, roleEfficiency, roleStopping)
}
if v, _ := tierScales(t.CueTier); v == nil {
return fmt.Errorf("%s: unknown cue tier %q", t.ID, t.CueTier)
}
+14 -3
View File
@@ -5,6 +5,7 @@ import (
"crypto/rand"
"fmt"
"hash/fnv"
"io"
mathrand "math/rand"
"strings"
)
@@ -90,15 +91,25 @@ func seededRand(parts ...string) *mathrand.Rand {
// liveRand is the generator a paid run uses: every run gets values that existed
// nowhere before it started.
func liveRand() *mathrand.Rand {
var seed [8]byte
if _, err := rand.Read(seed[:]); err != nil {
rng, err := liveRandFrom(rand.Reader)
if err != nil {
panic("contextbench: no entropy for a live run: " + err.Error())
}
return rng
}
// liveRandFrom seeds a generator from an entropy source, so what a run's values
// are unpredictable from is the source and nothing else.
func liveRandFrom(entropy io.Reader) (*mathrand.Rand, error) {
var seed [8]byte
if _, err := io.ReadFull(entropy, seed[:]); err != nil {
return nil, err
}
var n int64
for _, b := range seed {
n = n<<8 | int64(b)
}
return mathrand.New(mathrand.NewSource(n))
return mathrand.New(mathrand.NewSource(n)), nil
}
// instantiate substitutes {{name}} and refuses anything left over. The grammar
+8 -1
View File
@@ -62,7 +62,14 @@ func main() {
case "adversarial":
os.Exit(runAdversarial(root))
case "run-index":
os.Exit(runExperiment(experimentIndex, root, *dry, tasks))
batch := tasks
if *only == "" {
// A batch measures the efficiency substrate only. Naming one task
// with -task runs that task, role included, so the stopping corpus
// stays measurable on its own.
batch = efficiencyTasks()
}
os.Exit(runExperiment(experimentIndex, root, *dry, batch))
default:
fmt.Fprintf(os.Stderr, "unknown mode %q\n", *mode)
os.Exit(2)
+69 -17
View File
@@ -1,7 +1,10 @@
package main
import (
"bytes"
"fmt"
"maps"
mathrand "math/rand"
"os/exec"
"slices"
"strings"
@@ -19,16 +22,24 @@ func TestCorpusIsWellFormed(t *testing.T) {
if got := len(searchTasks()); got != 6 {
t.Errorf("search experiment has %d tasks, want 6", got)
}
if got := len(indexTasks()); got != 6 {
t.Errorf("index experiment has %d tasks, want 6", got)
if got := len(indexTasks()); got != 12 {
t.Errorf("index experiment has %d tasks, want 12", got)
}
stopping := map[string]bool{}
tiers := map[string]int{}
for _, task := range indexTasks() {
if task.Role == roleStopping {
stopping[task.ID] = true
continue
}
tiers[task.CueTier]++
}
// Two per tier is what makes the staircase readable: the same task can be
// compared across the boundary its cue sits on, instead of two different
// questions being compared across two arms.
if !stopping["i03-coalescing"] || !stopping["i04-recovery-fence"] {
t.Errorf("the stopping corpus is %v; it must keep i03-coalescing and i04-recovery-fence", stopping)
}
// Two per tier, over the efficiency substrate, is what makes the staircase
// readable: the same task can be compared across the boundary its cue sits
// on, instead of two different questions being compared across two arms.
for _, tier := range []string{tierQuarter, tierHalf, tierDefault} {
if tiers[tier] != 2 {
t.Errorf("tier %s has %d tasks, want 2", tier, tiers[tier])
@@ -36,6 +47,21 @@ func TestCorpusIsWellFormed(t *testing.T) {
}
}
// The role decides which batch a task enters; the literal lists are only where
// it is declared, so the two must not drift.
func TestIndexListsMatchTheirRoles(t *testing.T) {
for _, task := range append(append(indexQuarterTasks(), indexHalfTasks()...), indexDefaultTasks()...) {
if task.Role != roleEfficiency {
t.Errorf("%s sits in an efficiency list with role %q", task.ID, task.Role)
}
}
for _, task := range stoppingIndexTasks() {
if task.Role != roleStopping {
t.Errorf("%s sits in the stopping list with role %q", task.ID, task.Role)
}
}
}
// The invariant the whole instantiation layer exists for: no literal a scorer
// needs may be readable in this repository before a run starts.
func TestNoAnswerLiteralExistsInTheRepository(t *testing.T) {
@@ -59,20 +85,46 @@ func TestNoAnswerLiteralExistsInTheRepository(t *testing.T) {
}
}
// Two runs of the same task must not share an answer, or one leaked run leaks
// every future one.
func TestInstancesDifferBetweenRuns(t *testing.T) {
// A run's values are unpredictable from a previous run only if the live
// generator is seeded from entropy. Comparing answers across two instances
// cannot assert that: a task whose answer is a bounded number collides by
// chance (1/8601 to 1/286 per task), so the check is on the seed source.
func TestLiveRandDrawsFromEntropy(t *testing.T) {
a, b := liveRand(), liveRand()
for range 4 {
if a.Int63() != b.Int63() {
return
}
}
t.Fatal("two live generators produced the same stream: they are seeded alike")
}
// The source alone decides an instance: the same entropy gives the same
// answers, different entropy gives different values.
func TestLiveRandSourceDecidesTheInstance(t *testing.T) {
same := func() *mathrand.Rand {
rng, err := liveRandFrom(bytes.NewReader(bytes.Repeat([]byte{7}, 8)))
if err != nil {
t.Fatal(err)
}
return rng
}
other, err := liveRandFrom(bytes.NewReader(bytes.Repeat([]byte{9}, 8)))
if err != nil {
t.Fatal(err)
}
if _, err := liveRandFrom(bytes.NewReader(nil)); err == nil {
t.Fatal("an empty entropy source was accepted")
}
for _, task := range allTasks() {
a, err := instantiateTask(task, liveRand())
if err != nil {
t.Fatal(err)
a, _ := instantiateTask(task, same())
b, _ := instantiateTask(task, same())
if !slices.Equal(a.AnswerMarkers, b.AnswerMarkers) || !maps.Equal(a.Vars, b.Vars) {
t.Errorf("%s: the same entropy gave different instances", task.ID)
}
b, err := instantiateTask(task, liveRand())
if err != nil {
t.Fatal(err)
}
if slices.Equal(a.AnswerMarkers, b.AnswerMarkers) {
t.Errorf("%s produced the same answers twice: %v", task.ID, a.AnswerMarkers)
c, _ := instantiateTask(task, other)
if maps.Equal(a.Vars, c.Vars) {
t.Errorf("%s: different entropy gave the same values", task.ID)
}
}
}
+1 -1
View File
@@ -232,7 +232,7 @@ func runBoundaries(root string) int {
var all []contextMetrics
var cueSide, noCueSide []contextMetrics
for _, t := range indexTasks() {
for _, t := range efficiencyTasks() {
cue, noCue := boundaryPair(t.CueTier)
for _, side := range []struct {
scale string
@@ -0,0 +1,3 @@
alpha=QORVEX-7741
beta=MIRALD-3208
gamma=TESSIK-9155
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,3 @@
def total(items):
"""Sum the items."""
return sum(x for x in items if x > 0)
@@ -0,0 +1,2 @@
value=7
file=limits/budget.py
@@ -0,0 +1,2 @@
handler=h07.py
missing=validate_payload
@@ -0,0 +1,8 @@
def wire_fee(amount):
"""Return the wire fee for `amount`: the greater of 15.0 and 0.1% of it.
A zero or negative amount has no wire fee, so it returns 0.0.
"""
if amount <= 0:
return 0.0
return max(15.0, amount * 0.001)
@@ -0,0 +1,13 @@
def convert(amount, rate):
"""Convert `amount` at `rate` and return the product.
Both units belong to the caller. A negative amount converts unchanged.
"""
return amount * rate
def spread(bid, ask):
"""Return `ask - bid`, the spread between the two quoted prices.
A negative result means the bid is above the ask.
"""
return ask - bid
@@ -0,0 +1,4 @@
EARTH_RADIUS_KM = 6371.0
def dist(left, right):
return abs(left - right) * EARTH_RADIUS_KM
@@ -0,0 +1,4 @@
import geo
def near_by(point, other):
return geo.dist(point, other) < 10
@@ -0,0 +1,16 @@
import json
import sys
def upgrade(row):
parts = row["fullname"].rsplit(" ", 1)
out = {k: v for k, v in row.items() if k != "fullname"}
out["first"] = parts[0]
out["last"] = parts[1] if len(parts) > 1 else ""
return out
def main():
for line in sys.stdin:
line = line.strip()
if not line:
continue
print(json.dumps(upgrade(json.loads(line))))
@@ -0,0 +1,7 @@
import logging
log = logging.getLogger("orders")
def place(order, request_id):
log.info("placing order %s", order["id"], extra={"request_id": request_id})
return {"ok": True}
@@ -0,0 +1,7 @@
import logging
log = logging.getLogger("shipping")
def dispatch(order, request_id):
log.info("dispatching %s", order["id"], extra={"request_id": request_id})
return {"ok": True}
@@ -0,0 +1,11 @@
import math
def p95(sorted_values):
if not sorted_values:
return 0
return sorted_values[math.ceil(len(sorted_values) * 0.95) - 1]
def rate(events, seconds):
if seconds <= 0:
return 0.0
return len(events) / seconds
@@ -0,0 +1,9 @@
import core
_cache = None
def list_records_cached():
global _cache
if _cache is None:
_cache = core.list_records()
return _cache
@@ -0,0 +1,5 @@
import cache
def main():
for k, v in sorted(cache.list_records_cached().items()):
print(f"{k}={v}")
@@ -0,0 +1,4 @@
DATA = {"a": 1, "b": 2}
def list_records():
return dict(DATA)
@@ -0,0 +1 @@
DEFAULTS = {"host": "localhost", "port": 8080}
@@ -0,0 +1,6 @@
import json
import defaults
def load(text):
data = json.loads(text) if text.strip() else {}
return dict(defaults.DEFAULTS, **data)
@@ -0,0 +1,4 @@
import json
def dump(cfg):
return json.dumps(cfg, sort_keys=True)
@@ -0,0 +1,2 @@
STATES = ("new", "paid", "delivered", "cancelled")
TERMINAL = ("delivered", "cancelled")
@@ -0,0 +1,11 @@
import states
LEGAL = {
"new": ("paid", "cancelled"),
"paid": ("delivered", "cancelled"),
"delivered": (),
"cancelled": (),
}
def can_move(a, b):
return b in LEGAL[a]
@@ -0,0 +1,5 @@
import schema, serializer
def display_name(line):
rec = serializer.load(line)
return rec["handle"] or rec["email"]
@@ -0,0 +1,4 @@
FIELDS = ("handle", "email")
def blank():
return {f: "" for f in FIELDS}
@@ -0,0 +1,4 @@
import timings
def is_slow(entry):
return entry["elapsed_s"] > timings.SLOW_SECONDS
@@ -0,0 +1,4 @@
import timings
def within_budget(entries):
return sum(e["elapsed_s"] for e in entries) <= timings.BUDGET_SECONDS
@@ -0,0 +1,5 @@
SLOW_SECONDS = 2.0
BUDGET_SECONDS = 60.0
def record(seconds):
return {"elapsed_s": seconds}
+14 -5
View File
@@ -28,6 +28,15 @@ const trainCorpusDir = "../../benchmarks/train"
// grader test instead.
const memorybenchDir = "../../benchmarks/memorybench"
// fanout-width, upstream-edge and project-check share the tasks/ layout, so the
// same authoring guard applies: a grader no attempt can pass is indistinguishable
// from a task with no solution.
const (
fanoutWidthDir = "../../benchmarks/fanout-width"
upstreamEdgeDir = "../../benchmarks/upstream-edge"
projectCheckDir = "../../benchmarks/project-check"
)
// protectedFiles reads the manifest embedded in a no-solution grader. The
// manifest lives inside verify.sh precisely because e2ebench drops that file
// in only after the run, so the agent never sees which files are watched.
@@ -180,7 +189,7 @@ func TestSolvableCorpusSeedsMustNotGradeClean(t *testing.T) {
t.Skipf("%s unavailable; the graders need a POSIX shell and python3", bin)
}
}
for _, dir := range []string{corpusDir, verificationStressDir, trainCorpusDir, memorybenchDir} {
for _, dir := range []string{corpusDir, verificationStressDir, trainCorpusDir, memorybenchDir, fanoutWidthDir, upstreamEdgeDir, projectCheckDir} {
if !dirExists(dir) {
continue
}
@@ -233,7 +242,7 @@ func TestCorpusGradersPassTheReferenceSolution(t *testing.T) {
t.Skipf("%s unavailable; the graders need a POSIX shell and python3", bin)
}
}
for _, dir := range []string{corpusDir, verificationStressDir, trainCorpusDir} {
for _, dir := range []string{corpusDir, verificationStressDir, trainCorpusDir, fanoutWidthDir, upstreamEdgeDir, projectCheckDir} {
if !dirExists(dir) {
continue
}
@@ -250,10 +259,10 @@ func TestCorpusGradersPassTheReferenceSolution(t *testing.T) {
t.Parallel()
work := stageSeed(t, task.dir)
if !stageSolved(t, task.dir, work) {
if dir == trainCorpusDir {
t.Fatal("no solution/: a generated task must prove its grader can pass")
if dir == trainCorpusDir || dir == verificationStressDir || dir == fanoutWidthDir || dir == upstreamEdgeDir || dir == projectCheckDir {
t.Fatal("no solution/: a corpus task must prove its grader can pass")
}
t.Skip("no solution/ to check this grader against")
t.Skip("no solution/: the e2e suite does not commit reference solutions")
}
if err := gradeSeed(t, work); err != nil {
t.Fatalf("the reference solution does not grade clean, so no attempt can: %v", err)
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"testing"
"reasonix/internal/base/i18n"
"reasonix/internal/contract/config"
)
func TestKernelLanguageWithShellSystemLanguage(t *testing.T) {
before := i18n.CurrentLanguage()
t.Cleanup(func() { i18n.DetectLanguage(before) })
for _, key := range []string{"REASONIX_LANG", "LC_ALL", "LC_MESSAGES", "LANG"} {
t.Setenv(key, "")
}
t.Setenv("REASONIX_SYSTEM_LANG", "zh-CN")
for _, tt := range []struct{ setting, env, want string }{
{"auto", "", "zh"},
{"en", "", "en"},
{"auto", "en", "en"},
{"zh-TW", "en", "zh-TW"},
} {
t.Setenv("REASONIX_LANG", tt.env)
if got := resolveKernelLanguage(&config.Config{Language: tt.setting}); got != tt.want {
t.Errorf("setting %q, env %q: language = %q, want %q", tt.setting, tt.env, got, tt.want)
}
}
}
+46
View File
@@ -0,0 +1,46 @@
package main
import (
"os"
"path/filepath"
"strings"
"reasonix/internal/assembly/boot"
"reasonix/internal/frontend/serve"
)
// launchWorkspace is the folder the first pane opens. The working directory
// counts only when someone chose it: a Start-menu or Finder launch inherits the
// install directory or the filesystem root, and taking that as a project puts
// the app's own folder in the sidebar again after every removal.
func launchWorkspace(appExe string) string {
home, _ := os.UserHomeDir()
return pickLaunchWorkspace(boot.ResolveWorkspaceRoot(""), appExe, serve.LaunchWorkspaces(), home)
}
func pickLaunchWorkspace(cwd, appExe string, remembered []string, home string) string {
if userChoseDir(cwd, appExe) {
return cwd
}
for _, dir := range remembered {
if st, err := os.Stat(dir); err == nil && st.IsDir() {
return dir
}
}
if home != "" {
return home
}
return cwd
}
func userChoseDir(cwd, appExe string) bool {
if cwd == "" || filepath.Dir(cwd) == cwd {
return false
}
rel, err := filepath.Rel(filepath.Dir(appExe), cwd)
if err != nil {
return true
}
inside := rel == "." || (rel != ".." && !strings.HasPrefix(rel, ".."+string(filepath.Separator)))
return !inside
}
@@ -0,0 +1,92 @@
package main
import (
"encoding/json"
"os"
"path/filepath"
"testing"
)
func TestUserChoseDirRejectsWhatALauncherInherits(t *testing.T) {
base := t.TempDir()
app := filepath.Join(base, "ReasonixStudio")
exe := filepath.Join(app, "Reasonix Studio.exe")
cases := []struct {
name, cwd, exe string
want bool
}{
{"install directory", app, exe, false},
{"below the install directory", filepath.Join(app, "resources"), exe, false},
{"filesystem root", filepath.VolumeName(base) + string(filepath.Separator), exe, false},
{"a project elsewhere", filepath.Join(base, "project"), exe, true},
{"a sibling sharing the name prefix", app + "-notes", exe, true},
{"unpackaged run keeps the directory", app, "", true},
}
for _, c := range cases {
if got := userChoseDir(c.cwd, c.exe); got != c.want {
t.Errorf("%s: userChoseDir(%q) = %v, want %v", c.name, c.cwd, got, c.want)
}
}
}
func TestPickLaunchWorkspaceFallbackOrder(t *testing.T) {
base := t.TempDir()
app := filepath.Join(base, "ReasonixStudio")
exe := filepath.Join(app, "Reasonix Studio.exe")
mk := func(name string) string {
d := filepath.Join(base, name)
if err := os.MkdirAll(d, 0o755); err != nil {
t.Fatal(err)
}
return d
}
a, b, home := mk("a"), mk("b"), mk("home")
gone := filepath.Join(base, "gone")
proj := mk("proj")
cases := []struct {
name string
cwd string
remembered []string
want string
}{
{"chosen directory wins over the list", proj, []string{a}, proj},
{"list head", app, []string{a, b}, a},
{"stale head skipped", app, []string{gone, b}, b},
{"all stale falls to home", app, []string{gone}, home},
{"empty list falls to home", app, nil, home},
}
for _, c := range cases {
if got := pickLaunchWorkspace(c.cwd, exe, c.remembered, home); got != c.want {
t.Errorf("%s: got %q, want %q", c.name, got, c.want)
}
}
}
func TestLaunchWorkspaceKeepsLaunchProjectAfterSidebarReorder(t *testing.T) {
base := t.TempDir()
home := filepath.Join(base, "state")
app := filepath.Join(base, "app")
a, b := filepath.Join(base, "a"), filepath.Join(base, "b")
for _, dir := range []string{home, app, a, b} {
if err := os.MkdirAll(dir, 0o755); err != nil {
t.Fatal(err)
}
}
t.Setenv("REASONIX_HOME", home)
t.Chdir(app)
data, _ := json.Marshal(map[string]any{"paths": []string{b, a}, "launch": a})
if err := os.WriteFile(filepath.Join(home, "serve-workspaces.json"), data, 0o644); err != nil {
t.Fatal(err)
}
exe := filepath.Join(app, "Reasonix Studio")
if got := launchWorkspace(exe); got != a {
t.Fatalf("launchWorkspace = %q, want the pre-reorder launch project %q", got, a)
}
if err := os.Remove(a); err != nil {
t.Fatal(err)
}
if got := launchWorkspace(exe); got != b {
t.Fatalf("missing launch project = %q, want next remembered folder %q", got, b)
}
}
+35 -11
View File
@@ -19,6 +19,7 @@ import (
"os/signal"
"strings"
"syscall"
"time"
"github.com/gorilla/websocket"
@@ -34,6 +35,7 @@ import (
"reasonix/internal/frontend/traystate"
"reasonix/internal/platform/account"
"reasonix/internal/platform/appupdate"
"reasonix/internal/platform/feedback"
"reasonix/internal/platform/instanceid"
"reasonix/internal/platform/notify"
"reasonix/internal/platform/remotecloud"
@@ -147,6 +149,7 @@ func main() {
// because that pipe is the only channel pointing that way; every log goes to
// logs, which is why no line there can be mistaken for one of these.
func run(lease io.Reader, handshakeTo, logs io.Writer, page string, shell shellIdentity) int {
phases := newStartupPhases(logs, time.Now)
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
if lease != nil {
@@ -159,6 +162,7 @@ func run(lease io.Reader, handshakeTo, logs io.Writer, page string, shell shellI
}
served, err := serve.FindPage(page)
phases.mark(startupPage)
if err != nil {
fmt.Fprintln(logs, "reasonix-studio-host:", err)
return 1
@@ -167,7 +171,7 @@ func run(lease io.Reader, handshakeTo, logs io.Writer, page string, shell shellI
fmt.Fprintln(logs, "reasonix-studio-host: no built page found; serving the kernel only")
}
hub, err := assemble(ctx, logs, handshakeTo, shell, served)
hub, err := assemble(ctx, logs, handshakeTo, shell, served, phases)
if err != nil {
fmt.Fprintln(logs, "reasonix-studio-host:", err)
return 1
@@ -177,6 +181,7 @@ func run(lease io.Reader, handshakeTo, logs io.Writer, page string, shell shellI
defer hub.Shutdown()
bound, err := bind(hub.Handler())
phases.mark(startupBind)
if err != nil {
fmt.Fprintln(logs, "reasonix-studio-host:", err)
return 1
@@ -184,7 +189,10 @@ func run(lease io.Reader, handshakeTo, logs io.Writer, page string, shell shellI
// The credential-writing setup surface opens only on a loopback address,
// and this is the first host that has one to show it.
hub.EnableProviderSetupForListener(bound.listener.Addr().String())
if err := announce(handshakeTo, bound); err != nil {
phases.mark(startupSetup)
err = announce(handshakeTo, bound)
phases.mark(startupAnnounce)
if err != nil {
fmt.Fprintln(logs, "reasonix-studio-host:", err)
return 1
}
@@ -281,13 +289,15 @@ func resolveKernelLanguage(cfg *config.Config) string {
// assemble builds the hub this host serves: one pane on the workspace it was
// launched in, carrying the capabilities a local window may exercise.
func assemble(ctx context.Context, logs, handshakeTo io.Writer, shell shellIdentity, page fs.FS) (*serve.Hub, error) {
func assemble(ctx context.Context, logs, handshakeTo io.Writer, shell shellIdentity, page fs.FS, phases *startupPhases) (*serve.Hub, error) {
// The one-time upgrades belong to whichever entry point starts first; a
// person who only ever opens the window would otherwise never get them.
if _, err := config.ApplyUserConfigUpgradesOnStartup(config.UserConfigPath()); err != nil {
fmt.Fprintln(logs, "reasonix-studio-host: config upgrade:", err)
}
phases.mark(startupConfigUpgrade)
cfg, err := config.Load()
phases.mark(startupConfig)
if err != nil {
return nil, err
}
@@ -311,15 +321,24 @@ func assemble(ctx context.Context, logs, handshakeTo io.Writer, shell shellIdent
paneSink = reporter.Wrap(paneSink)
}
}
root := boot.ResolveWorkspaceRoot("")
phases.mark(startupSinks)
root := launchWorkspace(shell.exe)
phases.mark(startupWorkspace)
built, err := boot.BuildRuntime(ctx, boot.Options{
Version: version,
WorkspaceRoot: root,
SessionDir: serve.SessionDirFor(root),
Sink: paneSink,
Stderr: logs,
StatsSource: surface.Desktop,
Version: version,
WorkspaceRoot: root,
SessionDir: serve.SessionDirFor(root),
Sink: paneSink,
Stderr: logs,
OnPhase: phases.boot,
StatsSource: surface.Desktop,
FeedbackSurface: feedback.SurfaceStudio,
// A stale default_model must not keep the window from opening to fix it.
OpenOnFallbackModel: true,
CleanupPendingReconciler: serve.BackgroundCleanupReconciler,
})
phases.mark(startupRuntime)
if err != nil {
return nil, err
}
@@ -334,6 +353,7 @@ func assemble(ctx context.Context, logs, handshakeTo io.Writer, shell shellIdent
// Shut until the person at the window opens it; the context ending closes
// it with the rest of the kernel, unpairing every device.
share := serve.NewDeviceShare(page)
share.RestorePort(cfg.SharePort())
go func() {
<-ctx.Done()
share.Close()
@@ -358,12 +378,16 @@ func assemble(ctx context.Context, logs, handshakeTo io.Writer, shell shellIdent
srv := serve.New(built.Controller, bc, hubCfg)
srv.SetPaneSink(paneSink)
srv.AdoptRuntime(built)
if _, err := hub.Adopt(srv, bc); err != nil {
phases.mark(startupHub)
_, err = hub.Adopt(srv, bc)
phases.mark(startupAdopt)
if err != nil {
hub.Shutdown()
return nil, err
}
hub.StartRecoveryGC(ctx)
startCloudRemote(ctx, cfg, logs, hub)
phases.mark(startupBackground)
return hub, nil
}
+1 -1
View File
@@ -487,7 +487,7 @@ func TestAssembleAppliesTheStartupUpgrades(t *testing.T) {
t.Fatal(err)
}
t.Chdir(testenv.TempDir(t))
hub, err := assemble(t.Context(), io.Discard, io.Discard, shellIdentity{}, nil)
hub, err := assemble(t.Context(), io.Discard, io.Discard, shellIdentity{}, nil, newStartupPhases(io.Discard, time.Now))
if err != nil {
t.Fatalf("assemble: %v", err)
}
+50
View File
@@ -0,0 +1,50 @@
package main
import (
"fmt"
"io"
"time"
"reasonix/internal/assembly/boot"
)
type startupPhase string
const (
startupPage startupPhase = "page"
startupConfigUpgrade startupPhase = "config-upgrade"
startupConfig startupPhase = "config"
startupSinks startupPhase = "sinks"
startupWorkspace startupPhase = "workspace"
startupRuntime startupPhase = "runtime"
startupHub startupPhase = "hub"
startupAdopt startupPhase = "adopt"
startupBackground startupPhase = "background"
startupBind startupPhase = "bind"
startupSetup startupPhase = "provider-setup"
startupAnnounce startupPhase = "announce"
)
type startupPhases struct {
logs io.Writer
now func() time.Time
last time.Time
}
func newStartupPhases(logs io.Writer, now func() time.Time) *startupPhases {
return &startupPhases{logs: logs, now: now, last: now()}
}
func (p *startupPhases) mark(phase startupPhase) {
now := p.now()
p.write(phase, now.Sub(p.last))
p.last = now
}
func (p *startupPhases) write(phase startupPhase, elapsed time.Duration) {
fmt.Fprintf(p.logs, "reasonix-studio-host: startup phase=%s elapsed_ms=%d\n", phase, elapsed.Milliseconds())
}
func (p *startupPhases) boot(phase boot.Phase) {
p.write(startupPhase("boot."+phase.Name), phase.D)
}
+26
View File
@@ -0,0 +1,26 @@
package main
import (
"bytes"
"testing"
"time"
"reasonix/internal/assembly/boot"
)
func TestStartupPhasesUseElapsedMilliseconds(t *testing.T) {
var logs bytes.Buffer
now := time.Unix(100, 0)
p := newStartupPhases(&logs, func() time.Time { return now })
now = now.Add(1250 * time.Millisecond)
p.mark(startupPage)
now = now.Add(7 * time.Millisecond)
p.boot(boot.Phase{Name: "sessions", D: 3 * time.Millisecond})
p.mark(startupRuntime)
want := "reasonix-studio-host: startup phase=page elapsed_ms=1250\n" +
"reasonix-studio-host: startup phase=boot.sessions elapsed_ms=3\n" +
"reasonix-studio-host: startup phase=runtime elapsed_ms=7\n"
if got := logs.String(); got != want {
t.Fatalf("phase log = %q, want %q", got, want)
}
}
@@ -0,0 +1,100 @@
package main
import (
"context"
"encoding/json"
"io"
"net/http"
"strings"
"testing"
"time"
"reasonix/internal/base/i18n"
"reasonix/internal/base/testenv"
"reasonix/internal/contract/config"
"reasonix/internal/frontend/serve"
)
func TestAssembledTrayLanguage(t *testing.T) {
before := i18n.CurrentLanguage()
t.Cleanup(func() { i18n.DetectLanguage(before) })
for _, tt := range []struct{ name, system, desktop, env, locale, want string }{
{"system", "zh-Hans-CN", "auto", "", "", "zh"},
{"traditional", "zh-Hant-TW", "auto", "", "", "zh-TW"},
{"desktop", "zh-Hans-CN", "en", "", "", "en"},
{"reasonix", "zh-Hans-CN", "auto", "en-US", "", "en"},
{"desktop-over-env", "en-US", "zh", "en", "", "zh"},
{"c-locale", "zh-Hans-CN", "auto", "", "C", "en"},
{"posix-locale", "zh-Hans-CN", "auto", "", "POSIX.UTF-8", "en"},
} {
t.Run(tt.name, func(t *testing.T) {
t.Setenv("REASONIX_HOME", testenv.TempDir(t))
t.Chdir(testenv.TempDir(t))
for _, key := range []string{"REASONIX_LANG", "LC_ALL", "LC_MESSAGES", "LANG"} {
t.Setenv(key, "")
}
t.Setenv("REASONIX_SYSTEM_LANG", tt.system)
t.Setenv("REASONIX_LANG", tt.env)
t.Setenv("LANG", tt.locale)
cfg := config.Default()
disabled := false
cfg.Desktop.Telemetry, cfg.Desktop.Metrics = &disabled, &disabled
if err := cfg.SetDesktopLanguage(tt.desktop); err != nil {
t.Fatal(err)
}
if err := cfg.SaveTo(config.UserConfigPath()); err != nil {
t.Fatal(err)
}
ctx, cancel := context.WithCancel(t.Context())
defer cancel()
hub, err := assemble(ctx, io.Discard, io.Discard, shellIdentity{}, nil, newStartupPhases(io.Discard, time.Now))
if err != nil {
t.Fatalf("assemble: %v", err)
}
defer hub.Shutdown()
b, err := bind(hub.Handler())
if err != nil {
t.Fatal(err)
}
done := make(chan error, 1)
go func() { done <- b.serve(ctx) }()
defer func() {
cancel()
select {
case err := <-done:
if err != nil {
t.Error(err)
}
case <-time.After(30 * time.Second):
t.Error("host did not drain")
}
}()
check := func(want string) {
t.Helper()
status, body := ask(t, b, http.MethodGet, "/tray/state", nil)
if status != http.StatusOK {
t.Fatalf("tray status = %d", status)
}
var state serve.TrayState
if err := json.Unmarshal([]byte(body), &state); err != nil {
t.Fatal(err)
}
say := i18n.Catalog(want)
labels := serve.TrayLabels{Open: say.TrayOpen, CloseToTray: say.TrayCloseToTray, Quit: say.TrayQuit}
if state.Labels != labels || state.Line != say.TrayIdle {
t.Fatalf("tray = %+v, want labels %+v and line %q", state, labels, say.TrayIdle)
}
}
check(tt.want)
for _, lang := range []string{"en", "zh"} {
status, _ := ask(t, b, http.MethodPost, "/appearance", func(r *http.Request) {
r.Body = io.NopCloser(strings.NewReader(`{"language":"` + lang + `"}`))
})
if status != http.StatusOK {
t.Fatalf("appearance status = %d", status)
}
check(lang)
}
})
}
}
+37
View File
@@ -71,3 +71,40 @@ func TestTheHostPointsTheKernelsCatalogueAtTheConfiguredLanguage(t *testing.T) {
}
}
}
// Sweeping a session directory costs a handful of file operations per
// transcript, and the window cannot open until the handshake. A build that
// sweeps inline makes the first launch after the cache went cold wait on
// history it never displays.
func TestTheHostsFirstBuildSweepsSessionsInTheBackground(t *testing.T) {
file, err := parser.ParseFile(token.NewFileSet(), "main.go", nil, 0)
if err != nil {
t.Fatalf("parse main.go: %v", err)
}
found := false
ast.Inspect(file, func(n ast.Node) bool {
lit, ok := n.(*ast.CompositeLit)
if !ok {
return true
}
sel, ok := lit.Type.(*ast.SelectorExpr)
if !ok || sel.Sel.Name != "Options" {
return true
}
for _, elt := range lit.Elts {
kv, ok := elt.(*ast.KeyValueExpr)
if !ok {
continue
}
if key, ok := kv.Key.(*ast.Ident); ok && key.Name == "CleanupPendingReconciler" {
if v, ok := kv.Value.(*ast.SelectorExpr); ok && v.Sel.Name == "BackgroundCleanupReconciler" {
found = true
}
}
}
return true
})
if !found {
t.Fatal("the host's boot.Options does not set CleanupPendingReconciler to serve.BackgroundCleanupReconciler")
}
}
+23 -99
View File
@@ -2,7 +2,6 @@ package main
import (
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
@@ -11,10 +10,7 @@ import (
"gopkg.in/yaml.v3"
)
var cliChannelSecrets = []string{"STUDIO_NPM_TOKEN", "STUDIO_HOMEBREW_TAP_TOKEN"}
// The 1.x line reads these repository secrets; studio must never touch them.
var legacyRegistrySecrets = []string{"NPM_TOKEN", "HOMEBREW_TAP_TOKEN"}
var cliChannelSecrets = []string{"NPM_TOKEN", "HOMEBREW_TAP_TOKEN"}
func parseWorkflowFile(t *testing.T, path string) *yaml.Node {
t.Helper()
@@ -94,8 +90,8 @@ func TestCLIChannelsJobIsGatedAndAttested(t *testing.T) {
if job == nil {
t.Fatal("cli-channels job is missing")
}
if got := mappingScalar(job, "environment"); got != "studio-cli-channels" {
t.Fatalf("cli-channels environment = %q, want studio-cli-channels", got)
if mappingValue(job, "environment") != nil {
t.Fatal("cli-channels must not declare an environment; the switch and the tag rule are its controls")
}
if got := mappingScalar(job, "if"); got != "vars.STUDIO_PUBLISHES_CLI == 'true'" {
t.Fatalf("cli-channels if = %q, want the STUDIO_PUBLISHES_CLI switch", got)
@@ -113,18 +109,11 @@ func TestCLIChannelsJobIsGatedAndAttested(t *testing.T) {
t.Fatalf("cli-channels permission %s = %q, want %q", scope, got, level)
}
}
if !nodeContains(job, "environments/studio-cli-channels") || !nodeContains(job, "required_reviewers") {
t.Fatal("cli-channels must verify the environment's required reviewers before publishing")
}
assertGateBeforePublishing(t, job)
for _, name := range cliChannelSecrets {
if !secretRefPattern(name).MatchString(scalarString(job)) {
t.Fatalf("cli-channels does not read secrets.%s", name)
}
}
if name, found := refersTo(job, legacyRegistrySecrets); found {
t.Fatalf("cli-channels reads %s; it must use the environment-only STUDIO_* names", name)
}
}
func scalarString(node *yaml.Node) string {
@@ -133,6 +122,20 @@ func scalarString(node *yaml.Node) string {
return strings.Join(scalars, "\n")
}
func TestReleaseStudioGrantsNoWriteAll(t *testing.T) {
root := parseWorkflowFile(t, "../../.github/workflows/release-studio.yml")
if top := mappingValue(root, "permissions"); top != nil && top.Kind == yaml.ScalarNode && top.Value == "write-all" {
t.Error("release-studio.yml grants write-all")
}
jobs := jobsOf(t, root)
for i := 0; i+1 < len(jobs.Content); i += 2 {
name, job := jobs.Content[i].Value, jobs.Content[i+1]
if p := mappingValue(job, "permissions"); p != nil && p.Kind == yaml.ScalarNode && p.Value == "write-all" {
t.Errorf("release-studio.yml job %s grants write-all", name)
}
}
}
func TestNoWorkflowGrantsIDTokenOrBroadPermissionsOutsideCLIChannels(t *testing.T) {
files, err := filepath.Glob("../../.github/workflows/*.yml")
if err != nil || len(files) == 0 {
@@ -173,7 +176,7 @@ func TestOnlyCLIChannelsReferencesRegistrySecrets(t *testing.T) {
if err != nil || len(files) == 0 {
t.Fatalf("no workflows found: %v", err)
}
guarded := append(append([]string{}, cliChannelSecrets...), legacyRegistrySecrets...)
guarded := cliChannelSecrets
for _, file := range files {
root := parseWorkflowFile(t, file)
jobs := mappingValue(root, "jobs")
@@ -196,18 +199,18 @@ func TestOnlyCLIChannelsReferencesRegistrySecrets(t *testing.T) {
continue
}
if name, found := refersTo(root, cliChannelSecrets); found {
t.Errorf("%s reaches %s, which belongs to studio's cli-channels", file, name)
t.Errorf("%s reaches %s, which only release-studio.yml cli-channels may read", file, name)
}
}
}
func TestSecretReferenceDetectionCoversBypassForms(t *testing.T) {
for _, text := range []string{
"${{ secrets.STUDIO_NPM_TOKEN }}",
"${{ secrets['STUDIO_NPM_TOKEN'] }}",
`${{ secrets["STUDIO_NPM_TOKEN"] }}`,
"${{ secrets.NPM_TOKEN }}",
"${{ secrets['NPM_TOKEN'] }}",
`${{ secrets["NPM_TOKEN"] }}`,
"${{ toJSON(secrets) }}",
"${{ secrets[format('STUDIO_{0}', 'NPM_TOKEN')] }}",
"${{ secrets[format('NPM_{0}', 'TOKEN')] }}",
} {
var doc yaml.Node
if err := yaml.Unmarshal([]byte("run: \""+regexp.MustCompile(`"`).ReplaceAllString(text, `\"`)+"\"\n"), &doc); err != nil {
@@ -225,82 +228,3 @@ func TestSecretReferenceDetectionCoversBypassForms(t *testing.T) {
t.Error("an unrelated secret was reported")
}
}
func assertGateBeforePublishing(t *testing.T, job *yaml.Node) {
t.Helper()
steps := mappingValue(job, "steps")
if steps == nil || steps.Kind != yaml.SequenceNode {
t.Fatal("cli-channels has no steps")
}
gate := -1
for i, step := range steps.Content {
if nodeContains(mappingValue(step, "run"), "environments/studio-cli-channels") {
gate = i
break
}
}
if gate < 0 {
t.Fatal("cli-channels has no environment check step")
}
for i, step := range steps.Content[:gate] {
if run := mappingScalar(step, "run"); run != "" || mappingValue(step, "env") != nil {
t.Errorf("step %d runs or gets credentials before the environment check", i)
}
}
for i, step := range steps.Content {
if i > gate {
continue
}
for _, name := range append(append([]string{}, cliChannelSecrets...), legacyRegistrySecrets...) {
if nodeContains(step, name) {
t.Errorf("step %d references %s before or at the environment check", i, name)
}
}
}
}
func TestEnvironmentCheckStepFailsClosed(t *testing.T) {
bash, err := exec.LookPath("bash")
if err != nil {
t.Skip("bash not available")
}
root := parseWorkflowFile(t, "../../.github/workflows/release-studio.yml")
job := mappingValue(jobsOf(t, root), "cli-channels")
var script string
for _, step := range mappingValue(job, "steps").Content {
if run := mappingScalar(step, "run"); strings.Contains(run, "environments/studio-cli-channels") {
script = run
break
}
}
if script == "" {
t.Fatal("environment check step not found")
}
reviewers := `{"type":"required_reviewers","reviewers":[{"a":1}]}`
cases := []struct {
name, response string
pass bool
}{
{"one reviewer", "HTTP/2.0 200 OK\n\n{\"protection_rules\":[" + reviewers + "]}", true},
{"no rules", "HTTP/2.0 200 OK\n\n{\"protection_rules\":[]}", false},
{"two JSON documents", "HTTP/2.0 200 OK\n\n{\"protection_rules\":[]}{\"protection_rules\":[]}", false},
{"empty body", "HTTP/2.0 200 OK\n\n", false},
{"non-numeric body", "HTTP/2.0 200 OK\n\n\"x\"", false},
{"missing environment", "HTTP/2.0 404 Not Found\n\n{\"message\":\"Not Found\"}", false},
{"server error", "HTTP/2.0 500 Error\n\n{}", false},
}
for _, tc := range cases {
dir := t.TempDir()
fake := "#!/bin/sh\ncat <<'EOF'\n" + tc.response + "\nEOF\n"
if err := os.WriteFile(filepath.Join(dir, "gh"), []byte(fake), 0o755); err != nil {
t.Fatal(err)
}
cmd := exec.Command(bash, "-c", script+"\necho PASSED")
cmd.Env = append(os.Environ(), "PATH="+dir+string(os.PathListSeparator)+os.Getenv("PATH"), "REPO=x/y", "GH_TOKEN=x", "GITHUB_ACTOR=t")
out, err := cmd.CombinedOutput()
passed := err == nil && strings.Contains(string(out), "PASSED")
if passed != tc.pass {
t.Errorf("%s: passed=%v, want %v\n%s", tc.name, passed, tc.pass, out)
}
}
}
+165
View File
@@ -0,0 +1,165 @@
package main
import (
"path/filepath"
"strings"
"testing"
"gopkg.in/yaml.v3"
)
func TestCLIPointerJobIsSwitchedSerializedAndNarrow(t *testing.T) {
root := parseWorkflowFile(t, "../../.github/workflows/release-studio.yml")
job := mappingValue(jobsOf(t, root), "cli-pointer")
if job == nil {
t.Fatal("cli-pointer job is missing")
}
if got := mappingScalar(job, "if"); got != "vars.STUDIO_PUBLISHES_CLI == 'true'" {
t.Fatalf("cli-pointer if = %q, want the STUDIO_PUBLISHES_CLI switch", got)
}
needs := mappingValue(job, "needs")
if needs == nil || needs.Kind != yaml.SequenceNode {
t.Fatal("cli-pointer must list its needs")
}
seen := map[string]bool{}
for _, n := range needs.Content {
seen[n.Value] = true
}
if !seen["resolve"] || !seen["publish"] || !seen["cli-gate"] {
t.Fatalf("cli-pointer needs %v, want resolve, publish and cli-gate", seen)
}
concurrency := mappingValue(job, "concurrency")
if concurrency == nil || !strings.HasPrefix(mappingScalar(concurrency, "group"), "studio-cli-pointer-") {
t.Fatal("cli-pointer must take its own per-channel lock, never the 1.x workflow's release-cli-<channel> group")
}
if mappingScalar(concurrency, "cancel-in-progress") != "false" {
t.Fatal("cli-pointer must not cancel a run that is mid-write")
}
permissions := mappingValue(job, "permissions")
if permissions == nil || permissions.Kind != yaml.MappingNode || len(permissions.Content) != 2 ||
mappingScalar(permissions, "contents") != "write" {
t.Fatal("cli-pointer permissions must be exactly contents: write")
}
if !nodeContains(job, "scripts/publish-cli-pointer.sh") {
t.Fatal("cli-pointer must run scripts/publish-cli-pointer.sh")
}
if !nodeContains(job, "vars.CLI_PUBLISH_FROZEN") {
t.Fatal("cli-pointer must pass vars.CLI_PUBLISH_FROZEN to its script")
}
if name, found := refersTo(job, append([]string{"RELEASE_TAG_TOKEN"}, cliChannelSecrets...)); found {
t.Fatalf("cli-pointer reads %s; registry credentials belong to cli-channels only", name)
}
}
func TestCLIGateBlocksEveryCLIChannel(t *testing.T) {
root := parseWorkflowFile(t, "../../.github/workflows/release-studio.yml")
jobs := jobsOf(t, root)
gate := mappingValue(jobs, "cli-gate")
if gate == nil {
t.Fatal("cli-gate job is missing")
}
if got := mappingScalar(gate, "if"); got != "vars.STUDIO_PUBLISHES_CLI == 'true'" {
t.Fatalf("cli-gate if = %q, want the STUDIO_PUBLISHES_CLI switch", got)
}
if !nodeContains(gate, "vars.CLI_PUBLISH_FROZEN") {
t.Fatal("cli-gate must read vars.CLI_PUBLISH_FROZEN")
}
if nodeContains(gate, "actions/checkout") || nodeContains(gate, "secrets.") {
t.Fatal("cli-gate must run no repository code and read no secret")
}
for _, name := range []string{"cli-tag", "cli-channels", "cli-pointer"} {
needs := mappingValue(mappingValue(jobs, name), "needs")
found := false
for _, n := range needs.Content {
found = found || n.Value == "cli-gate"
}
if !found {
t.Fatalf("%s does not wait for cli-gate", name)
}
}
for _, name := range []string{"cli-channels", "cli-pointer"} {
found := false
for _, n := range mappingValue(mappingValue(jobs, name), "needs").Content {
found = found || n.Value == "cli-tag"
}
if !found {
t.Fatalf("%s does not wait for cli-tag", name)
}
}
found := false
for _, n := range mappingValue(mappingValue(jobs, "cli-channels"), "needs").Content {
found = found || n.Value == "cli-pointer"
}
if !found {
t.Fatal("cli-channels does not wait for cli-pointer: the cask would name archives that may not exist yet")
}
}
var releaseTagSecrets = []string{"RELEASE_TAG_TOKEN"}
func workflowFiles(t *testing.T) []string {
t.Helper()
var files []string
for _, pattern := range []string{"*.yml", "*.yaml"} {
found, err := filepath.Glob("../../.github/workflows/" + pattern)
if err != nil {
t.Fatal(err)
}
files = append(files, found...)
}
if len(files) == 0 {
t.Fatal("no workflows found")
}
return files
}
// The token may appear in one inline step of Studio's cli-tag job and in no
// other env scope: not the workflow's, not a job's, not another step's.
func TestReleaseTagTokenIsReadByOneInlineStep(t *testing.T) {
holders := 0
for _, file := range workflowFiles(t) {
root := parseWorkflowFile(t, file)
studio := filepath.Base(file) == "release-studio.yml"
for i := 0; i+1 < len(root.Content); i += 2 {
if root.Content[i].Value == "jobs" {
continue
}
if what, found := refersTo(root.Content[i+1], releaseTagSecrets); found {
t.Errorf("%s reaches %s at workflow level (%s)", file, what, root.Content[i].Value)
}
}
jobs := mappingValue(root, "jobs")
if jobs == nil {
continue
}
for i := 0; i+1 < len(jobs.Content); i += 2 {
id, job := jobs.Content[i].Value, jobs.Content[i+1]
allowed := studio && id == "cli-tag"
for j := 0; j+1 < len(job.Content); j += 2 {
key, value := job.Content[j].Value, job.Content[j+1]
if key != "steps" {
if what, found := refersTo(value, releaseTagSecrets); found {
t.Errorf("%s job %s reaches %s in %s; only a step of cli-tag may", file, id, what, key)
}
continue
}
for _, step := range value.Content {
if what, found := refersTo(step, releaseTagSecrets); found {
holders++
if !allowed {
t.Errorf("%s job %s reaches %s; only Studio's cli-tag step may", file, id, what)
}
if mappingScalar(step, "uses") != "" {
t.Errorf("%s job %s: the token step must be inline shell, not an action", file, id)
}
} else if allowed && mappingScalar(step, "uses") != "" {
t.Errorf("cli-tag must check out nothing and run no action")
}
}
}
}
}
if holders != 1 {
t.Fatalf("%d steps read RELEASE_TAG_TOKEN, want exactly one", holders)
}
}
@@ -0,0 +1,62 @@
package main
import (
"gopkg.in/yaml.v3"
"strings"
"testing"
)
func stepNamed(t *testing.T, job *yaml.Node, name string) *yaml.Node {
t.Helper()
steps := mappingValue(job, "steps")
for _, step := range steps.Content {
if mappingScalar(step, "name") == name {
return step
}
}
t.Fatalf("no step %q", name)
return nil
}
func TestStudioReleaseDecidesLatestFromTheFlagsScript(t *testing.T) {
root := parseWorkflowFile(t, "../../.github/workflows/release-studio.yml")
publish := mappingValue(jobsOf(t, root), "publish")
step := stepNamed(t, publish, "Publish GitHub release")
run := mappingScalar(step, "run")
env := mappingValue(step, "env")
if got := mappingScalar(env, "CANDIDATE"); got != "${{ needs.resolve.outputs.candidate }}" {
t.Fatalf("CANDIDATE = %q, want the resolve job's grammar-derived output", got)
}
if !strings.Contains(run, `scripts/studio-release-flags.sh "$TAG" "$CANDIDATE"`) {
t.Fatal("the release flags do not come from scripts/studio-release-flags.sh")
}
for _, flag := range []string{"--prerelease", "--latest"} {
if strings.Contains(run, flag) {
t.Errorf("the publish step spells %s itself; the decision belongs to the flags script", flag)
}
}
if strings.Contains(run, "gh release edit") && strings.Contains(run[strings.Index(run, "gh release edit"):], "--latest") {
t.Error("an existing release must not have its latest flag edited")
}
}
func TestStudioGitHubReleaseCarriesNoRootManifest(t *testing.T) {
root := parseWorkflowFile(t, "../../.github/workflows/release-studio.yml")
publish := mappingValue(jobsOf(t, root), "publish")
run := mappingScalar(stepNamed(t, publish, "Publish GitHub release"), "run")
if !strings.Contains(run, `= latest.json ]`) {
t.Fatal("the publish step does not filter latest.json out of the uploaded assets")
}
for line := range strings.SplitSeq(run, "\n") {
if strings.Contains(line, "gh release") && strings.Contains(line, "dist/") {
t.Errorf("gh uploads the dist glob, root latest.json included: %s", strings.TrimSpace(line))
}
}
if !strings.Contains(run, `"${assets[@]}"`) {
t.Fatal("the release is not created from the filtered asset list")
}
mirror := mappingScalar(stepNamed(t, publish, "Mirror to R2 and update the Studio catalog"), "run")
if !strings.Contains(mirror, `aws s3 cp dist/ "s3://${R2_BUCKET}/${TAG}/" --recursive`) {
t.Fatal("the per-tag manifest must still reach R2 with the rest of dist")
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

+1 -1
View File
@@ -19,7 +19,7 @@
"computer-live": "electron test/computer_live.js"
},
"devDependencies": {
"electron": "44.4.5",
"electron": "44.5.1",
"electron-builder": "^26.15.3",
"playwright": "1.63.0"
},
+11 -4
View File
@@ -7,11 +7,17 @@ const { chromium } = require("playwright");
const ASSETS = path.join(__dirname, "..", "assets");
const ICO_SIZES = [16, 20, 24, 32, 40, 48, 64, 256];
// The tray is drawn at 16 logical pixels; nativeImage picks the @Nx file that
// matches the display, so a scaled screen never enlarges the 16px one.
const TRAY_SCALES = [[1, ""], [1.25, "@1.25x"], [1.5, "@1.5x"], [2, "@2x"], [3, "@3x"]];
// The tray is drawn at 16 logical pixels. Windows asks for exactly 16*scale
// pixels and resizes whatever it is handed, so every Windows scale has its own
// file (src/trayimage.js picks it).
const TRAY_SCALES = [[1, ""], [1.25, "@1.25x"], [1.5, "@1.5x"], [1.75, "@1.75x"], [2, "@2x"], [2.5, "@2.5x"], [3, "@3x"]];
// The app icon's margin is the platform's to keep; a tray slot has none to spare.
const TRAY_VIEWBOX = 'viewBox="103 103 818 818"';
// Windows draws the .ico edge to edge beside neighbours that fill their cell, so
// its tile is cropped to a 2% margin and the glyph enlarged within it; macOS and
// Linux keep the full-canvas artwork the platform templates expect.
const WIN_VIEWBOX = 'viewBox="91 91 842 842"';
const WIN_GLYPH_SCALE = "scale(2.4)";
// PNG payloads for every type modern macOS reads; ic11–ic14 are the @2x slots.
const ICNS_TYPES = [
["ic04", 16], ["ic05", 32], ["ic07", 128], ["ic08", 256], ["ic09", 512], ["ic10", 1024],
@@ -73,8 +79,9 @@ async function main() {
for (const [scale, suffix] of TRAY_SCALES) {
fs.writeFileSync(path.join(ASSETS, `tray${suffix}.png`), await render(page, traySvg, 16 * scale));
}
const winSvg = svg.replace('viewBox="0 0 1024 1024"', WIN_VIEWBOX).replace("scale(1.9)", WIN_GLYPH_SCALE);
const icoPngs = [];
for (const size of ICO_SIZES) icoPngs.push([size, await at(size)]);
for (const size of ICO_SIZES) icoPngs.push([size, await render(page, winSvg, size)]);
fs.writeFileSync(path.join(ASSETS, "icon.ico"), ico(icoPngs));
const icnsPngs = [];
for (const [type, size] of ICNS_TYPES) icnsPngs.push([type, await at(size)]);
+5 -5
View File
@@ -9,8 +9,8 @@ importers:
.:
devDependencies:
electron:
specifier: 44.4.5
version: 44.4.5([email protected])
specifier: 44.5.1
version: 44.5.1([email protected])
electron-builder:
specifier: ^26.15.3
version: 26.15.3([email protected])([email protected])
@@ -374,8 +374,8 @@ packages:
resolution: {integrity: sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==}
engines: {node: '>=8.0.0'}
electron@44.4.5:
resolution: {integrity: sha512-SjgoaeYsSWZfJzubgQU7juvuXMTvn6/e1gAHdGFA/yuMbpF+I+skYqIJ6DdXBXHeWbkbpNpmwZCTpiivtlWZSw==}
electron@44.5.1:
resolution: {integrity: sha512-lx7AYoFIiyvEvgvpyWO9kOC60xtNPpiPZAth6Fmg9NutzpCAMLwpUlaBY2EXfZyIgUdzEmLMj9KvK0Vrokl1yQ==}
engines: {node: '>= 22.12.0'}
hasBin: true
@@ -1551,7 +1551,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
electron@44.4.5([email protected]):
electron@44.5.1([email protected]):
dependencies:
'@electron-internal/extract-zip': 1.0.5
'@electron/get': 5.1.0([email protected])
+2
View File
@@ -1,6 +1,7 @@
"use strict";
const crypto = require("node:crypto");
const { WebContentsView, session } = require("electron");
const { installPaneReload } = require("./reload");
const { guestNavigationAllowed, typedAddress } = require("./browserguard");
// The size a page lays out at while nobody is looking at it: the kernel drives
@@ -96,6 +97,7 @@ class BrowserViews {
if (allowed(to)) onPopup(to);
return { action: "deny" };
});
installPaneReload(contents);
contents.debugger.attach("1.3");
contents.debugger.on("message", (_event, method, params, sessionId) => {
if (sessionId) return;
+123 -13
View File
@@ -1,21 +1,131 @@
"use strict";
// The context menu's shape, kept apart from the platform so it can be checked
// without one. editFlags is the page's own account of what is possible at the
// click: roles do the clipboard work, this only decides what to offer.
function contextTemplate(params) {
if (!params.isEditable && !params.selectionText) return [];
const can = params.editFlags ?? {};
// Role labels come from the platform's own catalogue, which follows the
// system locale rather than the language the interface was set to, so they are
// stated here for the two languages the interface draws.
const WORDS = {
zh: {
edit: "编辑",
undo: "撤销",
redo: "重做",
cut: "剪切",
copy: "复制",
paste: "粘贴",
selectAll: "全选",
pasteAndMatchStyle: "粘贴并匹配样式",
delete: "删除",
substitutions: "替换",
showSubstitutions: "显示替换",
smartQuotes: "智能引号",
smartDashes: "智能破折号",
textReplacement: "文本替换",
speech: "语音",
startSpeaking: "开始朗读",
stopSpeaking: "停止朗读",
},
en: {
edit: "Edit",
undo: "Undo",
redo: "Redo",
cut: "Cut",
copy: "Copy",
paste: "Paste",
selectAll: "Select All",
pasteAndMatchStyle: "Paste and Match Style",
delete: "Delete",
substitutions: "Substitutions",
showSubstitutions: "Show Substitutions",
smartQuotes: "Smart Quotes",
smartDashes: "Smart Dashes",
textReplacement: "Text Replacement",
speech: "Speech",
startSpeaking: "Start Speaking",
stopSpeaking: "Stop Speaking",
},
};
function wordsFor(lang) {
return WORDS[lang] ?? WORDS.en;
}
// The edit commands as roles carrying explicit labels: roles do the clipboard
// work, the labels follow the interface language.
function editItems(lang, can) {
const w = wordsFor(lang);
const on = (flag) => (can ? { enabled: !!can[flag] } : {});
return [
{ role: "undo", enabled: !!can.canUndo },
{ role: "redo", enabled: !!can.canRedo },
{ role: "undo", label: w.undo, ...on("canUndo") },
{ role: "redo", label: w.redo, ...on("canRedo") },
{ type: "separator" },
{ role: "cut", enabled: !!can.canCut },
{ role: "copy", enabled: !!can.canCopy },
{ role: "paste", enabled: !!can.canPaste },
{ role: "cut", label: w.cut, ...on("canCut") },
{ role: "copy", label: w.copy, ...on("canCopy") },
{ role: "paste", label: w.paste, ...on("canPaste") },
{ type: "separator" },
{ role: "selectAll", enabled: !!can.canSelectAll },
{ role: "selectAll", label: w.selectAll, ...on("canSelectAll") },
];
}
module.exports = { contextTemplate };
// The context menu's shape, kept apart from the platform so it can be checked
// without one. editFlags is the page's own account of what is possible at the
// click: this only decides what to offer.
function contextTemplate(params, lang) {
if (!params.isEditable && !params.selectionText) return [];
return editItems(lang, params.editFlags ?? {});
}
// Everything the platform's own Edit menu carries, with the same roles, so
// only the words change.
function editMenuTemplate(lang) {
const w = wordsFor(lang);
const items = editItems(lang);
const at = items.findIndex((i) => i.role === "selectAll");
items.splice(at - 1, 1);
items.splice(at - 1, 0,
{ role: "pasteAndMatchStyle", label: w.pasteAndMatchStyle },
{ role: "delete", label: w.delete });
items.push(
{ type: "separator" },
{
label: w.substitutions,
submenu: [
{ role: "showSubstitutions", label: w.showSubstitutions },
{ type: "separator" },
{ role: "toggleSmartQuotes", label: w.smartQuotes },
{ role: "toggleSmartDashes", label: w.smartDashes },
{ role: "toggleTextReplacement", label: w.textReplacement },
],
},
{
label: w.speech,
submenu: [
{ role: "startSpeaking", label: w.startSpeaking },
{ role: "stopSpeaking", label: w.stopSpeaking },
],
},
);
return { label: w.edit, submenu: items };
}
function applicationMenuTemplate(lang) {
return [{ role: "appMenu" }, editMenuTemplate(lang), { role: "windowMenu" }];
}
// Only the Edit menu follows the interface language; the application and window
// menus are roles and follow the OS. Menu is injected so this runs without Electron.
function menuInstaller(Menu, platform = process.platform) {
let installedLang = null;
return function installApplicationMenu(languageOf = () => "en") {
if (platform !== "darwin") {
Menu.setApplicationMenu(null);
return null;
}
const lang = languageOf();
if (lang === installedLang) return Menu.getApplicationMenu();
installedLang = lang;
const menu = Menu.buildFromTemplate(applicationMenuTemplate(lang));
Menu.setApplicationMenu(menu);
return menu;
};
}
module.exports = { contextTemplate, editMenuTemplate, applicationMenuTemplate, menuInstaller };
+60 -13
View File
@@ -5,22 +5,42 @@ const PROTOCOL_VERSION = 1;
// A child that never sends a handshake must not be able to grow this process
// while it waits, nor hold the launch open forever.
const HANDSHAKE_LIMIT = 4096;
const HANDSHAKE_TIMEOUT_MS = 20000;
const HANDSHAKE_TIMEOUT_MS = 60000;
const SLOW_AFTER_MS = 3000;
// HostStartError says why a launch has no kernel. code is one of "timeout",
// "exited", "spawn", "overflow" or "malformed"; callers branch on it, never on
// the sentence.
class HostStartError extends Error {
constructor(code, message, detail = {}) {
super(message);
this.name = "HostStartError";
this.code = code;
Object.assign(this, detail);
}
}
// start spawns the kernel and reads the handshake it writes to stdout. Every
// line after it is an act a handover asks of this process, because that pipe is
// the only channel pointing this way. stdin is the lease: the kernel drains
// when this end closes, which is what stops it outliving a parent that exited
// without being asked to.
function start(binary, args, { onStderr, onExit, onAct } = {}) {
const child = spawn(binary, args, { stdio: ["pipe", "pipe", "pipe"] });
function start(binary, args, { onStderr, onExit, onAct, onSlow, systemLanguage, timeoutMs = HANDSHAKE_TIMEOUT_MS } = {}) {
const env = { ...process.env };
if (systemLanguage) env.REASONIX_SYSTEM_LANG = systemLanguage;
const child = spawn(binary, args, { stdio: ["pipe", "pipe", "pipe"], env });
child.stderr.setEncoding("utf8");
if (onStderr) child.stderr.on("data", onStderr);
if (onExit) child.on("exit", onExit);
const ready = firstLine(child).then(({ line, rest }) => {
const ready = firstLine(child, { onSlow, timeoutMs }).then(({ line, rest }) => {
// Only once the handshake parses: a child whose first line was not one has
// said nothing this process should act on.
const handshake = parse(line);
let handshake;
try {
handshake = parse(line);
} catch (err) {
throw new HostStartError("malformed", err.message);
}
if (onAct) readActs(child, rest, onAct);
return handshake;
});
@@ -60,19 +80,31 @@ function readActs(child, rest, onAct) {
drain();
}
function firstLine(child) {
function firstLine(child, { onSlow, timeoutMs }) {
return new Promise((resolve, reject) => {
let buffered = "";
const began = Date.now();
const elapsed = () => Date.now() - began;
const settle = (fn, value) => {
clearTimeout(timer);
clearTimeout(slow);
child.stdout.off("data", onData);
child.off("exit", onEarlyExit);
child.off("error", onSpawnFailure);
fn(value);
};
const slow = onSlow ? setTimeout(onSlow, Math.min(SLOW_AFTER_MS, timeoutMs)) : undefined;
const timer = setTimeout(
() => settle(reject, new Error("the kernel sent no handshake")),
HANDSHAKE_TIMEOUT_MS,
() =>
settle(
reject,
new HostStartError(
"timeout",
`the kernel was still running but sent no handshake within ${Math.round(timeoutMs / 1000)} s`,
{ elapsedMs: elapsed() },
),
),
timeoutMs,
);
const onData = (chunk) => {
buffered += chunk;
@@ -81,15 +113,22 @@ function firstLine(child) {
return settle(resolve, { line: buffered.slice(0, end), rest: buffered.slice(end + 1) });
}
if (buffered.length > HANDSHAKE_LIMIT) {
settle(reject, new Error("the handshake ran past its limit"));
settle(reject, new HostStartError("overflow", "the handshake ran past its limit"));
}
};
const onEarlyExit = (code) =>
settle(reject, new Error(`the kernel exited with ${code} before saying anything`));
const onEarlyExit = (code, signal) =>
settle(
reject,
new HostStartError("exited", `the kernel exited with ${code ?? `signal ${signal}`} before saying anything`, {
exitCode: code,
signal,
elapsedMs: elapsed(),
}),
);
// A program that could not be started emits this and never exits, so without
// it the launch waited out the handshake timeout and then reported the
// kernel as silent — which sent the reader looking at the kernel.
const onSpawnFailure = (err) => settle(reject, new Error(`the kernel could not be started: ${err.message}`));
const onSpawnFailure = (err) => settle(reject, new HostStartError("spawn", `the kernel could not be started: ${err.message}`, { elapsedMs: elapsed() }));
child.stdout.setEncoding("utf8");
child.stdout.on("data", onData);
child.on("exit", onEarlyExit);
@@ -128,4 +167,12 @@ function parse(line) {
return { origin: url.origin, token: body.token };
}
module.exports = { start, parse, readActs, PROTOCOL_VERSION };
const RETRY_WITHIN_MS = 10000;
// shouldRetry allows one more attempt only for a kernel that stopped, or could
// not be run, soon after it was started.
function shouldRetry(err, attempt, elapsedMs) {
return attempt < 2 && (err?.code === "exited" || err?.code === "spawn") && elapsedMs <= RETRY_WITHIN_MS;
}
module.exports = { shouldRetry, start, parse, readActs, HostStartError, PROTOCOL_VERSION, HANDSHAKE_TIMEOUT_MS };
+88 -25
View File
@@ -7,15 +7,17 @@ if (relaunchForOzonePlatform(app, process)) return;
const fs = require("node:fs/promises");
const { existsSync } = require("node:fs");
const path = require("node:path");
const { start } = require("./host");
const { start, shouldRetry, HANDSHAKE_TIMEOUT_MS } = require("./host");
const { showStarting } = require("./starting");
const { StudioHost } = require("./hostclient");
const { installTray } = require("./tray");
const { instanceID, profileFor } = require("./instance");
const { installApplicationMenu, installContextMenu } = require("./menu");
const { uiLanguage } = require("./uilang");
const { installFullScreenKey } = require("./fullscreen");
const { installReload } = require("./reload");
const { externalTarget } = require("./links");
const { reveal } = require("./reveal");
const { reveal, revealWorkspace } = require("./reveal");
const { appIcon } = require("./appicon");
const layout = require("./layout");
const { offerCleanup } = require("./legacy");
@@ -23,7 +25,7 @@ const { stripPackageGrants, unpaintedWindowCause } = require("./packagegrants");
const { BrowserProtocol } = require("./browserprotocol");
const { BrowserViews } = require("./browserviews");
const { startBrowserRelay } = require("./browserrelay");
const { prefsFile, registerPrefs } = require("./prefs");
const { loadPrefs, prefsFile, registerPrefs } = require("./prefs");
const { openLogs, redactArgv, failStartup } = require("./shelllog");
// A page in a minimized or fully covered window counts as hidden, and a hidden
@@ -45,6 +47,7 @@ const LIGHTS = { x: 11, y: 20 };
const DEFAULT_SIZE = { width: 1440, height: 900 };
const MIN_SIZE = { width: 760, height: 480 };
const HOST_DRAIN_MS = 1000;
const RETRY_DELAY_MS = 1000;
const where = {
packaged: app.isPackaged,
@@ -70,6 +73,70 @@ let reload = null;
let logs = null;
let handshaken = false;
let starting = null;
function closeStarting() {
const win = starting;
starting = null;
if (win && !win.isDestroyed()) win.close();
}
function handshakeTimeout() {
const ms = Number(process.env.REASONIX_STUDIO_HANDSHAKE_TIMEOUT_MS);
return Number.isFinite(ms) && ms > 0 ? ms : HANDSHAKE_TIMEOUT_MS;
}
// A kernel that exits or cannot be spawned within seconds is tried once more:
// a scanner holding a freshly written binary lets go about that fast. A slow
// kernel is waited for instead, never restarted.
async function launchKernel(args) {
for (let attempt = 1; attempt <= 2; attempt++) {
if (quitting) throw new Error("the launch was ended by quit");
const began = Date.now();
logs.shell.line(`host: starting ${hostBinary} (attempt ${attempt})`);
kernel = start(hostBinary, args, {
systemLanguage: app.getPreferredSystemLanguages()[0] ?? app.getLocale(),
timeoutMs: handshakeTimeout(),
onSlow: () => {
logs.shell.line("host: no handshake yet; showing the starting window");
if (starting || quitting) return;
const win = showStarting(app.getLocale());
starting = win;
win.once("closed", () => {
if (starting !== win) return;
starting = null;
logs.shell.line("host: starting window closed; ending the launch");
app.quit();
});
},
onStderr: (text) => {
logs.host.raw(text);
process.stderr.write(text);
},
onExit: (code, signal) => {
logs.shell.line(`host: exited code=${code} signal=${signal}${handshaken ? "" : " before its handshake"}`);
// Before the handshake the launch itself fails, and boot's catch owns
// telling the person why; quitting here would race that dialog.
if (handshaken && code !== 0 && !quitting) app.quit();
},
onAct: handOver,
});
const current = kernel;
current.child.on("error", (err) => logs.shell.line(`host: spawn failed: ${err.message}`));
current.child.stderr.on("close", () => logs.host.flush());
try {
return await current.ready;
} catch (err) {
if (quitting || !shouldRetry(err, attempt, Date.now() - began)) {
err.attempts = attempt;
closeStarting();
throw err;
}
logs.shell.line(`host: ${err.message}; retrying once`);
await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS));
}
}
}
async function boot() {
// Which build this is belongs to the shell: inside the bundle the kernel's
// own os.Executable() names the host binary, not the application around it.
@@ -86,23 +153,7 @@ async function boot() {
// inside the bundle rather than being it.
args.push("-studio-app", process.execPath, "-studio-app-pid", String(process.pid));
}
logs.shell.line(`host: starting ${hostBinary}`);
kernel = start(hostBinary, args, {
onStderr: (text) => {
logs.host.raw(text);
process.stderr.write(text);
},
onExit: (code, signal) => {
logs.shell.line(`host: exited code=${code} signal=${signal}${handshaken ? "" : " before its handshake"}`);
// Before the handshake the launch itself fails, and boot's catch owns
// telling the person why; quitting here would race that dialog.
if (handshaken && code !== 0 && !quitting) app.quit();
},
onAct: handOver,
});
kernel.child.on("error", (err) => logs.shell.line(`host: spawn failed: ${err.message}`));
kernel.child.stderr.on("close", () => logs.host.flush());
const ready = await kernel.ready;
const ready = await launchKernel(args);
logs.addSecret(ready.token);
handshaken = true;
logs.shell.line(`host: handshake from ${ready.origin}`);
@@ -110,13 +161,14 @@ async function boot() {
client = new StudioHost(ready.origin, ready.token);
await armCredential(ready);
win = createWindow();
closeStarting();
guard(win.webContents);
win.webContents.once("render-process-gone", (_event, details) => {
if (win.isVisible() || details.reason !== "crashed") return;
const cause = unpaintedWindowCause(grants, app.getLocale());
if (cause) dialog.showErrorBox(cause.title, cause.detail);
});
installContextMenu(win.webContents, win);
installContextMenu(win.webContents, win, uiLang);
installFullScreenKey(win.webContents, win);
reload = installReload(win.webContents, win);
win.once("ready-to-show", () => win.show());
@@ -201,6 +253,7 @@ function onWindowClose(event) {
// showWindow brings it back from wherever it went. Show alone is a no-op on a
// window that is merely buried, so the focus is what actually raises it.
function showWindow() {
if (starting && !starting.isDestroyed()) starting.focus();
if (quitting || !win || win.isDestroyed()) return;
if (win.isMinimized()) win.restore();
reload?.revive();
@@ -263,7 +316,10 @@ function fromWindow(event) {
return win && !win.isDestroyed() && event.sender === win.webContents ? win : null;
}
registerPrefs(ipcMain, () => prefsFile(app.getPath("userData")), fromWindow);
// The page reads navigator.languages[0], which is the first preferred system
// language; app.getLocale() is the locale Chromium resolved, which can differ.
const uiLang = () => uiLanguage(loadPrefs(prefsFile(app.getPath("userData"))), app.getPreferredSystemLanguages()[0] ?? app.getLocale());
registerPrefs(ipcMain, () => prefsFile(app.getPath("userData")), fromWindow, () => installApplicationMenu(uiLang));
ipcMain.handle("window:minimise", (event) => {
fromWindow(event)?.minimize();
@@ -300,8 +356,11 @@ ipcMain.handle("browser:login-answer", (event, id, username, password) => {
ipcMain.handle("shell:open-external", (event, raw) => {
if (!fromWindow(event)) return;
const target = externalTarget(raw);
if (target) void shell.openExternal(target);
if (target) return shell.openExternal(target);
});
ipcMain.handle("shell:reveal-workspace", (event, root) =>
fromWindow(event) && client ? revealWorkspace(client, shell, String(root)) : { code: "", error: "no window" },
);
ipcMain.handle("shell:reveal", (event, base, rel) =>
fromWindow(event) && client ? reveal(client, shell, String(base), String(rel)) : { code: "", error: "no window" },
);
@@ -377,7 +436,7 @@ if (!primary) {
app.whenReady().then(() => {
if (!primary) return;
installApplicationMenu();
installApplicationMenu(uiLang);
boot().catch((err) => {
console.error("reasonix-studio:", err.message);
if (quitting) {
@@ -423,7 +482,11 @@ function handOver(act) {
if (act === "quit") app.quit();
}
app.on("window-all-closed", () => app.quit());
// Before the handshake the only window is the starting one, and the launch
// decides for itself whether to go on.
app.on("window-all-closed", () => {
if (handshaken) app.quit();
});
// Closing this end of the pipe is what tells the kernel to drain. Without it a
// session file is left being written by a process nobody is holding open.
+4 -16
View File
@@ -1,31 +1,19 @@
"use strict";
const { Menu } = require("electron");
const { contextTemplate } = require("./editmenu");
const { contextTemplate, menuInstaller } = require("./editmenu");
// Without an application menu a WebContents has no copy, paste or undo at all:
// macOS routes those shortcuts through it, and a window with none reads as a
// broken text editor. Elsewhere the bar would render inside the window, and
// those platforms bind the shortcuts themselves.
function installApplicationMenu() {
if (process.platform !== "darwin") {
Menu.setApplicationMenu(null);
return null;
}
const menu = Menu.buildFromTemplate([
{ role: "appMenu" },
{ role: "editMenu" },
{ role: "windowMenu" },
]);
Menu.setApplicationMenu(menu);
return menu;
}
const installApplicationMenu = menuInstaller(Menu);
// A production build ships without one, so a right-click in a text field offered
// nothing at all. Roles rather than handlers: the clipboard work belongs to the
// platform, and editFlags is the page's own account of what is possible here.
function installContextMenu(contents, window) {
function installContextMenu(contents, window, languageOf = () => "en") {
contents.on("context-menu", (_event, params) => {
const template = contextTemplate(params);
const template = contextTemplate(params, languageOf());
if (!template.length) return;
Menu.buildFromTemplate(template).popup({ window });
});
+2 -1
View File
@@ -44,7 +44,7 @@ function savePrefs(file, prefs) {
// in the same process and must not reach this file.
// fileOf is asked on each use: the profile directory is settled during boot,
// after these handlers exist.
function registerPrefs(ipcMain, fileOf, fromWindow) {
function registerPrefs(ipcMain, fileOf, fromWindow, onSave = () => {}) {
ipcMain.on("prefs:load", (event) => {
event.returnValue = fromWindow(event) ? loadPrefs(fileOf()) : {};
});
@@ -52,6 +52,7 @@ function registerPrefs(ipcMain, fileOf, fromWindow) {
if (fromWindow(event)) {
try {
savePrefs(fileOf(), prefs);
onSave();
} catch {
// A preference that did not save is one relaunch of lost state, not a
// reason to fail the window.
+2
View File
@@ -28,6 +28,8 @@ contextBridge.exposeInMainWorld("reasonixHost", {
openExternal: (url) => ipcRenderer.invoke("shell:open-external", String(url)),
// A pane and a path inside its workspace; main asks the kernel where that is.
revealPath: (base, rel) => ipcRenderer.invoke("shell:reveal", String(base), String(rel)),
// A project the sidebar lists, which may have no pane at all.
revealWorkspace: (root) => ipcRenderer.invoke("shell:reveal-workspace", String(root)),
// Where a dropped file lives. Resolved here rather than in the page: the
// renderer is handed a File and never a path, and a turn that has to work on
// the file itself cannot do it on a copy of the bytes.
+26 -10
View File
@@ -1,22 +1,38 @@
"use strict";
// No menu this shell installs carries a reload role, and a page gone blank,
// whether its tree unmounted or its renderer died, has no way back but
// quitting. The kernel owns every running turn and a loaded page finds it again.
// A page gone blank, whether its tree unmounted or its renderer died, has no
// way back but quitting. The kernel owns every running turn and a loaded page
// finds it again. F5 and Ctrl/Cmd+R belong to the page, so the recovery chord
// is the shifted one.
const CRASH_RELOADS = 3;
const CRASH_WINDOW_MS = 60_000;
function reloadAction(input, platform = process.platform) {
if (input.type !== "keyDown" || input.isAutoRepeat || input.alt) return null;
const mod = platform === "darwin" ? input.meta && !input.control : input.control && !input.meta;
const latin = typeof input.key === "string" && /^[a-z]$/i.test(input.key);
const isR = latin ? input.key.toLowerCase() === "r" : input.code === "KeyR";
if (mod && isR) return input.shift ? "hard" : "reload";
if (!input.control && !input.meta && !input.shift && input.key === "F5") return "reload";
return null;
}
function installPaneReload(contents, platform = process.platform) {
contents.on("before-input-event", (event, input) => {
const action = reloadAction(input, platform);
if (!action) return;
event.preventDefault();
if (action === "hard") contents.reloadIgnoringCache();
else contents.reload();
});
}
// A dead renderer's input never reaches before-input-event, so the crash itself
// has to trigger the reload, or for a hidden window the next revive before it is
// shown. A page that dies on every load stops being reloaded.
function installReload(contents, window, { platform = process.platform, now = Date.now } = {}) {
const mac = platform === "darwin";
contents.on("before-input-event", (event, input) => {
if (input.type !== "keyDown" || input.isAutoRepeat || input.alt || input.shift) return;
const mod = mac ? input.meta && !input.control : input.control && !input.meta;
const bare = !input.control && !input.meta;
const chord = mod && (input.key === "r" || input.key === "R" || input.code === "KeyR");
if (!chord && !(bare && input.key === "F5")) return;
if (reloadAction(input, platform) !== "hard") return;
event.preventDefault();
contents.reload();
});
@@ -40,4 +56,4 @@ function installReload(contents, window, { platform = process.platform, now = Da
};
}
module.exports = { installReload, CRASH_RELOADS, CRASH_WINDOW_MS };
module.exports = { installReload, installPaneReload, reloadAction, CRASH_RELOADS, CRASH_WINDOW_MS };
+15 -2
View File
@@ -23,9 +23,13 @@ function local(target, platform) {
async function locate(client, base, rel, platform) {
if (!PANE_BASE.test(base)) return { refusal: refused("not a pane this window publishes") };
const query = rel ? `?path=${encodeURIComponent(rel)}` : "";
return ask(client, `${base}/workspace/locate${query}`, platform);
}
async function ask(client, url, platform) {
let res;
try {
res = await client.request("GET", `${base}/workspace/locate${query}`);
res = await client.request("GET", url);
} catch (err) {
return { refusal: refused(err.message) };
}
@@ -54,4 +58,13 @@ async function reveal(client, shell, base, rel, platform = process.platform) {
return null;
}
module.exports = { reveal };
// A project the sidebar lists needs no pane: the hub answers for the folders
// it lists and refuses any other, so the page still names no location itself.
async function revealWorkspace(client, shell, root, platform = process.platform) {
const found = await ask(client, `/host/workspaces/locate?root=${encodeURIComponent(String(root))}`, platform);
if (found.refusal) return found.refusal;
shell.showItemInFolder(found.target);
return null;
}
module.exports = { reveal, revealWorkspace };
+25 -12
View File
@@ -159,17 +159,29 @@ function openLogs(userData, options = {}) {
};
}
function startupFailure(locale, reason, logDir) {
if (String(locale).toLowerCase().startsWith("zh")) {
return {
title: "Reasonix Studio 无法启动",
detail: `${reason}\n\n日志位于:\n${logDir}`,
};
const HINTS = {
timeout: [
"The kernel started but did not finish starting in time. Security software scanning a new or updated install is a common cause; starting Studio again usually works.",
"内核已启动,但没有在限定时间内完成启动。安全软件扫描新安装或刚更新的程序是常见原因;再次启动通常可以。",
],
exited: [
"The kernel process stopped before it was ready. Anything it printed is above; host.log has the rest.",
"内核进程在就绪前就停止了。它输出过的内容在上面,host.log 里有更多。",
],
spawn: [
"The kernel program could not be run. Security software blocking or locking it is a common cause.",
"无法运行内核程序。安全软件拦截或占用它是常见原因。",
],
};
function startupFailure(locale, reason, logDir, code) {
const zh = String(locale).toLowerCase().startsWith("zh");
const hint = HINTS[code]?.[zh ? 1 : 0];
const body = hint ? `${reason}\n\n${hint}` : reason;
if (zh) {
return { title: "Reasonix Studio 无法启动", detail: `${body}\n\n日志位于:\n${logDir}` };
}
return {
title: "Reasonix Studio could not start",
detail: `${reason}\n\nLogs are in:\n${logDir}`,
};
return { title: "Reasonix Studio could not start", detail: `${body}\n\nLogs are in:\n${logDir}` };
}
// failStartup is the one way a launch that cannot come up ends: recorded, told
@@ -177,8 +189,9 @@ function startupFailure(locale, reason, logDir) {
// words when it never finished its handshake, and is already redacted.
function failStartup({ app, dialog, logs, locale }, err, hostOutput = "") {
logs.shell.line(`startup failed: ${err?.stack || err}`);
const reason = [String(err?.message || err), hostOutput].filter(Boolean).join("\n\n");
const text = startupFailure(locale, logs.redact(reason), logs.dir);
const tried = err?.attempts > 1 ? ` (after ${err.attempts} attempts)` : "";
const reason = [`${String(err?.message || err)}${tried}`, hostOutput].filter(Boolean).join("\n\n");
const text = startupFailure(locale, logs.redact(reason), logs.dir, err?.code);
try {
dialog.showErrorBox(text.title, text.detail);
} catch (e) {
+41
View File
@@ -0,0 +1,41 @@
"use strict";
const { BrowserWindow } = require("electron");
const TEXT = {
en: ["Reasonix Studio is starting", "The first start after installing or rebooting can take a minute."],
zh: ["Reasonix Studio 正在启动", "安装或重启电脑后的首次启动可能需要一分钟。"],
};
function startingPage(locale) {
const [title, note] = String(locale).toLowerCase().startsWith("zh") ? TEXT.zh : TEXT.en;
return `<!doctype html><meta charset="utf-8"><title>${title}</title><style>
:root{color-scheme:light dark;--bg:#fafafa;--fg:#1c1c1e;--mute:#6b6b70}
@media(prefers-color-scheme:dark){:root{--bg:#1b1b1d;--fg:#ececee;--mute:#9a9aa0}}
body{margin:0;height:100vh;display:flex;flex-direction:column;justify-content:center;gap:8px;padding:0 28px;box-sizing:border-box;background:var(--bg);color:var(--fg);font:14px system-ui,sans-serif}
h1{margin:0;font-size:16px;font-weight:600}p{margin:0;color:var(--mute);line-height:1.5}
.bar{height:3px;margin-top:10px;border-radius:2px;background:var(--mute);opacity:.35;overflow:hidden;position:relative}
.bar::after{content:"";position:absolute;inset:0 70% 0 0;background:var(--fg);animation:run 1.4s ease-in-out infinite}
@keyframes run{from{transform:translateX(-100%)}to{transform:translateX(340%)}}
</style><h1>${title}</h1><p>${note}</p><div class="bar"></div>`;
}
// showStarting is the only sign of life while the kernel has not answered: until
// it does there is no window of the application's own to draw.
function showStarting(locale) {
const win = new BrowserWindow({
width: 380,
height: 150,
resizable: false,
minimizable: false,
maximizable: false,
frame: true,
title: "Reasonix Studio",
autoHideMenuBar: true,
webPreferences: { sandbox: true, contextIsolation: true, nodeIntegration: false },
});
win.removeMenu();
void win.loadURL(`data:text/html;charset=utf-8,${encodeURIComponent(startingPage(locale))}`);
return win;
}
module.exports = { showStarting, startingPage };
+7 -4
View File
@@ -1,18 +1,17 @@
"use strict";
const path = require("node:path");
const { Menu, Tray, nativeImage } = require("electron");
const { Menu, Tray, nativeImage, screen } = require("electron");
const { trayImage } = require("./trayimage.js");
// How often the fold is re-read. It is a projection the kernel recomputes on
// demand, so a missed read costs nothing the next one does not restore — which
// is why it is pulled on a timer rather than carried on the stream.
const FOLD_INTERVAL_MS = 5000;
const ICON = path.join(__dirname, "..", "assets", "tray.png");
// installTray brings the icon up and reports whether there is one. A shell with
// no icon must never background its window: hiding it would leave a running
// session with nothing left to bring it back.
function installTray(host, { onOpen, onQuit }) {
const image = nativeImage.createFromPath(ICON);
const image = trayImage(nativeImage, screen.getPrimaryDisplay().scaleFactor);
if (image.isEmpty()) return null;
const icon = new Tray(image);
const state = { fold: null, prefs: null };
@@ -47,6 +46,9 @@ function installTray(host, { onOpen, onQuit }) {
);
};
const refit = () => icon.setImage(trayImage(nativeImage, screen.getPrimaryDisplay().scaleFactor));
if (process.platform === "win32") screen.on("display-metrics-changed", refit);
icon.on("click", onOpen);
const timer = setInterval(() => void refresh(), FOLD_INTERVAL_MS);
@@ -68,6 +70,7 @@ function installTray(host, { onOpen, onQuit }) {
refresh,
close() {
clearInterval(timer);
screen.removeListener("display-metrics-changed", refit);
icon.destroy();
},
};
+30
View File
@@ -0,0 +1,30 @@
"use strict";
const fs = require("node:fs");
const path = require("node:path");
const ASSETS = path.join(__dirname, "..", "assets");
const SCALES = [
[1, ""],
[1.25, "@1.25x"],
[1.5, "@1.5x"],
[1.75, "@1.75x"],
[2, "@2x"],
[2.5, "@2.5x"],
[3, "@3x"],
];
function trayAsset(scaleFactor) {
const want = Number.isFinite(scaleFactor) && scaleFactor > 0 ? scaleFactor : 1;
const hit = SCALES.find(([scale]) => scale >= want - 1e-6) ?? SCALES[SCALES.length - 1];
return { file: path.join(ASSETS, `tray${hit[1]}.png`), pixels: Math.round(16 * hit[0]) };
}
// Windows rebuilds the tray icon from the 1x bitmap, resizing it to the small
// icon metric, so the file is loaded as 1x pixels of exactly that size. Other
// platforms choose among the @Nx files themselves.
function trayImage(nativeImage, scaleFactor) {
if (process.platform !== "win32") return nativeImage.createFromPath(path.join(ASSETS, "tray.png"));
return nativeImage.createFromBuffer(fs.readFileSync(trayAsset(scaleFactor).file));
}
module.exports = { trayAsset, trayImage, SCALES };
+17
View File
@@ -0,0 +1,17 @@
"use strict";
// The interface language the page will draw in, decided from the same two
// facts it uses: its saved choice (rx-lang) and, for anything but an explicit
// zh or en, the machine's first locale.
function isChinese(tag) {
const s = String(tag ?? "").toLowerCase();
return s.startsWith("zh") || s.startsWith("yue") || s.startsWith("cmn") || s.includes("hans") || s.includes("hant");
}
function uiLanguage(prefs, machineLocale) {
const want = String(prefs?.["rx-lang"] ?? "").trim().toLowerCase();
if (want === "zh" || want === "en") return want;
return isChinese(machineLocale) ? "zh" : "en";
}
module.exports = { uiLanguage };
+3 -3
View File
@@ -303,11 +303,11 @@ async function menuChecks(win, js) {
const menu = Menu.getApplicationMenu();
const roles = (menu?.items ?? []).map((i) => String(i.role).toLowerCase());
check("the application menu is installed", !!menu);
check("it carries the three menus macOS routes through", ["appmenu", "editmenu", "windowmenu"].every((r) => roles.includes(r)), roles);
check("it carries the three menus macOS routes through", ["appmenu", "windowmenu"].every((r) => roles.includes(r)) && menu.items.length === 3, roles);
const edit = (menu?.items ?? []).find((i) => String(i.role).toLowerCase() === "editmenu");
const edit = (menu?.items ?? [])[1];
const editRoles = (edit?.submenu?.items ?? []).map((i) => String(i.role).toLowerCase());
check("the edit menu carries every editing command", ["undo", "redo", "cut", "copy", "paste", "selectall"].every((r) => editRoles.includes(r)), editRoles);
check("the edit menu carries every editing command", ["undo", "redo", "cut", "copy", "paste", "pasteandmatchstyle", "delete", "selectall"].every((r) => editRoles.includes(r)), editRoles);
app.focus({ steal: true });
win.focus();
+256 -28
View File
@@ -6,8 +6,9 @@ import os from "node:os";
import fs from "node:fs";
const require = createRequire(import.meta.url);
const { parse, readActs } = require("../src/host.js");
const { contextTemplate } = require("../src/editmenu.js");
const { parse, readActs, start } = require("../src/host.js");
const { contextTemplate, editMenuTemplate, applicationMenuTemplate, menuInstaller } = require("../src/editmenu.js");
const { uiLanguage } = require("../src/uilang.js");
const { externalTarget } = require("../src/links.js");
const { offerCleanup, ownBundle } = require("../src/legacy.js");
const { stripPackageGrants, readReport, unpaintedWindowCause } = require("../src/packagegrants.js");
@@ -16,6 +17,23 @@ const { pick, loadPrefs, savePrefs, registerPrefs } = require("../src/prefs.js")
const TOKEN = "a".repeat(64);
const line = (over) => JSON.stringify({ version: 1, origin: "http://127.0.0.1:8080", token: TOKEN, ...over });
test("the spawned host receives the system language and inherits explicit locale overrides", async () => {
const script = `console.log(${JSON.stringify(line())});
console.log(JSON.stringify({act: JSON.stringify({system: process.env.REASONIX_SYSTEM_LANG,
explicit: process.env.REASONIX_LANG})}));`;
const before = process.env.REASONIX_SYSTEM_LANG;
const explicit = process.env.REASONIX_LANG;
const state = new Promise((resolve) => {
const host = start(process.execPath, ["-e", script], {
systemLanguage: "zh-Hant-TW",
onAct: (act) => resolve(JSON.parse(act)),
});
host.ready.catch(resolve);
});
assert.deepEqual(await state, { system: "zh-Hant-TW", ...(explicit === undefined ? {} : { explicit }) });
assert.equal(process.env.REASONIX_SYSTEM_LANG, before);
});
test("the handshake is accepted only when every field accounts for itself", () => {
assert.deepEqual(parse(line()), { origin: "http://127.0.0.1:8080", token: TOKEN });
@@ -63,6 +81,68 @@ test("the context menu mirrors what the page says is possible", () => {
});
});
test("the edit menu's labels follow the interface language, not the system's", () => {
const params = { isEditable: true, selectionText: "", editFlags: {} };
const labels = (lang) => contextTemplate(params, lang).filter((i) => i.role).map((i) => i.label);
assert.deepEqual(labels("zh"), ["撤销", "重做", "剪切", "复制", "粘贴", "全选"]);
assert.deepEqual(labels("en"), ["Undo", "Redo", "Cut", "Copy", "Paste", "Select All"]);
assert.equal(editMenuTemplate("zh").label, "编辑");
});
test("the edit menu keeps everything the platform's own one carries", () => {
const roles = (items) => items.flatMap((i) => [i.role, ...(i.submenu ? roles(i.submenu) : [])]).filter(Boolean);
const want = ["undo", "redo", "cut", "copy", "paste", "pasteAndMatchStyle", "delete", "selectAll",
"showSubstitutions", "toggleSmartQuotes", "toggleSmartDashes", "toggleTextReplacement", "startSpeaking", "stopSpeaking"];
for (const lang of ["zh", "en"]) {
assert.deepEqual(roles(editMenuTemplate(lang).submenu), want);
const labels = (items) => items.flatMap((i) => [i.label, ...(i.submenu ? labels(i.submenu) : [])]).filter((l) => l !== undefined);
assert.ok(labels(editMenuTemplate(lang).submenu).every((l) => l.length > 0));
}
assert.deepEqual(editMenuTemplate("en").submenu.map((i) => i.role ?? i.type ?? i.label),
["undo", "redo", "separator", "cut", "copy", "paste", "pasteAndMatchStyle", "delete", "selectAll", "separator", "Substitutions", "Speech"]);
assert.deepEqual(applicationMenuTemplate("zh").map((i) => i.role ?? "edit"), ["appMenu", "edit", "windowMenu"]);
});
test("the application menu is rebuilt when the language changes and not otherwise", () => {
const built = [];
const Menu = {
buildFromTemplate: (t) => (built.push(t), { template: t }),
setApplicationMenu: () => {},
getApplicationMenu: () => null,
};
const install = menuInstaller(Menu, "darwin");
let lang = "en";
install(() => lang);
install(() => lang);
assert.equal(built.length, 1);
lang = "zh";
install(() => lang);
assert.equal(built.length, 2);
assert.equal(built[1][1].label, "编辑");
let cleared = 0;
menuInstaller({ ...Menu, setApplicationMenu: () => cleared++ }, "linux")(() => "zh");
assert.equal(cleared, 1);
assert.equal(built.length, 2);
});
test("the interface language is the page's own choice, else the machine's", () => {
assert.equal(uiLanguage({ "rx-lang": "zh" }, "en-US"), "zh");
assert.equal(uiLanguage({ "rx-lang": "en" }, "zh-CN"), "en");
assert.equal(uiLanguage({ "rx-lang": "" }, "zh-Hans-CN"), "zh");
assert.equal(uiLanguage({}, "fr-FR"), "en");
assert.equal(uiLanguage(undefined, undefined), "en");
});
test("a saved preference tells the shell so it can follow it", () => {
const handlers = {};
const ipc = { on: (name, fn) => { handlers[name] = fn; } };
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rx-prefs-"));
let saved = 0;
registerPrefs(ipc, () => path.join(dir, "p.json"), () => true, () => { saved++; });
handlers["prefs:save"]({ returnValue: null }, { "rx-lang": "zh" });
assert.equal(saved, 1);
});
test("only http and https ever reach the platform opener", () => {
assert.equal(externalTarget("https://example.test/a"), "https://example.test/a");
assert.equal(externalTarget("http://example.test/"), "http://example.test/");
@@ -124,7 +204,7 @@ test("an unreachable kernel is an answer, not a crash", async () => {
assert.equal(await dead.trayState(), null);
});
const { reveal } = require("../src/reveal.js");
const { reveal, revealWorkspace } = require("../src/reveal.js");
// A kernel that answers /workspace/locate as the test says, and a shell that
// only records what it was asked to open.
@@ -143,7 +223,7 @@ async function revealRig(answer, platform = process.platform) {
openPath: async (p) => (opened.push(["open", p]), ""),
showItemInFolder: (p) => opened.push(["select", p]),
};
return { asked, opened, run: (base, rel) => reveal(client, shell, base, rel, platform), close: () => server.close() };
return { asked, opened, run: (base, rel) => reveal(client, shell, base, rel, platform), workspace: (root) => revealWorkspace(client, shell, root, platform), close: () => server.close() };
}
const ROOT = path.resolve(os.tmpdir(), "rx-workspace");
@@ -194,6 +274,22 @@ test("the page cannot steer reveal to a location the kernel did not name", async
}
});
test("a listed project is shown through the hub and only on its answer", async () => {
const rig = await revealRig((url) =>
url.pathname === "/host/workspaces/locate" && url.searchParams.get("root") === "/work/a b"
? [200, { path: path.join(ROOT, "a b"), dir: true }]
: [404, { code: "workspace.not_listed", error: "not listed" }],
);
try {
assert.equal(await rig.workspace("/work/a b"), null);
assert.equal((await rig.workspace("/etc")).code, "workspace.not_listed");
assert.deepEqual(rig.opened, [["select", path.join(ROOT, "a b")]]);
assert.equal(rig.asked[0], "/host/workspaces/locate?root=%2Fwork%2Fa%20b");
} finally {
rig.close();
}
});
// A root that is an .app bundle, or a link to one, is a directory to stat and
// an application to `open`: handing it to openPath would launch it.
test("the workspace root is selected, never opened", async () => {
@@ -314,6 +410,79 @@ test("a kernel that cannot be started says so, rather than going quiet", async (
});
});
test("a launch failure carries a typed cause, and a slow kernel is waited for, not restarted", async () => {
const { start } = require("../src/host.js");
const node = process.execPath;
let slow = 0;
const silent = start(node, ["-e", "setTimeout(()=>{},5000)"], { timeoutMs: 400, onSlow: () => slow++ });
await assert.rejects(silent.ready, (err) => {
assert.equal(err.code, "timeout");
assert.match(err.message, /still running/);
return true;
});
silent.child.kill();
assert.equal(slow, 1, "the slow state was not reported once");
const quick = start(node, ["-e", "process.exit(7)"]);
await assert.rejects(quick.ready, (err) => err.code === "exited" && err.exitCode === 7 && /exited with 7/.test(err.message));
const missing = start(path.join(os.tmpdir(), "reasonix-no-such-kernel-c9"), []);
await assert.rejects(missing.ready, (err) => err.code === "spawn");
const handshake = JSON.stringify({ version: 1, origin: "http://127.0.0.1:1", token: "x".repeat(32) });
const fine = start(node, ["-e", `console.log(${JSON.stringify(handshake)});setTimeout(()=>{},300)`], { timeoutMs: 400 });
assert.equal((await fine.ready).origin, "http://127.0.0.1:1");
});
test("a retry needs an early stop, is capped at one, and never follows a timeout", () => {
const { shouldRetry } = require("../src/host.js");
const exited = { code: "exited" };
assert.equal(shouldRetry(exited, 1, 500), true);
assert.equal(shouldRetry({ code: "spawn" }, 1, 500), true);
assert.equal(shouldRetry(exited, 1, 10001), false, "an exit after the early window was retried");
assert.equal(shouldRetry(exited, 2, 500), false, "a second retry was allowed");
assert.equal(shouldRetry({ code: "timeout" }, 1, 500), false);
assert.equal(shouldRetry(new Error("x"), 1, 500), false);
});
test("a handshake that does not parse is a typed failure", async () => {
const { start } = require("../src/host.js");
const bad = start(process.execPath, ["-e", "console.log('hello')"]);
await assert.rejects(bad.ready, (err) => err.code === "malformed");
});
test("a kernel that never answers is started once and not retried", { skip: process.platform === "win32" }, async () => {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "reasonix-silent-"));
const host = path.join(dir, "host.sh");
fs.writeFileSync(host, "#!/bin/sh\nexec sleep 5\n", { mode: 0o755 });
process.env.REASONIX_STUDIO_HANDSHAKE_TIMEOUT_MS = "400";
const shell = loadShell({ lock: true, host });
try {
await shell.quitted;
const log = shell.shellLog();
assert.equal((log.match(/host: starting /g) || []).length, 1);
assert.doesNotMatch(log, /retrying once/);
assert.match(shell.calls[0][2], /still running/);
} finally {
delete process.env.REASONIX_STUDIO_HANDSHAKE_TIMEOUT_MS;
shell.cleanup();
fs.rmSync(dir, { recursive: true, force: true });
}
});
test("each failure cause gets its own explanation in both languages", () => {
const { startupFailure } = require("../src/shelllog.js");
const seen = new Set();
for (const code of ["timeout", "exited", "spawn"]) {
for (const locale of ["en", "zh-CN"]) {
const { detail } = startupFailure(locale, "r", "/logs", code);
assert.ok(!seen.has(detail), `${code}/${locale} repeated another cause's text`);
seen.add(detail);
}
}
assert.equal(startupFailure("en", "r", "/logs", "overflow").detail, "r\n\nLogs are in:\n/logs");
});
// A fake child: only the stdout half readActs touches, and a way to push bytes
// through it in whatever chunks the test wants -- which is the point, since the
// bug this guards is a line split across two of them.
@@ -849,30 +1018,67 @@ function reloadRig(platform = "darwin") {
return { state, send, gone, revive };
}
test("the reload key brings back a window whose page stopped drawing", () => {
const press = (over) => ({ type: "keyDown", key: "r", code: "KeyR", control: false, alt: false, shift: false, meta: false, isAutoRepeat: false, ...over });
const cases = [
["darwin", { meta: true }, { control: true }],
["win32", { control: true }, { meta: true }],
["linux", { control: true }, { meta: true }],
];
for (const [platform, mod, other] of cases) {
const reloadPress = (over) => ({ type: "keyDown", key: "r", code: "KeyR", control: false, alt: false, shift: false, meta: false, isAutoRepeat: false, ...over });
const reloadMods = [
["darwin", { meta: true }, { control: true }],
["win32", { control: true }, { meta: true }],
["linux", { control: true }, { meta: true }],
];
test("reloadAction reads the chord, not the layout", () => {
const { reloadAction } = require("../src/reload.js");
for (const [platform, mod, other] of reloadMods) {
const at = (input) => reloadAction(input, platform);
assert.equal(at(reloadPress(mod)), "reload");
assert.equal(at(reloadPress({ ...mod, key: "к" })), "reload");
assert.equal(at(reloadPress({ key: "F5", code: "F5" })), "reload");
assert.equal(at(reloadPress({ ...mod, key: "p", code: "KeyR" })), null, `${platform}: a Dvorak P reloaded`);
assert.equal(at(reloadPress({ ...mod, key: "r", code: "KeyP" })), "reload", `${platform}: a Dvorak R did not reload`);
assert.equal(at(reloadPress({ ...mod, shift: true })), "hard");
assert.equal(at(reloadPress({ ...mod, shift: true, key: "R" })), "hard");
for (const input of [
reloadPress(), reloadPress(other), reloadPress({ ...mod, alt: true }),
reloadPress({ ...mod, type: "keyUp" }), reloadPress({ ...mod, isAutoRepeat: true }),
reloadPress({ ...mod, key: "t", code: "KeyT" }), reloadPress({ key: "F5", code: "F5", control: true }),
reloadPress({ key: "F5", code: "F5", shift: true }), reloadPress({ shift: true }),
]) assert.equal(at(input), null, `${platform}: ${JSON.stringify(input)}`);
}
});
test("only the hard reload chord reloads the app window; F5 and Ctrl/Cmd+R reach the page", () => {
for (const [platform, mod] of reloadMods) {
const { state, send } = reloadRig(platform);
send(press(mod));
send(press({ ...mod, key: "R" }));
send(press({ ...mod, key: "к" }));
send(press({ key: "F5", code: "F5" }));
assert.equal(state.reloads, 4, `${platform}: the reload keys did not reload`);
send(press());
send(press(other));
send(press({ ...mod, shift: true }));
send(press({ ...mod, alt: true }));
send(press({ ...mod, type: "keyUp" }));
send(press({ ...mod, isAutoRepeat: true }));
send(press({ ...mod, key: "t", code: "KeyT" }));
send(press({ key: "F5", code: "F5", control: true }));
assert.equal(state.reloads, 4, `${platform}: something other than a fresh reload press reloaded`);
assert.equal(state.prevented, 4);
send(reloadPress(mod));
send(reloadPress({ key: "F5", code: "F5" }));
assert.equal(state.reloads, 0, `${platform}: a plain reload key reloaded the UI`);
assert.equal(state.prevented, 0, `${platform}: a plain reload key was swallowed`);
send(reloadPress({ ...mod, shift: true, key: "R" }));
assert.equal(state.reloads, 1, `${platform}: the recovery chord did not reload`);
assert.equal(state.prevented, 1);
}
});
test("a browser pane reloads on F5 and Ctrl/Cmd+R, ignoring cache on the shifted chord, and swallows nothing else", () => {
const { installPaneReload } = require("../src/reload.js");
for (const [platform, mod] of reloadMods) {
let handler;
const calls = { reload: 0, hard: 0, prevented: 0 };
const contents = {
on: (name, fn) => { if (name === "before-input-event") handler = fn; },
reload: () => { calls.reload += 1; },
reloadIgnoringCache: () => { calls.hard += 1; },
};
installPaneReload(contents, platform);
const send = (input) => handler({ preventDefault: () => { calls.prevented += 1; } }, input);
send(reloadPress(mod));
send(reloadPress({ key: "F5", code: "F5" }));
assert.deepEqual(calls, { reload: 2, hard: 0, prevented: 2 }, platform);
send(reloadPress({ ...mod, shift: true, key: "R" }));
assert.deepEqual(calls, { reload: 2, hard: 1, prevented: 3 }, platform);
send(reloadPress({ ...mod, key: "f", code: "KeyF" }));
send(reloadPress({ key: "F12", code: "F12" }));
send(reloadPress({ ...mod, alt: true }));
assert.deepEqual(calls, { reload: 2, hard: 1, prevented: 3 }, `${platform}: another key was handled`);
}
});
@@ -1104,6 +1310,7 @@ function loadShell({ lock, host }) {
if (key === "getPath") return () => userData;
if (key === "getVersion") return () => "9.9.9";
if (key === "getLocale") return () => "en-US";
if (key === "getPreferredSystemLanguages") return () => ["en-US"];
if (key === "isPackaged") return false;
if (key === "quit") return () => { calls.push(["quit"]); quit(); };
return inert;
@@ -1163,8 +1370,29 @@ test("a host that exits before its handshake is logged and shown, not swallowed"
assert.match(shell.hostLog(), /bad option/, "the host's stderr never reached host.log");
const log = shell.shellLog();
assert.match(log, /host: exited code=9 signal=null before its handshake/);
assert.match(log, /startup failed: Error: /);
assert.match(log, /startup failed: HostStartError: /);
assert.equal((log.match(/host: starting /g) || []).length, 2, "an early exit was not retried exactly once");
assert.match(log, /retrying once/);
assert.match(detail, /after 2 attempts/);
assert.match(detail, /stopped before it was ready/, "no cause was given for an early exit");
} finally {
shell.cleanup();
}
});
test("the tray has a file for every Windows scale, at exactly 16 * scale pixels", () => {
const { trayAsset, SCALES } = require("../src/trayimage.js");
const dim = (f) => {
const b = fs.readFileSync(f);
return [b.readUInt32BE(16), b.readUInt32BE(20)];
};
for (const [scale] of SCALES) {
const { file, pixels } = trayAsset(scale);
assert.deepEqual(dim(file), [pixels, pixels], file);
assert.equal(pixels, Math.round(16 * scale));
}
assert.equal(trayAsset(1.75).pixels, 28);
assert.equal(trayAsset(1.8).pixels, 32);
assert.equal(trayAsset(5).pixels, 48);
assert.equal(trayAsset(NaN).pixels, 16);
});
+3 -1
View File
@@ -41,7 +41,9 @@
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify(pair ? { code: pair } : { token: token }),
}).then(function () {});
}).then(function (response) {
if (response.ok) window.location.reload();
});
} catch (e) {
return Promise.resolve();
}
+4 -4
View File
@@ -29,9 +29,9 @@
"@codemirror/search": "^6.7.2",
"@codemirror/state": "^6.7.6",
"@codemirror/view": "^6.43.13",
"@lezer/highlight": "^1.2.4",
"@lezer/highlight": "^1.2.5",
"codemirror": "^6.0.2",
"katex": "^0.18.9",
"katex": "^0.18.10",
"react": "^19.3.0",
"react-dom": "^19.3.0",
"react-markdown": "^10.1.0",
@@ -53,7 +53,7 @@
"jsdom": "^30.1.1",
"playwright": "^1.63.0",
"typescript": "^7.0.2",
"vite": "^8.3.0",
"vitest": "^5.0.1"
"vite": "^8.3.2",
"vitest": "^5.0.3"
}
}
+4
View File
@@ -46,6 +46,7 @@ node perf/pick.mjs # 补全菜单:/ 和 @ 的选中态,深浅两色下
node perf/models.mjs # 连接面板:网关报出一百多个模型时,这一屏还能不能用
node perf/side.mjs # 右栏:端点自己写的一句话有多长,都不该改变栏宽
node perf/queue.mjs # 待送达:正文读不回来时,「改」不许开出一个空编辑器
node perf/onboarding.mjs # First-run setup: zoom-aware card bounds, resize, scrolling, focus and completion
node perf/running.mjs # 执行过程:在跑的步骤自己在动、收起后由标题接着动,步骤行没有空栏
node perf/lang.mjs # 双语验证:英文启动、界面译文到位、切回中文
node perf/locale.mjs # 跟随系统语言:中文各写法都归中文,其余归英文
@@ -53,13 +54,16 @@ node perf/i18n.mjs # 词表守卫:源码用到的中文 key 与英文词
node perf/selfcheck.mjs # 守卫的守卫:往每个断言脚本塞一条必假断言,看它是否真的会红
node perf/codes.mjs # 码的守卫:内核发的每个拒绝码,前端都要有话说
node perf/tokens.mjs # 变量的守卫:样式里不带兜底的 var(--x),都得真有人赋过值
node perf/tiers.mjs # 墨色分档的守卫:每档的正文/次要/淡/幽灵色不低于首次绘制的那一步,且都过 AA
node perf/contrast.mjs # 对比度的守卫:每一段正文对它真正落在的那块底够不够 AA
node perf/concurrent.mjs # 多会话并发的守卫:9 个会话同时流式,后台窗格不许以流式速率重绘,帧率不许掉
node perf/idle.mjs # 闲置的守卫:看不见的东西不许动,闲着的窗口不许烧 CPU
node perf/shipped.mjs # 产物的守卫:dist 里的东西必须比源码新(构建可以成功而编的是别的树)
node perf/reason.mjs # 内核拒绝的双语落地:同一个码,中英各说各的
node perf/budget.mjs # 预算的守卫:输入框上下堆满东西时,转录还剩多少
node perf/find.mjs # 对话内查找:快捷键穿过输入框、跳到没挂载的那条、同一行里的第 n 处落在眼前
node perf/focus.mjs # 专注的守卫:拿走外围之后,退出时世界是否原样
node perf/tooltip.mjs # 控件提示的守卫:文字不溢出提示框、不在半透明祖先之下、对比度达 AA(深浅×中英×宽窄)
```
`lang.mjs` 从仓库外跑时用 `PERF_SRC` 指向 `src/`(它要读固件源码来决定
+123
View File
@@ -0,0 +1,123 @@
// Many sessions streaming at once (#12232): hidden panes must not be rewritten at
// stream rate, and N=PERF_GUARD must keep FPS_RATIO_MIN of the N=1 frame rate.
// PERF_N=1,3,6,9 lists more rows; the verdict compares only N=1 with PERF_GUARD.
import { chromium } from "playwright";
const URL = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const CPU = Number(process.env.PERF_CPU ?? 4);
const SECS = Number(process.env.PERF_SECS ?? 5);
const TURNS = Number(process.env.PERF_TURNS ?? 40);
const GUARD = Number(process.env.PERF_GUARD ?? 9);
const COUNTS = (process.env.PERF_N ?? `1,${GUARD}`).split(",").map(Number);
const WRITES_MAX = Number(process.env.PERF_WRITES_MAX ?? 4);
const FPS_RATIO_MIN = Number(process.env.PERF_FPS_RATIO ?? 0.7);
const THOUGHT_CHARS = Number(process.env.PERF_THOUGHT ?? 3000);
const THOUGHT = "先看一下这个文件的结构,再决定改哪里;要注意调用方、回放路径与错误状态。".repeat(Math.ceil(THOUGHT_CHARS / 34 / 40));
const browser = await chromium.launch();
const rows = [];
const fails = [];
for (const n of COUNTS) {
const ctx = await browser.newContext({ locale: "zh-CN", viewport: { width: 1440, height: 900 } });
const page = await ctx.newPage();
const cdp = await ctx.newCDPSession(page);
if (CPU > 1) await cdp.send("Emulation.setCPUThrottlingRate", { rate: CPU });
await cdp.send("Performance.enable");
await page.goto(`${URL}?panes=${n}`, { waitUntil: "networkidle" });
await page.waitForSelector(".app", { timeout: 15000 });
await page.waitForTimeout(700);
await page.evaluate(async (k) => {
const yieldFrame = () => new Promise((r) => requestAnimationFrame(r));
for (let i = 0; i < k; i++) {
window.__feed({ kind: "turn_started" });
window.__feed({ kind: "reasoning", text: "先看文件再决定改哪里。" });
window.__feed({ kind: "text", text: `第 ${i} 段回答。\n\n- 要点一\n- 要点二\n\n` });
window.__feed({ kind: "message" });
window.__feed({ kind: "turn_done" });
if (i % 10 === 9) await yieldFrame();
}
await yieldFrame();
}, TURNS);
await page.waitForTimeout(500);
await page.evaluate((t) => {
window.__feed({ kind: "turn_started" });
for (let i = 0; i < 40; i++) window.__feed({ kind: "reasoning", text: t });
}, THOUGHT);
await page.waitForTimeout(500);
const read = async () => Object.fromEntries((await cdp.send("Performance.getMetrics")).metrics.map((m) => [m.name, m.value]));
async function phase(kind) {
const before = await read();
const r = await page.evaluate(
([k, secs]) =>
new Promise((resolve) => {
let frames = 0;
let worst = 0;
const t0 = performance.now();
let last = t0;
const tick = () => {
frames++;
const now = performance.now();
worst = Math.max(worst, now - last);
last = now;
if (now - t0 < secs * 1000) requestAnimationFrame(tick);
};
requestAnimationFrame(tick);
let writes = 0;
const mo = new MutationObserver((ms) => {
for (const m of ms) {
const at = m.target instanceof Element ? m.target : m.target.parentElement;
if (at?.closest(".pane[data-off] .out")) writes++;
}
});
mo.observe(document.body, { subtree: true, characterData: true, childList: true });
const feed = setInterval(() => window.__feed({ kind: k, text: "继续往下想一小段文字," }), 33);
setTimeout(() => {
clearInterval(feed);
mo.disconnect();
resolve({ wall: performance.now() - t0, frames, worst, writes });
}, secs * 1000);
}),
[kind, SECS],
);
const after = await read();
const d = (key) => (after[key] ?? 0) - (before[key] ?? 0);
return {
N: n,
阶段: kind === "reasoning" ? "thinking" : "answering",
"主线程%": ((d("TaskDuration") * 1000 * 100) / r.wall).toFixed(0),
"脚本%": ((d("ScriptDuration") * 1000 * 100) / r.wall).toFixed(0),
"样式重算/s": (d("RecalcStyleCount") / (r.wall / 1000)).toFixed(0),
"布局/s": (d("LayoutCount") / (r.wall / 1000)).toFixed(0),
fps: ((r.frames / r.wall) * 1000).toFixed(1),
"最长帧/ms": r.worst.toFixed(0),
"后台写/s/窗格": n > 1 ? (r.writes / (r.wall / 1000) / (n - 1)).toFixed(1) : "-",
节点: after.Nodes,
};
}
const a = await phase("reasoning");
await page.evaluate(() => window.__feed({ kind: "text", text: "开始回答。" }));
const b = await phase("text");
rows.push(a, b);
await ctx.close();
}
await browser.close();
console.log(`降频 ${CPU}x,每个窗格 ${TURNS} 轮历史,每阶段 ${SECS}s\n`);
console.table(rows);
for (const phase of ["thinking", "answering"]) {
const one = rows.find((r) => r.N === 1 && r.阶段 === phase);
const many = rows.find((r) => r.N === GUARD && r.阶段 === phase);
if (!one || !many) {
fails.push(`${phase} 缺 N=1 或 N=${GUARD} 的读数`);
continue;
}
const writes = Number(many["后台写/s/窗格"]);
const ratio = Number(many.fps) / Number(one.fps);
console.log(`${phase}: 后台窗格每秒写 ${writes} 次(≤ ${WRITES_MAX}),N=${GUARD} 帧率 / N=1 帧率 = ${ratio.toFixed(2)}(≥ ${FPS_RATIO_MIN})`);
if (writes > WRITES_MAX) fails.push(`${phase} 后台窗格每秒写 ${writes} 次 > ${WRITES_MAX}`);
if (ratio < FPS_RATIO_MIN) fails.push(`${phase} 帧率比 ${ratio.toFixed(2)} < ${FPS_RATIO_MIN}`);
}
console.log(fails.length ? `\n失败 ${fails.length} 项:\n- ${fails.join("\n- ")}` : "\n全部通过");
process.exit(fails.length ? 1 : 0);
+19 -5
View File
@@ -4,6 +4,7 @@ import { track as trackWidth } from "../src/ui/viewport";
import "../src/styles/tokens.css";
import "../src/styles/app.css";
import "../src/styles/studio.css";
import "../src/styles/feedback.css";
import { App } from "../src/ui/App";
import { MockHub } from "../src/port/mock_hub";
import { MockPort } from "../src/port/mock";
@@ -44,11 +45,12 @@ class BenchPort extends MockPort {
}
async providerSetup() {
return null;
return ONBOARDING ? { required: true, provider: "", model: "" } : null;
}
async appearance() {
const look = await super.appearance();
let look = await super.appearance();
if (query.has("zoom")) look = { ...look, zoom: Number(query.get("zoom")) };
return PREF === null ? look : { ...look, language: PREF };
}
@@ -148,6 +150,7 @@ const WORKSPACES = Number(query.get("ws") ?? 0);
// ?pref= 是「内核记着的语言」。真机上它来自 config;这里由地址给,好让
// 一次验证能把两侧摆成同一个值——否则 adopt 会认为本地缓存过期。
const PREF = query.get("pref");
const ONBOARDING = query.has("onboarding");
const SESSIONS = Number(query.get("sess") ?? 0);
// ?turns= is how long the conversation being opened already is.
const TURNS = Number(query.get("turns") ?? 0);
@@ -158,8 +161,9 @@ 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.
const TREE_AT = performance.now() + Number(query.get("treems") ?? 0);
// ?panes=0 opens the window with no conversation open.
const NO_PANES = query.get("panes") === "0";
// ?panes=0 opens the window with no conversation open; ?panes=N opens N.
const PANES = query.has("panes") ? Number(query.get("panes")) : 1;
const NO_PANES = PANES === 0;
class BenchHub extends MockHub {
readonly feeds = new Map<string, BenchPort>();
@@ -171,7 +175,17 @@ class BenchHub extends MockHub {
}
runtimes(): Promise<RuntimeView[]> {
return NO_PANES ? Promise.resolve([]) : super.runtimes();
if (NO_PANES) return Promise.resolve([]);
if (PANES <= 1) return super.runtimes();
return Promise.resolve(
Array.from({ length: PANES }, (_, i) => ({
id: `r${i + 1}`,
base: i === 0 ? "" : `/rt/r${i + 1}`,
root: "~/projects/DeepSeek-Reasonix",
name: "DeepSeek-Reasonix",
sessionPath: `/sessions/pane-${i + 1}.jsonl`,
})),
);
}
tree(): Promise<TreeWorkspace[]> {
+108
View File
@@ -0,0 +1,108 @@
// The first-run "start" button must be reachable at every window height.
// The body clips, so a card taller than the window is only reachable if the
// stage itself scrolls. Focus is no evidence: the browser scrolls the clipped
// body to a focused element, so the wheel is what gets asserted.
import { chromium } from "playwright";
import { mkdirSync } from "node:fs";
import { join } from "node:path";
const PAGE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?onboarding=1";
const SHOTS = process.env.ONBOARDING_SHOTS;
const SIZES = [
[1920, 700], [1600, 600], [2560, 560], [1366, 600], [1280, 540], [1440, 900], [1600, 760, 1.25],
[760, 480], [761, 480], [760, 480, 0.8], [761, 480, 1.8], [800, 480, 1.8], [840, 560, 1.8],
[840, 560, 1.5], [1280, 720, 1.8], [1600, 900, 1.8, [840, 560]], [840, 560, 1.8, [1600, 900]],
];
if (SHOTS) mkdirSync(SHOTS, { recursive: true });
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, zoom = 1, resize] of SIZES) {
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));
const url = new URL(PAGE);
url.searchParams.set("zoom", String(zoom));
await page.goto(url.href, { waitUntil: "domcontentloaded" });
await page.waitForSelector(".onb-card");
await page.waitForFunction((z) => Number(getComputedStyle(document.documentElement).zoom) === z, zoom);
const tag = `${scheme} ${width}x${height}${zoom !== 1 ? ` zoom${zoom}` : ""}${resize ? ` to ${resize.join("x")}` : ""}`;
const fitsCard = async (label) => {
const layout = await page.evaluate(() => {
const stage = document.querySelector(".onb-stage");
const shell = document.querySelector(".onb-shell");
const r = shell.getBoundingClientRect();
const fields = ["#onb-url", "#onb-key", ".onb-go", ".onb-note", ".onb-protocols", ".onb-pick"];
const clipped = fields.flatMap((selector) => {
const el = document.querySelector(selector);
if (!el) return [];
const box = el.getBoundingClientRect();
return box.left < Math.max(0, r.left) - 0.5 || box.right > Math.min(innerWidth, r.right) + 0.5
? [{ selector, left: box.left, right: box.right, shellRight: r.right }] : [];
});
return { clipped, columns: getComputedStyle(shell).gridTemplateColumns.split(" ").length,
expectedColumns: stage.clientWidth <= 760 ? 1 : 2, width: stage.scrollWidth, client: stage.clientWidth };
});
check(`${tag} ${label}: form stays within the card and viewport`, layout.clipped.length === 0, JSON.stringify(layout.clipped));
check(`${tag} ${label}: columns follow zoom-adjusted room`, layout.columns === layout.expectedColumns, JSON.stringify(layout));
check(`${tag} ${label}: stage does not scroll sideways`, layout.width <= layout.client + 1);
};
const reachable = async (label, enabled) => {
const viewport = page.viewportSize();
const go = page.locator(".onb-go");
await page.evaluate(() => document.activeElement?.blur());
await page.mouse.move(viewport.width / 2, viewport.height / 2);
await page.mouse.wheel(0, 4000);
await page.waitForTimeout(250);
const box = await go.boundingBox();
check(`${tag} ${label}: after wheeling to the bottom the button is in the viewport`, !!box && box.y >= 0 && box.y + box.height <= viewport.height + 0.5, JSON.stringify(box));
const bar = await page.locator(".onb-brandbar").boundingBox();
check(`${tag} ${label}: the title bar stays in the viewport`, !!bar && bar.y >= -0.5 && bar.y + bar.height <= viewport.height + 0.5, JSON.stringify(bar));
if (!enabled) return;
const hit = await page.evaluate(() => {
const r = document.querySelector(".onb-go").getBoundingClientRect();
const el = document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2);
return !!el?.closest(".onb-go");
});
check(`${tag} ${label}: the point under its centre hits it`, hit);
if (SHOTS) await page.screenshot({ path: join(SHOTS, `${tag.replaceAll(" ", "-")}-${label.replaceAll(" ", "-")}.png`) });
const first = page.locator(".onb-chip").first();
await page.evaluate(() => document.activeElement?.blur());
await first.focus();
await page.waitForTimeout(250);
const [fb, bb] = [await first.boundingBox(), await page.locator(".onb-brandbar").boundingBox()];
check(`${tag} ${label}: a focused top-of-card element sits below the title bar`, !!fb && !!bb && fb.y >= bb.y + bb.height - 0.5, JSON.stringify({ fb, bb }));
};
await fitsCard("before connect");
await reachable("before connect", false);
await page.fill('input[placeholder="sk-…"]', "sk-test");
await page.locator(".onb-go").click();
await page.waitForSelector(".onb-found");
await fitsCard("after connect");
await reachable("after connect", true);
if (resize) {
await page.setViewportSize({ width: resize[0], height: resize[1] });
await page.waitForFunction(() => {
const stage = document.querySelector(".onb-stage");
return Math.abs(stage.getBoundingClientRect().width - innerWidth) < 1;
});
await fitsCard("after resize");
await reachable("after resize", true);
}
await page.locator(".onb-go").click();
await page.waitForSelector(".app .chrome");
check(`${tag}: Start finishes setup`, await page.locator(".onb-stage").count() === 0);
await ctx.close();
}
}
await browser.close();
console.log(fails.length ? `\n${fails.length} failed` : "\nall passed");
process.exit(fails.length ? 1 : 0);
+109
View File
@@ -0,0 +1,109 @@
// Ink contrast per tier and scheme. Each tier's inks must be at least as legible
// as the default palette stepped once, and as the recorded floors below (ratios
// on --page; --ghost shares --faint's), and every ink must clear AA on both grounds.
import { chromium } from "playwright";
const PAGE = process.env.PERF_URL ?? "http://localhost:4399/perf.html?pref=zh&ws=2&sess=6&turns=1";
const STEPS = { "--text": [3.0, 10.1], "--muted": [3.5, 7.5], "--faint": [3.5, 7.0], "--ghost": [3.5, 7.0] };
const INKS = Object.keys(STEPS);
const GROUNDS = ["--page", "--surface"];
const TIERS = ["soft", "normal", "strong"];
const FLOOR = {
"light/soft": { "--text": 11.69, "--muted": 7.63, "--faint": 5.76 },
"light/normal": { "--text": 14.07, "--muted": 10.22, "--faint": 7.86 },
"light/strong": { "--text": 17.86, "--muted": 13.55, "--faint": 10.42 },
"dark/soft": { "--text": 11.48, "--muted": 7.48, "--faint": 5.63 },
"dark/normal": { "--text": 13.92, "--muted": 9.79, "--faint": 7.57 },
"dark/strong": { "--text": 18.01, "--muted": 13.16, "--faint": 9.92 },
};
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();
const page = await browser.newPage({ viewport: { width: 1200, height: 800 }, locale: "zh-CN" });
page.on("pageerror", (e) => fails.push("page error: " + e.message));
await page.goto(PAGE, { waitUntil: "networkidle" });
await page.waitForSelector(".compose");
const measured = await page.evaluate(({ STEPS, INKS, GROUNDS, TIERS }) => {
const root = document.documentElement;
const probe = document.createElement("div");
document.body.append(probe);
const ctx = document.createElement("canvas").getContext("2d", { willReadFrequently: true });
const rgb = (css) => {
ctx.clearRect(0, 0, 1, 1);
ctx.fillStyle = "#000";
ctx.fillStyle = css;
ctx.fillRect(0, 0, 1, 1);
return [...ctx.getImageData(0, 0, 1, 1).data].slice(0, 3);
};
const lum = (c) => {
const [r, g, b] = c.map((v) => {
const s = v / 255;
return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
});
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
};
const ratio = (a, b) => {
const [hi, lo] = [lum(a), lum(b)].sort((x, y) => y - x);
return (hi + 0.05) / (lo + 0.05);
};
const read = (name) => {
probe.style.color = `var(${name})`;
return getComputedStyle(probe).color;
};
const out = {};
for (const scheme of ["light", "dark"]) {
root.dataset.theme = scheme;
delete root.dataset.contrast;
const base = Object.fromEntries(INKS.map((n) => [n, read(n === "--ghost" ? "--faint" : n)]));
const grounds = Object.fromEntries(GROUNDS.map((g) => [g, rgb(read(g))]));
for (const tier of TIERS) {
const k = TIERS.indexOf(tier);
root.dataset.contrast = tier;
for (const ink of INKS) {
const by = k === 0 ? 0 : STEPS[ink][k - 1];
probe.style.color = by ? `oklch(from ${base[ink]} calc(l ${scheme === "light" ? "-" : "+"} ${(by / 100).toFixed(3)}) c h)` : base[ink];
const ref = rgb(getComputedStyle(probe).color);
const got = rgb(read(ink));
for (const g of GROUNDS) out[`${scheme}/${tier}/${ink}/${g}`] = { ref: ratio(ref, grounds[g]), got: ratio(got, grounds[g]) };
}
}
}
probe.remove();
return out;
}, { STEPS, INKS, GROUNDS, TIERS });
for (const [key, { ref, got }] of Object.entries(measured)) {
const [scheme, tier, ink, ground] = key.split("/");
const floor = ground === "--page" ? (FLOOR[`${scheme}/${tier}`][ink === "--ghost" ? "--faint" : ink] ?? 0) : 0;
check(`${key} not below the stepped palette or its floor`, got >= Math.max(ref, floor) - 0.005, `${got.toFixed(2)} vs ${Math.max(ref, floor).toFixed(2)}`);
check(`${key} clears AA`, got >= 4.5, got.toFixed(2));
}
for (const scheme of ["light", "dark"]) {
await page.emulateMedia({ colorScheme: scheme, contrast: "more" });
const same = await page.evaluate((scheme) => {
const root = document.documentElement;
root.dataset.theme = scheme;
delete root.dataset.contrast;
const p = document.createElement("div");
document.body.append(p);
const c = (n) => ((p.style.color = `var(${n})`), getComputedStyle(p).color);
const r = [c("--faint"), c("--ghost")];
p.remove();
return r;
}, scheme);
check(`${scheme} under prefers-contrast: more keeps ghost on faint`, same[0] === same[1], same.join(" / "));
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} failed`);
process.exit(1);
}
console.log("\nevery tier holds");
+99
View File
@@ -0,0 +1,99 @@
// Composer control tooltips: the box must hold its own text, must not sit under a
// dimmed ancestor, and must stay readable. All three are layout/paint questions jsdom cannot answer.
import { chromium } from "playwright";
const BASE = process.env.PERF_URL ?? "http://localhost:4399/perf.html";
const BOX = 'textarea[role="combobox"]';
const fails = [];
const check = (name, ok, detail = "") => {
console.log(`${ok ? " ok" : "FAIL"} ${name}${detail ? " — " + detail : ""}`);
if (!ok) fails.push(name);
};
// Controls are found by structure, never by label: the label is translated,
// so a lookup by its wording matches one language and skips the other.
const CONTROLS = { "prompt.refine": '[data-action="prompt.refine"]', attach: "button.attach" };
const measure = (page, selector) =>
page.evaluate((selector) => {
const button = document.querySelector(`.compose ${selector}`);
const tip = button?.querySelector(".studio-control-tip");
if (!button || !tip) return null;
let opacity = 1;
for (let el = tip; el; el = el.parentElement) opacity *= parseFloat(getComputedStyle(el).opacity);
const ink = document.createElement("canvas").getContext("2d", { willReadFrequently: true });
const rgba = (css) => {
ink.clearRect(0, 0, 1, 1);
ink.fillStyle = "#000";
ink.fillStyle = css;
ink.fillRect(0, 0, 1, 1);
const [r, g, b, a] = ink.getImageData(0, 0, 1, 1).data;
return [r, g, b, a / 255];
};
const lum = ([r, g, b]) => {
const f = (c) => ((c /= 255) <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);
return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);
};
const over = (top, bottom) => {
const a = top[3];
return [0, 1, 2].map((i) => top[i] * a + bottom[i] * (1 - a)).concat(1);
};
const bg = rgba(getComputedStyle(tip).backgroundColor);
const ratios = [...tip.children].map((child) => {
const fg = over(rgba(getComputedStyle(child).color), bg);
const [hi, lo] = [lum(fg), lum(bg)].sort((x, y) => y - x);
return (hi + 0.05) / (lo + 0.05);
});
const box = tip.getBoundingClientRect();
const spill = [...tip.children].map((child) => {
const range = document.createRange();
range.selectNodeContents(child);
return Math.max(0, range.getBoundingClientRect().right - box.right);
});
return {
opacity,
visibility: getComputedStyle(tip).visibility,
minRatio: Math.min(...ratios),
spill: Math.max(...spill),
scroll: tip.scrollWidth - tip.clientWidth,
left: box.left,
right: box.right,
width: box.width,
viewport: innerWidth,
disabled: button.disabled,
};
}, selector);
const browser = await chromium.launch();
for (const scheme of ["light", "dark"]) {
for (const lang of ["zh", "en"]) {
for (const width of [1440, 420]) {
const page = await browser.newPage({ viewport: { width, height: 900 }, colorScheme: scheme, reducedMotion: "reduce" });
page.setDefaultTimeout(8000);
page.on("pageerror", (e) => fails.push("页面异常: " + e.message));
await page.goto(`${BASE}?pref=${lang}&turns=2`, { waitUntil: "networkidle" });
await page.waitForSelector(".compose");
await page.evaluate(() => document.fonts.ready);
for (const [text, control] of [["", "prompt.refine"], ["1111", "prompt.refine"], ["", "attach"]]) {
await page.fill(BOX, text);
const tag = `${scheme}/${lang}/${width}px/${control}/${text ? "有字" : "空"}`;
if (!(await page.$(`.compose ${CONTROLS[control]}`))) { check(`${tag}:找得到按钮`, false); continue; }
await page.hover(`.compose ${CONTROLS[control]}`, { force: true });
await page.waitForTimeout(250);
const m = await measure(page, CONTROLS[control]);
if (!m) { check(`${tag}:找得到提示`, false); continue; }
check(`${tag}:提示不在半透明的祖先之下`, m.opacity === 1 && m.visibility === "visible", `有效不透明度 ${m.opacity.toFixed(2)}`);
check(`${tag}:文字不溢出提示框`, m.spill <= 0.5 && m.scroll <= 0, `溢出 ${m.spill.toFixed(1)}px,scroll ${m.scroll}px`);
check(`${tag}:提示框留在窗口内`, m.left >= 0 && m.right <= m.viewport, `${Math.round(m.left)}–${Math.round(m.right)} / ${m.viewport}`);
check(`${tag}:正文对比度达 AA`, m.minRatio >= 4.5, `${m.minRatio.toFixed(2)}:1`);
}
await page.close();
}
}
}
await browser.close();
if (fails.length) {
console.log(`\n${fails.length} 项不合格`);
process.exit(1);
}
+125 -138
View File
@@ -60,14 +60,14 @@ importers:
specifier: ^6.43.13
version: 6.43.13
'@lezer/highlight':
specifier: ^1.2.4
version: 1.2.4
specifier: ^1.2.5
version: 1.2.5
codemirror:
specifier: ^6.0.2
version: 6.0.2
katex:
specifier: ^0.18.9
version: 0.18.9
specifier: ^0.18.10
version: 0.18.10
react:
specifier: ^19.3.0
version: 19.3.0
@@ -116,7 +116,7 @@ importers:
version: 19.3.0(@types/[email protected])
'@vitejs/plugin-react':
specifier: ^6.1.1
version: 6.1.1([email protected].0([email protected]))
version: 6.1.1([email protected].2([email protected]))
jsdom:
specifier: ^30.1.1
version: 30.1.1
@@ -127,11 +127,11 @@ importers:
specifier: ^7.0.2
version: 7.0.2
vite:
specifier: ^8.3.0
version: 8.3.0([email protected])
specifier: ^8.3.2
version: 8.3.2([email protected])
vitest:
specifier: ^5.0.1
version: 5.0.1([email protected])([email protected].0([email protected]))
specifier: ^5.0.3
version: 5.0.3([email protected])([email protected].2([email protected]))
packages:
@@ -453,8 +453,8 @@ packages:
'@lezer/[email protected]':
resolution: {integrity: sha512-xToRsYxwsgJNHTgNdStpcvmbVuKxTapV0dM0wey1geMMRc9aggoVyKgzYp41D2/vVOx+Ii4hmE206kvxIXBVXQ==}
'@lezer/[email protected].4':
resolution: {integrity: sha512-4UeRVFO0lsBaM7GA32zOqbmqNPme9jedo8Ey+5c5656MU3MLitMLIA8aCZTYjUMEpEsuSeXEm78Uea6Iq3bvSg==}
'@lezer/[email protected].5':
resolution: {integrity: sha512-O1GMVKgtf5YspFaRzpmqkVgMtIk2HG9uMAbH6wdAIdNh3TVzCsch/+cRi+6l2//UGDKe6NB9BW3cvuR5ezMQ0w==}
'@lezer/[email protected]':
resolution: {integrity: sha512-oI7n6NJml729m7pjm9lvLvmXbdoMoi2f+1pwSDJkl9d68zGr7a9Btz8NdHTGQZtW2DA25ybeuv/SyDb9D5tseg==}
@@ -489,101 +489,101 @@ packages:
'@marijn/[email protected]':
resolution: {integrity: sha512-Wy0V7+SGUjnF9/TkiM1hKVDPj7jKXduPNboMVtHTA8dySMURWqfg/JZ9E2Sq8JgSJmkl7k7Qe9FLeMSrSraWmQ==}
'@oxc-project/[email protected]47.0':
resolution: {integrity: sha512-IJ3s6ltHLp45S0bh7phkX+gJO7A1Wuz2EaqpAhb8WjqDwbzMiWKHhyyT42tskaWjEYXtHtVCPpnBJVT9+dcRLg==}
'@oxc-project/[email protected]52.0':
resolution: {integrity: sha512-oM/5rLBm2tPkg0iBgkH/FOeR3PCDpY19GTgAZjMFM8h9WI9VW7cLgzp6nwtarYKmovavIQZ+Fe/RKX/8C8O/Rw==}
'@rolldown/[email protected].6':
resolution: {integrity: sha512-b+jTcARdTiFLI6jB4a5XjTm0RWd6KcRfQj/I2356fxUZemiho9zQLxo0RtCuMDAyKcLo6cEltkgbQp6d1+sjjQ==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-dB/a1214qKfHMXCpgqR4OZT+jS4kTyEXbQGJPqzobt5EwH5rX080pxE37alt3RzvR1bf1Yz/yGqRfrYAxuPw0A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [android]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-lkWU8ZJaRk9q3CIEY1Tc7vIFALp3Xw5NfGJo2hQg5oIqNgxWi1zI+IiDEK3r70BF5Dzol1tcXsnzsRc8NLhG+Q==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-7KHFgQ5VJxIHcLlrwrc3Xbds7oTNQT7Pgi9gQCJKrd2VGab/UksIOYp6VD8MzCstGxOKMgNamPwUCfxPdP1OHg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-dgR56NYnvAszm7Ob1B2/Vn0e8bUQYZH2UjVaMMtMVOCKFSfjhfLmuA/9+O+F+ajUdG6B/bSssrKW6JJYASa8jA==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-3YIhqHD96nA5SaYNRBR16HnGv4oavZvXfD/ayHM+oYZ0WD/8lBAtf6zQua4kEyAvpqrluKXl0lnOBoiNby7x9w==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-vpVxFvUCFioJqug7OTvqptkc4yb8UX0AwfDmJpaR/0sWz+BUmqSVAf7c8JkUgnN8YLspb4a/N6NhTyMAmdyQ7Q==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-UuuJ35MFw4gmFOrE9pEqIV+K3syIKveph+Qc1/ljHZVdoDW4pz/JHR/eMVom+TZGl/5OOvGJOWaOCVt3ZfqhxA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-h1wG6Y6K3JlRswxsI64qQJqBAy4vrLuHgRbc8CZMGSWTOFRY6ghMApM1NKzB2I0n5xV1fjkE18SuVl2QpLeNpA==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-uMvssit0a4W+/7D8CbHUvG719mH3R2jwXAlh/XcPvuHTE0g++LymF88DCGNX0HM2rBOn0xrzgXktIB6fLSJBTQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-tbCiqub0q2MVWJKgF5PoAlNWCtQydiOYSLIkd8sByqK/6MMYLJRcSXSYodqYtd0O+Fw7QaVmKKlS4oL94YRZ0w==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-XcFu0R0xWnwzSf4IQgFH1rJIckPN1pLy2R+4r9IDB7Yfu/ys9cVqfa4pBrMHj7a3gl8mIR4nRNPg0e5IvEVs6g==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-oxK9+baEBPhZG5HB4URY+uU04zJWeZlH6Tb9rB5DK4DF9XR1uXNLXt5Q5ZsugTKayNCNLhkcwz/ye74hRI98dg==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-260UrKgn8tz39ak+SMDOirKzr7V04M9dWPw5llW00SwBivCZoWcRBKV1d8cXnRkUmSZA3BdiUmBHWk7734Ulpw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-muWCk27FVBEZtv0MsK8gnfSmgczA8KQ0uRVJbTABKhkRfQc38aUrcb7fhi3BNiyseFmgcRsoMfQsSNJ+DbZdSw==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-5YK1I9SqDkbPgc1IA8BgDl34suqUS2q0KWnBrirm0E51YjOs6eo6dV6jbQfNE/argHRSvd0QUGgtpIoYx+WWpw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-eWDoSfU7Co2qj3vgB3Dt4lj1mG6CoWbcJQkRMP3XJplyCMtuaq3LHvPFjS9QIPvMGWVadJC04Xiy0IdcVPtnwQ==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-Rkcrmp7eFRg74yL5fXEU91JEWbdEPLevWwGtXpmhbjlD1StScbWTmO94Bhly+Mo+ketKYkdmM1vNUKeWSlx8cQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-2bWNjRSIayvupRKxXUY2tWG9fYdoUlTqWywHRvE8Eq3GvuQ+f2HeIkve697fIt+IQs/PV8yFsdWuhp1aJ1PdnA==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-qvK4DuAsQc2BSjlx+Xr+IzOIvvxbGZqxFwdWfG6F518Erj0GGISyQbJ6pIappnOxlNPzNHvo/L0BwB30GZ+zVw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-KekI0gS0wLxe1UBSQSjenBVwou/JkcQPDzBPICGZjxUv9k3RteHDPBQaiOicZUFKRIH2wKEimGwVpnJsbPzu7w==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-Q9uLBO53Xd4QIq1WOycVQyPP1O4HhraEV2qqb3uTrnVw6QZih9duY4vNXOivL1xoUS1/z+W8eF4NMfl2a8Sdjw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-TvtPnfVr+HtyGiDmPK4VWmlNm7QhNNAcK5Q9A7aOXsI8545yCyaoMaicXrFZ72JzeYjaUVk7yT243zT0jzjFKQ==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-3IBxWFMjbOZskDPKv8Lf9BCnahlKuHthWkYnyIxOH/QcJrFcS4EmcenthApkwr/5+nEqZlLzeYbxeMaX7A5u4g==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [musl]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-iOo0VEay2XFhaCcH0sps5XIimkSuOnNaZrf6+ZkoSOQBJPKNU48RkmJv0/lSpipexu5P+ouFgafe5IGr/DiQfg==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-xtX61xg4LKPkPWilZU1ynKClz5Gj4bf74LML4r3eVLWumKnGjoEr1OSHQhMdbBDoYTi+yjrujvpZe2pUnqCrrA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-y5NTmmasMS455JlOCO4ZM9krIchv3Mvm1crL1iUPGOPgEzSkves9n0SdC5Sjz6+qWDFhd8/JpfWMH8NSWNHe+A==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-At7fPB6PCaIjzgIhEZFxuT+BBFqiQibJDT4d3PhiR3f4E7bbMZF4aKblbFfEM3sETRDd1YiQx/+U/g/B/ou5Ew==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
'@rolldown/[email protected].6':
resolution: {integrity: sha512-np8iZSLfXlAD4kWhiyq/u0Yt8oZDtRQ8lGhQaCXo2rl37KNjeU0GjJuwr4P3oeZ++ROfofsKNBqR5LTO8aXyWQ==}
'@rolldown/[email protected].12':
resolution: {integrity: sha512-WIw2haVKwjuYdXkHaoC0mF8Le71TuCBxjrdKqLbJGctbBABj+ClfmNvtbOnzpq3RokNo5+V1qhtSzJyXorsklQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
@@ -799,8 +799,8 @@ packages:
oxc-transform-react:
optional: true
'@vitest/[email protected].1':
resolution: {integrity: sha512-6K1DoBNAPGvuOcSsGA4D6x+5zEEff/KmOOP3uetT2TrGpVfI+HRHRnJJfKi5ib/g1vx8IYHQD8s0pbJz8WQI7Q==}
'@vitest/[email protected].3':
resolution: {integrity: sha512-T8sWAIbkSyAjkwTcaEc3Iu0o9A27X1/kdXrizhZkGuSKScRQtRzclfAMpOTcGdXCsqxeWlpGy3XjqaW8CpLORg==}
peerDependencies:
msw: ^2.4.9
vite: ^6.0.0 || ^7.0.0 || ^8.0.0
@@ -810,8 +810,8 @@ packages:
vite:
optional: true
'@vitest/[email protected].1':
resolution: {integrity: sha512-rbto/mF/SGERxEgYOek7Xm6B9b+y+mVoo+f4b2LymYO8zM1b7uB5nHuhVMTP2hxdzgxvGiZYGxGIaMvL5y180Q==}
'@vitest/[email protected].3':
resolution: {integrity: sha512-XhFysQTB8AZ+P4gMi+Lpo99vg2AZi0qKpaB9yXQl37+CaMEAPO3iH/wGVnSyL5MPERiLezpqTVtrR6UZH5GCXg==}
[email protected]:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
@@ -1051,8 +1051,8 @@ packages:
resolution: {integrity: sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==}
hasBin: true
[email protected].9:
resolution: {integrity: sha512-8ad9RyoKsb/g8/yLFE+KAlP+DhbCTRUNi/V9XGsxn0R+trJJltNwzcDNo0q/DEkOy5fQUQTAQyCXCYSE+OakTQ==}
[email protected].10:
resolution: {integrity: sha512-/B6p9eY9DX7aHBfpkHdpirDTZ5QH9xTwL9y837PWuzuv41O5jFdqNQwVQEQsimY0/iVNkwBY4+4hMfhQ7d4Dbw==}
hasBin: true
[email protected]:
@@ -1396,8 +1396,8 @@ packages:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
[email protected].6:
resolution: {integrity: sha512-vMM4q3aixf46GiF1Kok8jDPFsEpXgFWGjUHXNkNHNm+Y2adXAG2dbX91jkti3i0ZRsOlcmbuzAz1poObSHCmUA==}
[email protected].12:
resolution: {integrity: sha512-8wafseiaG80xmXSfqidUNqZcylTlhmPZZt+za2m+js2sFZ8dTNlhIOV2WcbIPx2hgwPBJpEUGFAMZ9bgBBLTSQ==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
@@ -1408,9 +1408,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==}
[email protected]:
resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}
[email protected]:
resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}
engines: {node: '>=0.10.0'}
@@ -1418,9 +1415,6 @@ packages:
[email protected]:
resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==}
[email protected]:
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
[email protected]:
resolution: {integrity: sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==}
@@ -1511,8 +1505,8 @@ packages:
[email protected]:
resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==}
[email protected].0:
resolution: {integrity: sha512-lhZBVvEHefgE+HQZC9O7EBJgCU/nVzFNl7vkS4RE0APtWLP02/8QVIkQtzBxPquh7lq5/78NHipTj7ODQ6XuyQ==}
[email protected].2:
resolution: {integrity: sha512-SQr1x6W5vVSbROg7vsyXIaxK9b0G7zsT68acdWWRmnBUsgDieLCRG+Rep9WdZgcposvv/GSnr4GUUBqB3vXq6w==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
@@ -1554,20 +1548,20 @@ packages:
yaml:
optional: true
[email protected].1:
resolution: {integrity: sha512-iA95lQbKEkvrtTkdAgnWbXfbipWiiWe/hDl2P5tMi6WFwD76G0NxXAGp/M9EOcYupeGJRr6wppMc7CoA41TQjg==}
[email protected].3:
resolution: {integrity: sha512-xMw97S3rjdtj5dkVat7jCsqWBpvchs3RlpQctUqwJD0KkERk40vz2fJ77lDwW/Vzh/pk18eItYAzkodhSes3jQ==}
engines: {node: ^22.12.0 || ^24.0.0 || >=26.0.0}
hasBin: true
peerDependencies:
'@edge-runtime/vm': '*'
'@opentelemetry/api': ^1.9.0
'@types/node': ^22.0.0 || >=24.0.0
'@vitest/browser-playwright': 5.0.1
'@vitest/browser-preview': 5.0.1
'@vitest/browser-playwright': 5.0.3
'@vitest/browser-preview': 5.0.3
'@vitest/browser-webdriverio': ^5.0.0-beta.5 || >=5.0.0
'@vitest/coverage-istanbul': 5.0.1
'@vitest/coverage-v8': 5.0.1
'@vitest/ui': 5.0.1
'@vitest/coverage-istanbul': 5.0.3
'@vitest/coverage-v8': 5.0.3
'@vitest/ui': 5.0.3
happy-dom: '*'
jsdom: '*'
vite: ^6.4.0 || ^7.0.0 || ^8.0.0
@@ -1621,9 +1615,9 @@ packages:
resolution: {integrity: sha512-TEZA+Zqxin7Jjsm2cjRohCmen5awh+hT6Zi3VZdqZlNRk7zvOI/9WpBFg/DWlA56bWnzwm6DuB8NS0EsxQH9uQ==}
engines: {node: ^22.14.0 || >=24.0.0}
why-is-node-running@2.3.0:
resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==}
engines: {node: '>=8'}
why-is-node-running@3.2.1:
resolution: {integrity: sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==}
engines: {node: '>=20.11'}
hasBin: true
[email protected]:
@@ -1771,7 +1765,7 @@ snapshots:
'@codemirror/language': 6.12.4
'@codemirror/state': 6.7.6
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@codemirror/[email protected]':
@@ -1789,7 +1783,7 @@ snapshots:
'@codemirror/language': 6.12.4
'@codemirror/state': 6.7.6
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/yaml': 1.0.4
@@ -1798,7 +1792,7 @@ snapshots:
'@codemirror/state': 6.7.6
'@codemirror/view': 6.43.13
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
style-mod: 4.1.4
@@ -1943,41 +1937,41 @@ snapshots:
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected].4':
'@lezer/[email protected].5':
dependencies:
'@lezer/common': 1.5.2
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
@@ -1987,79 +1981,79 @@ snapshots:
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@lezer/[email protected]':
dependencies:
'@lezer/common': 1.5.2
'@lezer/highlight': 1.2.4
'@lezer/highlight': 1.2.5
'@lezer/lr': 1.4.10
'@marijn/[email protected]': {}
'@oxc-project/[email protected]47.0': {}
'@oxc-project/[email protected]52.0': {}
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected].6':
'@rolldown/[email protected].12':
optional: true
'@rolldown/[email protected]': {}
@@ -2194,21 +2188,21 @@ snapshots:
'@ungap/[email protected]': {}
'@vitejs/[email protected]([email protected].0([email protected]))':
'@vitejs/[email protected]([email protected].2([email protected]))':
dependencies:
'@rolldown/pluginutils': 1.0.1
vite: 8.3.0([email protected])
vite: 8.3.2([email protected])
'@vitest/[email protected].1([email protected].0([email protected]))':
'@vitest/[email protected].3([email protected].2([email protected]))':
dependencies:
'@jridgewell/trace-mapping': 0.3.31
'@vitest/spy': 5.0.1
'@vitest/spy': 5.0.3
estree-walker: 3.0.3
magic-string: 1.4.2
optionalDependencies:
vite: 8.3.0([email protected])
vite: 8.3.2([email protected])
'@vitest/[email protected].1': {}
'@vitest/[email protected].3': {}
[email protected]: {}
@@ -2519,7 +2513,7 @@ snapshots:
dependencies:
commander: 8.3.0
[email protected].9:
[email protected].10:
dependencies:
commander: 15.0.0
@@ -3117,26 +3111,26 @@ snapshots:
[email protected]: {}
[email protected].6:
[email protected].12:
dependencies:
'@oxc-project/types': 0.147.0
'@oxc-project/types': 0.152.0
'@rolldown/pluginutils': 1.0.1
optionalDependencies:
'@rolldown/binding-android-arm-eabi': 1.2.6
'@rolldown/binding-android-arm64': 1.2.6
'@rolldown/binding-darwin-arm64': 1.2.6
'@rolldown/binding-darwin-x64': 1.2.6
'@rolldown/binding-freebsd-x64': 1.2.6
'@rolldown/binding-linux-arm-gnueabihf': 1.2.6
'@rolldown/binding-linux-arm64-gnu': 1.2.6
'@rolldown/binding-linux-arm64-musl': 1.2.6
'@rolldown/binding-linux-ppc64-gnu': 1.2.6
'@rolldown/binding-linux-s390x-gnu': 1.2.6
'@rolldown/binding-linux-x64-gnu': 1.2.6
'@rolldown/binding-linux-x64-musl': 1.2.6
'@rolldown/binding-openharmony-arm64': 1.2.6
'@rolldown/binding-win32-arm64-msvc': 1.2.6
'@rolldown/binding-win32-x64-msvc': 1.2.6
'@rolldown/binding-android-arm-eabi': 1.2.12
'@rolldown/binding-android-arm64': 1.2.12
'@rolldown/binding-darwin-arm64': 1.2.12
'@rolldown/binding-darwin-x64': 1.2.12
'@rolldown/binding-freebsd-x64': 1.2.12
'@rolldown/binding-linux-arm-gnueabihf': 1.2.12
'@rolldown/binding-linux-arm64-gnu': 1.2.12
'@rolldown/binding-linux-arm64-musl': 1.2.12
'@rolldown/binding-linux-ppc64-gnu': 1.2.12
'@rolldown/binding-linux-s390x-gnu': 1.2.12
'@rolldown/binding-linux-x64-gnu': 1.2.12
'@rolldown/binding-linux-x64-musl': 1.2.12
'@rolldown/binding-openharmony-arm64': 1.2.12
'@rolldown/binding-win32-arm64-msvc': 1.2.12
'@rolldown/binding-win32-x64-msvc': 1.2.12
[email protected]:
dependencies:
@@ -3144,14 +3138,10 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]: {}
[email protected]:
@@ -3279,21 +3269,21 @@ snapshots:
'@types/unist': 3.0.3
vfile-message: 4.0.3
[email protected].0([email protected]):
[email protected].2([email protected]):
dependencies:
lightningcss: 1.33.0
picomatch: 4.0.7
postcss: 8.5.28
rolldown: 1.2.6
rolldown: 1.2.12
tinyglobby: 0.2.17
optionalDependencies:
esbuild: 0.28.2
fsevents: 2.3.3
[email protected].1([email protected])([email protected].0([email protected])):
[email protected].3([email protected])([email protected].2([email protected])):
dependencies:
'@types/chai': 5.2.3
'@vitest/mocker': 5.0.1([email protected].0([email protected]))
'@vitest/mocker': 5.0.3([email protected].2([email protected]))
chai: 6.2.2
es-module-lexer: 2.3.2
expect-type: 1.4.0
@@ -3304,8 +3294,8 @@ snapshots:
tinybench: 6.1.4
tinyexec: 1.3.0
tinyglobby: 0.2.17
vite: 8.3.0([email protected])
why-is-node-running: 2.3.0
vite: 8.3.2([email protected])
why-is-node-running: 3.2.1
optionalDependencies:
jsdom: 30.1.1
transitivePeerDependencies:
@@ -3339,10 +3329,7 @@ snapshots:
transitivePeerDependencies:
- '@noble/hashes'
why-is-node-running@2.3.0:
dependencies:
siginfo: 2.0.0
stackback: 0.0.2
why-is-node-running@3.2.1: {}
[email protected]: {}
+72
View File
@@ -52,6 +52,8 @@ export const ACTIONS: UIAction[] = [
// Completion verification is adaptive now, rather than a user-facing preset.
// The legacy endpoint remains in the port for older clients and sessions,
// but it is intentionally not advertised as an interface action.
{ id: "chart.scroll", kind: "view", target: "none", proof: "interaction" },
{ id: "chart.data", kind: "view", target: "none", proof: "interaction" },
{ id: "chrome.policy", kind: "view", target: "none", proof: "interaction" },
{ id: "chrome.rail", kind: "view", target: "none", proof: "browser" },
{ id: "appearance.theme", kind: "view", target: "none", proof: "interaction" },
@@ -81,6 +83,7 @@ export const ACTIONS: UIAction[] = [
// refused while a turn runs, so it never stops work.
{ id: "session.close", kind: "kernel-mutation", target: "entity", proof: "interaction" },
{ id: "session.archive", kind: "kernel-mutation", target: "entity", proof: "authority-effect" },
{ id: "session.copy-info", kind: "shell-native", target: "entity", proof: "interaction" },
{ id: "session.export", kind: "shell-native", target: "entity", proof: "browser" },
{ id: "session.delete", kind: "destructive", target: "entity", proof: "authority-effect" },
@@ -95,6 +98,10 @@ export const ACTIONS: UIAction[] = [
{ id: "tool.image-open", kind: "view", target: "none", proof: "interaction" },
{ id: "tool.image-close", kind: "view", target: "none", proof: "interaction" },
{ id: "tool.show-all", kind: "view", target: "none", proof: "interaction" },
{ id: "agent.open", kind: "view", target: "entity", proof: "interaction" },
{ id: "agent.focus-trap", kind: "navigation", target: "none", proof: "interaction" },
{ id: "agent.close", kind: "view", target: "none", proof: "interaction" },
// ── The turn ─────────────────────────────────────────────────────────────
// Send and stop remain two actions even when they sit together: during a
@@ -109,6 +116,15 @@ export const ACTIONS: UIAction[] = [
{ id: "prompt.adopt", kind: "view", target: "none", proof: "interaction" },
{ id: "prompt.discard", kind: "view", target: "none", proof: "interaction" },
// ── Committing what is staged ────────────────────────────────────────────
// Drafting reads the index and asks the model; only confirm records a commit,
// and only locally.
{ id: "commit.draft", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "commit.edit", kind: "view", target: "none", proof: "interaction" },
{ id: "commit.acknowledge", kind: "view", target: "none", proof: "interaction" },
{ id: "commit.confirm", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "commit.close", kind: "view", target: "none", proof: "interaction" },
// ── What is waiting to be sent ───────────────────────────────────────────
{ id: "queue.edit", kind: "kernel-mutation", target: "entity", proof: "interaction" },
// Giving a session a name of your own. The sidebar's tree and the pane tabs
@@ -151,6 +167,37 @@ export const ACTIONS: UIAction[] = [
{ id: "account.reload", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "account.sign-in", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "account.sign-out", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "community.join", kind: "shell-native", target: "none", proof: "interaction" },
{ id: "community.discord", kind: "shell-native", target: "none", proof: "interaction" },
{ id: "community.issues", kind: "shell-native", target: "none", proof: "interaction" },
{ id: "community.contributors", kind: "shell-native", target: "none", proof: "interaction" },
{ id: "community.profile", kind: "shell-native", target: "entity", proof: "interaction" },
{ id: "community.douyin-qr", kind: "view", target: "none", proof: "interaction" },
{ id: "community.author", kind: "shell-native", target: "none", proof: "interaction" },
{ id: "community.more", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.open", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.tab", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.category", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.body", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.name", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.contact", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.shot.pick", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.shot.add", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.shot.remove", kind: "view", target: "entity", proof: "interaction" },
{ id: "feedback.send", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "feedback.another", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.thread.more", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.reply.open", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.reply.body", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.reply.send", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "feedback.reply.cancel", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.mine", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.refresh", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "feedback.retry-env", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "feedback.retry-mine", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "feedback.link", kind: "shell-native", target: "none", proof: "interaction" },
{ id: "feedback.focus", kind: "view", target: "none", proof: "interaction" },
{ id: "feedback.close", kind: "view", target: "none", proof: "interaction" },
{ id: "backup.category", kind: "view", target: "entity", proof: "interaction" },
{ id: "backup.label", kind: "view", target: "none", proof: "interaction" },
{ id: "backup.passphrase", kind: "view", target: "optional", proof: "interaction" },
@@ -177,6 +224,7 @@ export const ACTIONS: UIAction[] = [
{ id: "memory.forget", kind: "destructive", target: "entity", proof: "interaction" },
{ id: "config.repair", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "extensions.reload", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "extensions.refresh", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "extensions.inspect", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "extensions.install", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "extensions.update", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
@@ -196,6 +244,8 @@ export const ACTIONS: UIAction[] = [
{ id: "market.sort", kind: "view", target: "none", proof: "interaction" },
{ id: "market.pinned", kind: "view", target: "none", proof: "interaction" },
{ id: "market.show-all", kind: "view", target: "none", proof: "interaction" },
{ id: "market.retry", kind: "view", target: "none", proof: "interaction" },
{ id: "market.detail-retry", kind: "view", target: "none", proof: "interaction" },
{ id: "market.more", kind: "view", target: "none", proof: "interaction" },
{ id: "market.open", kind: "navigation", target: "none", proof: "interaction" },
{ id: "market.back", kind: "navigation", target: "none", proof: "interaction" },
@@ -211,12 +261,16 @@ export const ACTIONS: UIAction[] = [
{ id: "market.signin", kind: "navigation", target: "none", proof: "interaction" },
{ id: "market.draft", kind: "view", target: "none", proof: "interaction" },
{ id: "market.publish", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "market.prepare-version", kind: "view", target: "none", proof: "interaction" },
{ id: "market.publish-again", kind: "view", target: "none", proof: "interaction" },
// The account's own packages: a preview, an install pinned to that preview's
// digest, and sending a private one to review.
{ id: "market.own-inspect", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "market.own-retry", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "market.mine-retry", kind: "view", target: "none", proof: "interaction" },
{ id: "market.submit", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "market.vote", kind: "kernel-mutation", target: "none", proof: "interaction" },
{ id: "market.vote-retry", kind: "view", target: "none", proof: "interaction" },
// Taking back the innermost open thing: a popover, an inline form. One
// intent, reached by pressing away and by Escape.
{ id: "layer.dismiss", kind: "navigation", target: "none", proof: "interaction" },
@@ -254,6 +308,7 @@ export const ACTIONS: UIAction[] = [
// state — which is why it is one id and why it is not a mutation.
{ id: "external.open", kind: "shell-native", target: "none", proof: "interaction" },
{ id: "remote-host.remove", kind: "destructive", target: "none", proof: "authority-effect" },
{ id: "workspace.reveal", kind: "shell-native", target: "entity", proof: "interaction" },
{ id: "workspace.remove", kind: "destructive", target: "none", proof: "authority-effect" },
{ id: "extensions.invoke", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
@@ -266,8 +321,12 @@ export const ACTIONS: UIAction[] = [
// Asking a machine whether it answers. Nothing on either side changes, and
// asking twice is the point when the first answer was "not yet".
{ id: "remote.probe", kind: "repeatable", target: "entity", proof: "authority-effect" },
{ id: "remote.hide", kind: "view", target: "entity", proof: "interaction" },
{ id: "remote.enable", kind: "view", target: "entity", proof: "interaction" },
{ id: "remote.read", kind: "repeatable", target: "entity", proof: "authority-effect" },
{ id: "workspace.add", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "workspace.add-cancel", kind: "view", target: "none", proof: "interaction" },
{ id: "workspace.move", kind: "kernel-mutation", target: "entity", proof: "authority-effect" },
// ── Taking a change back ─────────────────────────────────────────────────
// Planning a revert and performing one are two contracts: the first asks the
@@ -282,6 +341,9 @@ export const ACTIONS: UIAction[] = [
{ id: "extensions.submit", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "provider.probe", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "provider.draft", kind: "interaction", target: "none", proof: "interaction" },
{ id: "provider.discard-edits", kind: "destructive", target: "none", proof: "interaction" },
{ id: "provider.revert", kind: "interaction", target: "none", proof: "interaction" },
{ id: "provider.model-check-all", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "provider.model-check", kind: "repeatable", target: "entity", proof: "interaction" },
{ id: "provider.add", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "provider.add-start", kind: "view", target: "none", proof: "interaction" },
@@ -303,6 +365,7 @@ export const ACTIONS: UIAction[] = [
{ id: "context.window-tokens", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "mcp.add", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "mcp.inspect", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "mcp.scope", kind: "interaction", target: "none", proof: "interaction" },
{ id: "remotes.add", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "remotes.save", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "remotes.remove", kind: "destructive", target: "entity", proof: "authority-effect" },
@@ -314,6 +377,7 @@ export const ACTIONS: UIAction[] = [
{ id: "share.cloud-offer", kind: "repeatable", target: "none", proof: "interaction" },
{ id: "share.toggle", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "share.address", kind: "view", target: "none", proof: "interaction" },
{ id: "share.port", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "share.offer", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "share.ask-revoke", kind: "view", target: "entity", proof: "interaction" },
{ id: "share.keep", kind: "view", target: "entity", proof: "interaction" },
@@ -342,6 +406,11 @@ export const ACTIONS: UIAction[] = [
{ id: "theme.import", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "theme.folder", kind: "repeatable", target: "none", proof: "interaction" },
// Usage changes what report is read, not canonical session state.
{ id: "usage.range.start", kind: "view", target: "none", proof: "interaction" },
{ id: "usage.range.end", kind: "view", target: "none", proof: "interaction" },
{ id: "usage.range.month", kind: "view", target: "none", proof: "interaction" },
// ── How the window looks ─────────────────────────────────────────────────
// Named for what a person is doing, not for the control they reached for.
// The interface scale has a row of presets and a slider beside it, and both
@@ -420,6 +489,9 @@ export const ACTIONS: UIAction[] = [
{ id: "browser-tools.enabled", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
// Read by the running turn at its next round, so no rebuild stands between the
// click and the canonical change.
// The kernel announces the change on the stream, so no rebuild stands between
// the click and the canonical change.
{ id: "currency.mode", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "progress-watch.pause", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "progress-watch.rounds", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
{ id: "progress-watch.token-multiple", kind: "kernel-mutation", target: "none", proof: "authority-effect" },
Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="296" height="296" class="segno"><g transform="scale(8)"><path fill="#fff" d="M0 0h37v37h-37z"/><path class="qrline" stroke="#000" d="M4 4.5h7m2 0h1m1 0h1m2 0h1m2 0h1m1 0h2m1 0h7m-29 1h1m5 0h1m5 0h1m3 0h2m2 0h1m1 0h1m5 0h1m-29 1h1m1 0h3m1 0h1m2 0h4m1 0h2m1 0h1m2 0h1m1 0h1m1 0h3m1 0h1m-29 1h1m1 0h3m1 0h1m6 0h1m2 0h1m1 0h3m1 0h1m1 0h3m1 0h1m-29 1h1m1 0h3m1 0h1m11 0h1m1 0h1m1 0h1m1 0h3m1 0h1m-29 1h1m5 0h1m1 0h5m2 0h3m1 0h1m2 0h1m5 0h1m-29 1h7m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h1m1 0h7m-20 1h1m1 0h3m1 0h3m-18 1h1m2 0h1m1 0h2m1 0h1m1 0h2m2 0h1m1 0h1m1 0h2m1 0h1m1 0h1m-21 1h1m1 0h1m1 0h2m1 0h1m2 0h1m1 0h4m1 0h1m1 0h1m2 0h1m2 0h1m-29 1h4m1 0h4m1 0h2m1 0h3m2 0h2m3 0h5m-28 1h4m4 0h1m3 0h2m2 0h1m9 0h2m-28 1h2m2 0h1m1 0h1m1 0h5m1 0h2m1 0h1m1 0h2m1 0h2m1 0h1m1 0h2m-28 1h1m1 0h2m3 0h1m2 0h1m1 0h4m1 0h2m1 0h1m-22 1h2m1 0h2m1 0h1m1 0h1m1 0h1m1 0h3m3 0h1m1 0h2m1 0h1m1 0h4m-28 1h2m1 0h2m2 0h1m1 0h1m4 0h1m1 0h1m1 0h1m1 0h2m1 0h2m1 0h1m-28 1h4m2 0h2m1 0h3m1 0h1m3 0h3m1 0h1m5 0h1m-27 1h2m2 0h1m1 0h1m2 0h1m1 0h5m1 0h1m2 0h2m2 0h1m2 0h1m-29 1h1m1 0h2m1 0h6m3 0h5m3 0h3m2 0h2m-27 1h2m4 0h1m1 0h2m2 0h1m2 0h1m1 0h2m3 0h1m2 0h2m-29 1h1m2 0h1m2 0h1m2 0h1m5 0h3m1 0h6m1 0h1m-19 1h2m1 0h2m1 0h2m1 0h4m3 0h1m1 0h3m-29 1h7m2 0h1m2 0h1m4 0h2m1 0h1m1 0h1m1 0h1m2 0h1m-28 1h1m5 0h1m1 0h2m1 0h1m2 0h2m3 0h2m3 0h5m-29 1h1m1 0h3m1 0h1m2 0h2m1 0h1m3 0h3m1 0h5m2 0h1m-28 1h1m1 0h3m1 0h1m1 0h2m2 0h2m1 0h2m1 0h2m2 0h5m1 0h1m-29 1h1m1 0h3m1 0h1m2 0h2m1 0h1m1 0h1m2 0h4m3 0h3m1 0h1m-29 1h1m5 0h1m2 0h1m2 0h1m1 0h1m2 0h1m1 0h2m1 0h1m4 0h1m-28 1h7m1 0h1m3 0h2m2 0h2m2 0h3m1 0h1m2 0h1"/></g></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,97 @@
// @vitest-environment jsdom
import { describe, expect, it, vi } from "vitest";
import HTML from "../index.html?raw";
const script = new DOMParser().parseFromString(HTML, "text/html").querySelector("script")!.textContent!;
function boot(fragment: string, path = "/", search = "") {
let resolve!: (response: { ok: boolean }) => void;
let reject!: (error: Error) => void;
const response = new Promise<{ ok: boolean }>((yes, no) => { resolve = yes; reject = no; });
const fetch = vi.fn((_url: string, _options?: unknown) => response);
const reload = vi.fn();
const replaceState = vi.fn();
const context = {
window: null as unknown,
__rxAuth: undefined as Promise<void> | undefined,
fetch,
location: { hash: fragment, pathname: path, search, reload },
history: { replaceState },
localStorage: { getItem: () => null },
document: { documentElement: { dataset: {}, lang: "" } },
navigator: { language: "en" },
performance: { mark: vi.fn() },
URLSearchParams,
};
context.window = context;
new Function(...Object.keys(context), script)(...Object.values(context));
return { context, fetch, reload, replaceState, resolve, reject };
}
describe("credential bootstrap before native asset loading", () => {
it.each([
["token", "#token=launch-secret", "/auth/token", { token: "launch-secret" }],
["pair", "#pair=one-time-code", "/pair", { code: "one-time-code" }],
])("reloads after the %s cookie is established", async (_kind, fragment, route, body) => {
const page = boot(fragment);
expect(page.fetch).toHaveBeenCalledWith(route, {
method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body),
});
expect(page.reload).not.toHaveBeenCalled();
page.resolve({ ok: true });
await page.context.__rxAuth;
expect(page.reload).toHaveBeenCalledOnce();
});
it("preserves the session path, query, and unrelated fragment before reloading", async () => {
const page = boot("#tab=extensions&token=secret", "/sessions/session-123", "?layout=wide");
expect(page.replaceState).toHaveBeenCalledWith(null, "", "/sessions/session-123?layout=wide#tab=extensions");
expect(page.replaceState.mock.calls[0][2]).not.toContain("secret");
page.resolve({ ok: true });
await page.context.__rxAuth;
expect(page.reload).toHaveBeenCalledOnce();
});
it("consumes pairing once when both credentials are present", async () => {
const page = boot("#token=secret&pair=once");
expect(page.fetch).toHaveBeenCalledWith("/pair", expect.objectContaining({ body: JSON.stringify({ code: "once" }) }));
expect(page.replaceState).toHaveBeenCalledWith(null, "", "/");
page.resolve({ ok: true });
await page.context.__rxAuth;
expect(page.fetch).toHaveBeenCalledOnce();
expect(page.reload).toHaveBeenCalledOnce();
});
it("keeps application fetches behind the existing authentication promise", async () => {
const page = boot("#token=secret");
const application = page.context.fetch("/runtimes");
expect(page.fetch).toHaveBeenCalledOnce();
page.resolve({ ok: true });
await application;
expect(page.fetch).toHaveBeenLastCalledWith("/runtimes");
expect(page.reload).toHaveBeenCalledOnce();
});
it.each(["", "#tab=extensions"])("does not reload a page without a credential (%s)", async (fragment) => {
const page = boot(fragment);
await page.context.__rxAuth;
expect(page.fetch).not.toHaveBeenCalled();
expect(page.replaceState).not.toHaveBeenCalled();
expect(page.reload).not.toHaveBeenCalled();
});
it.each(["#token=wrong", "#pair=expired"])("does not reload a refused exchange (%s)", async (fragment) => {
const page = boot(fragment);
page.resolve({ ok: false });
await page.context.__rxAuth;
expect(page.reload).not.toHaveBeenCalled();
});
it("does not reload when the exchange cannot reach the server", async () => {
const page = boot("#token=secret");
const failure = new Error("network unavailable");
page.reject(failure);
await expect(page.context.__rxAuth).rejects.toBe(failure);
expect(page.reload).not.toHaveBeenCalled();
});
});
Loaded 100 of 1756 files, more files were not shown because too many files have changed in this diff. Show more