Web shell: implementation and validation
Doc status: current contract. Living development and validation guide; its implementation history sections are evidence. Checked 2026-11-10.
Current reference
React + Electron and the Node/OpenCode core are implemented. Smithay is the only compositor of the product; the direct session is in use and remains experimental. River appears only in the historical evidence. The React UI is trusted and mounts in a ShadowRoot; only the profile's style.css is editable through replace_ui, and inline responses stay in opaque iframes. See the usage guide, the Smithay status and the recovery policy by backend.
Recorded validation: browser, Electron and direct Smithay composition, including a native capture of the session on 2026-10-28. There is also nested proof and historical River evidence. The / search was exercised through HTTP and the browser, with no recorded proof of a real opening through that flow. Physical shortcuts, audio and sustained performance need their own proof; a capture does not prove them.
Implementation history and evidence
The record starts on 2026-10-26 and receives progress in the later sections. Statements about the package, the single model, the platform, the missing installation and the test counts describe each stage, not the current state. The current model policy includes the free OpenCode models and the ChatGPT plan models after OAuth, with no paid fallback. In the initial stage below, no compositor or Linux session had been installed.
Chosen hosting
Electron 45.0.0 hosts the Chromium engine. The Node core can run as a child process of Electron or directly in the terminal. This option reduces the infrastructure needed to validate HTML/CSS/JS editing on the Mac; it is not a measured comparison with Tauri. There is no packaging for distribution, no signing and no updater.
The host has sandbox and context isolation, with no Node integration and no preload that exposes privileged APIs. It denies permissions by default (the current microphone exception for the protected host is described in the local voice section), blocks external navigation and restricts renderer requests to the local core. OpenCode uses its own transport outside that renderer.
The package version is locked in package-lock.json. The official Electron binary was downloaded and its SHA-256 was compared with the checksums.json of the package. The window opened; native automation found the Mac locked. The project owner chose to leave native validation for later. Do not declare the interactive Electron flow validated based on the browser proof.
Core and session
core/runtime.js starts its own OpenCode, with an isolated temporary configuration and an HTTP authentication distinct from the MCP bridge. Only the OpenCode provider and the big-pickle model are enabled, including as the helper model. Unexpected inherited MCP configurations make the runtime fail.
A conversation keeps one OpenCode session that the next messages reuse. History, session ID and status persist in state.json, outside the UI. Switching the conversation does not cancel the execution. The core sends only one turn at a time: the MCP bridge of this milestone does not carry a session ID in tool calls. Do not assume parallelism.
SSE messages update progress, completion, error and approval. The user can cancel; changes already applied are kept. Connection failures and authentication/quota failures appear in the core, with no deterministic fallback.
Customization and versions
For customization, the agent has read_ui and replace_ui. The separate publish_surface tool publishes interactive inline HTML responses, without editing the shell. An edit takes one of the three exact names, the current revision, a non-empty and unique search text, and a replacement. Relative paths, other names, extra arguments and old revisions are refused. Writes reject symbolic links; generated files do not run in Node.
- Copy the current revision and apply the replacement in memory.
- Parse the HTML with parse5, the CSS with CSS Tree and the JS syntax with vm.Script, without running anything.
- Show the candidate in an isolated iframe, without same origin, Node or privileged tools.
- Check startup, the state callback and the minimum conversation elements. Initial runtime errors and blocked resources reject the candidate; no confirmation within 20 seconds also rejects it.
- Persist the three files and the snapshot of the new revision; keep the previous working revision.
- Reload the active interface, keeping the conversation in the core.
The two recoverable revisions live in interface.json, outside the visual project. The manifest is written through a temporary file and a rename; project files are materialized separately. On a restart, the manifest is the source of the valid revision and rebuilds those files. There is no promise of a transaction across three files as external editors observe them.
The core has no file watcher for manual edits of a profile. Use the tools to produce revisions. To work on the seed and the trusted sources, npm run dev watches and rebuilds them for a synthetic profile and reloads the open pages (see Live UI development below). Customization is global for this profile, not per conversation.
Visual boundary and recovery
The editable UI receives only a public snapshot and navigation or message-preparation actions. Real sending stays in a protected control: visual code can suggest a draft, but it cannot automatically send intentions to the agent. Credentials, the API token and permissions are not given to the editable UI.
The IDs messages, composer, prompt, new, conversations and title and window.shell.onState are the minimum contract of this milestone; keeping them still allows changes to the composition and styles. External resources, inline scripts in the HTML and JS modules are not part of the project.
The protected bar allows canceling and restoring the previous revision. The /recovery page does not run the editable app.js and shows the history, sending and restoration. The desktop menu also opens this page. Since 2026-11-02 (HeroUI phase 10) /recovery is its own document with its own React bundle (host/recovery.html, shadcn-recovery.js); it loads nothing of the chat document, so a broken chat UI does not break it.
If the tab or renderer does not respond, end only this instance and run:
cd web-shell
npm start -- --reset-ui
The core stores the previous snapshot in interface-recovery-<timestamp>.json and recreates the UI from the seed, without deleting the history. A lock per directory prevents two simultaneous instances; a stale lock is taken over only if the recorded PID does not exist. An invalid state.json file causes an explicit failure and is not silently replaced.
Security limits and validation
The iframe does not share an origin with the core. CSP restricts scripts, network, frames, forms and resources; Electron adds navigation and network blocking in the host. In browser mode, this additional native interception does not exist. These measures are not a certification for hostile arbitrary JavaScript, and they do not prevent every effect of excessive CPU/memory consumption. Recovery through the terminal does not depend on the renderer responding.
The browser confirmation proves startup and the basic contract. It is not complete visual QA, a test of all interactions or a check of the intent of the code. An edit can produce bad spacing or barely useful elements; the history and recovery stay available. There is no independent adversarial evaluation in this delivery.
There are still no real windows, no River integration, no grid of external applications, no application automation, no executable selection and no equivalence with a working WM on Linux. The milestone is real customization of the shell through the conversation.
Route table
web-shell/core/route-table.js lists every top-level route of the core HTTP server in order, first match wins, each with its auth class. core/server.js binds one handler to each entry id, and one dispatcher enforces the class with the denial the route always had, before the handler runs. At startup the core throws if an entry has no handler, a handler has no entry, or the asset map differs from the lists of the table. A route behind the GET gate (getOnly) answers 405 to another method before the credential is checked, and a path with no entry answers 404 (405 for another method).
The classes: public (/health, the wallpaper statics and the checkout assets), launchKey (/session, key query), mcpBearer (/mcp, bearer token and POST, else 401), launchCookie (denial page; also the profile assets /theme.css, /shadcn-host.js and /chat-host.css), launchCookieSameOrigin (/desktop-wallpaper/sink, the cookie and the Origin of the core), hostMainKey (x-agent-native-host-key, no Origin, JSON 403 Host main key required; the modules check it again), lockToken (x-lock-token, /api/lock/) and shellToken (x-shell-token, /api/). The routes inside /api/ stay in the api handler and share its class.
The handlers of the pages, assets and wallpaper stream live in core/page-routes.js (with the asset map) and the /mcp handler in core/mcp-routes.js (its tool list in core/mcp-tools.js); both are factories that server.js calls with an explicit dependency object, and the state that changes over time (the turn, the tool-call counter, the readiness flag) comes through accessor functions.
The api handler is a sub-dispatcher in core/api-routes.js over the entries of five domain modules: core/api-change-routes.js (proposals, overlay, theme approval, accept, reject, recovery), core/api-conversation-routes.js (state, send, retry, workspace create/select/archive, approvals, memory, capture, account, model), core/api-desktop-routes.js (canvas, chat dock, workspace output and menu, overview, previews, window actions, Task View), core/api-settings-routes.js (window theme, wallpaper, profile color, hot corners, chat and bar glass, window style and reading, canvas warp and sharp zoom) and core/api-apps-routes.js (Start menu, applications, taskbar pins, metrics, quick settings, notifications, tray, screenshots, voice). The entry shape and the return convention (ANSWERED) are in core/api-route-kit.js; the variables of server.js that change over time reach the modules through the getters and setters of live. The sub-dispatcher keeps the order of the old handler: GET entries first (exact paths, plus the matchers of the tray, quick-settings, notification and screenshot helpers), then Method not allowed for a non-POST, then one body read with the limit of the path (bodyLimit), then the POST entries marked guarded: false (screenshots, tray, /api/workspace-output, /api/desktop-actions, /api/desktop-actions/open, /api/workspace-menu), then the guard Aguarde a troca de sessão. (except /api/voice/stop, also for an unknown path), then the guarded entries; a handler that returns nothing ends with notifyPaletteSafely(); json(res, { ok: true }), and a path with no entry is Unknown API. test/api-routes.test.js checks the unique pairs, the unguarded list and this order.
A new top-level route or asset must get an entry; the core refuses to start without it. test/route-table.test.js checks the table and, against a synthetic core, the denial of every entry.
Commands and evidence
cd web-shell
npm ci
npm run format:check
npm run check
npm test
npm run desktop
You can also run npm start and open the Browser session URL that it prints. That URL sets an HttpOnly cookie before it loads the page. Pages that contain the host token (/, /recovery, /desktop-sessions, /desktop-topbar and panels) require this cookie, so that other local users cannot read the token through the loopback port; Electron receives the same key through an environment variable and sets the cookie directly. AGENT_NATIVE_DATA_DIR isolates the data; AGENT_NATIVE_OPENCODE_BIN points to another executable. Do not expose the port publicly.
A core that you start by hand or from a test script keeps running after your task ends. On 2026-10-31 a synthetic core started with testEnvironment kept running for 22 minutes after the agent that started it had finished. Before you report, run pgrep -af "core/server.js". Stop only the cores that you started, after you check the working directory (/proc/<pid>/cwd) and the data directory of each one. Never stop the live core of the session.
Automated tests check path/argument restriction, stale revision, rejection of invalid syntax, confirmation before activation, preservation on failure, restoration, continuity of the saved state, symlink and HTTP Host/Origin/token protections. The HTTP test uses a nonexistent executable, so it calls no paid or free provider.
In the isolated browser, real requests were sent to the free model: change the accent to violet and turn the side navigation into a top strip. The agent changed the CSS and the interface reloaded in the same session. Restoration went back to the previous version without deleting the messages. A third request inserted an intentional throw into app.js: validation refused it and the active file stayed functional. The session reported cost 0.
The generated top layout showed spacing limitations; it was not treated as an approved design. No video, because nobody made a specific request for one. Synthetic media stays outside Git.
Live UI development
Since 2026-11-09 npm run dev (in web-shell, script scripts/dev.js) is a live-reload server for the system UI: edit the React/shadcn sources and the CSS and see the change in an ordinary browser with no manual build or reload.
cd web-shell
npm run dev # port 4317; --port <n> or UI_DEV_PORT=<n> to change it, --no-seed to skip the sample messages
Open the Open (sets the session cookie) URL that it prints. It sets the HttpOnly launch cookie of the dev core and lands on the chat. /__dev/pages lists the other pages that render without a compositor: the bottom and top bars (/desktop-sessions, /desktop-topbar), /recovery, /quick-settings and the protected panels under /web-panel/<id>. Settings, the model picker and the dialogs live in the chat document. In the Claude browser pane, .claude/launch.json has the configuration ui-dev; the pane opens the origin, which answers 403 until you open the printed session URL once.
What it runs:
- One synthetic core, started with
testEnvironment(noAGENT_NATIVE_*,DISPLAY,WAYLAND_DISPLAY, session bus or local model), on 127.0.0.1 and a random port, with no compositor socket. Its data lives in${XDG_STATE_HOME:-~/.local/state}/agent-native-os/ui-dev/(the profile, private XDG config, state, cache and data directories, and the launch key, kept so an open tab survives a restart). It never touches the live profile, core or compositor. The script refuses a dev directory under~/.local/share. - No AI provider and no credential:
scripts/dev-opencode.cjsanswers every turn with a fixed Markdown sample, and a message that names "componente" or "surface" publishes one isolated inline component. On the first start the script sends two such messages so the chat is not empty. - A proxy on 127.0.0.1:4317 in front of the core. It forwards every request unchanged (it only rewrites
Hostand a same-originOriginto the core address) and injects<script src="/__dev/client.js">into the HTML pages whose CSP already allowsscript-src 'self'andconnect-src 'self'. No CSP is relaxed: pages that do not allow it (isolated plugin panels, the wallpaper page) get no client and no automatic reload. The core, its CSP and its routes are unchanged; the dev client and its/__dev/eventsstream exist only in this proxy and need the launch cookie.
What reloads how:
| Change | Action | In the page |
|---|---|---|
ui-src/** (app.jsx, style.css, index.html, host/**/*.jsx, host/*.css) |
rebuild with the functions of npm run build (uiOutputs of scripts/build-ui.js), writing only changed outputs |
only .css outputs changed: stylesheets swap in place (the document, its state and the ShadowRoot of the chat stay); any other output: full reload |
host/theme.css and other hand-written host/*.css |
none | stylesheet swap |
hand-written host/*.js and host/*.html |
none | full reload |
host/ui-themes/<base>.css (seed) |
copied to the dev profile copy while that copy equals its original.css (not customized); a customized copy is left alone with a warning |
stylesheet swap |
<dev profile>/ui-themes/<base>/theme.css |
the core reads it itself (openspec/specs/profile-ui-themes/spec.md) | stylesheet swap |
A rebuild takes about 1.5 s (the whole build of npm run build, no esbuild context). A build error prints in the terminal, shows as an overlay at the bottom of each open page (click to dismiss) and in the console; the server keeps running and the pages keep the last good build. The generated files in the checkout are the outputs of npm run build, so npm run build:check passes after the sources are saved. The profile style.css stays in interface.json and changes only through replace_ui; editing the materialized copy in the profile does nothing. Changes to core/, desktop.cjs or scripts/dev*.js need a restart. Ctrl+C stops the proxy and the core it started; a SIGTERM to npm also stops it, because the script stops when it loses its parent. A SIGKILL of the script leaves the core running: stop it by its working directory and data directory, never the live core.
What it does not prove: the Electron host (its partitions, request filters and window declarations), the compositor (windows, glass, blur, overview planes, the bars at their real size, input, focus), a real provider or model, the voice, notifications and tray of a real session bus, or a second output. Use nested QA (docs/nested-qa.md) or the live session for those. The launch cookie is per host, not per port: in a browser that also holds the cookie of another core on 127.0.0.1, the last session link opened wins.
Sources
Context had no suitable packages installed for Node, Electron, parse5 or CSS Tree. The consulted sources were the official projects parse5, CSS Tree, Electron security, WebRequest, iframe and sandbox and OpenCode server. The versioned Node 26 page for vm was not accessible; the local tests confirmed the syntax analysis, without running the generated code in Node.
Inline components
publish_surface takes a title, HTML, CSS and JavaScript, analyzes the syntax and persists the document in the conversation. The message references that component; it does not print code to copy. The renderer creates an iframe with an opaque origin, with no Node, no external requests and no credentials. The shell project is another isolated document. The same component is not automatically a system window.
The window.surface.action(text) bridge prepares a continuation for review in the core; it does not send a message automatically. The core does not accept arbitrary calls from this component. Status updates keep the existing message elements so that the component does not restart on each poll. The local state of the component stays during the use of the message; it is not persisted after a reload or a conversation switch in this milestone.
Pinning a component beside the chat is implemented (Pinned surfaces); collapsing and placing it on the window grid are not implemented yet. Full virtualization, suspension of all off-screen components and consumption measurements remain pending.
The initial validation found a DOMContentLoaded listener that did not run because of late injection. The loader was changed to install the JavaScript before that event. A typo was also found in the filter that the LLM generated; valid syntax does not prove functionality. The error stays explicitly as evidence of the limit of generation, and the corrected response needs a functional test through the UI.
Resuming after a core restart uses /global/event and normalizes the payload of the events, filtering by the session of the conversation. The previous version with a local /event did not deliver progress for a session restored in another temporary directory.
Execution on this computer
The current configuration uses opencode/big-pickle, free and native to OpenCode, and does not need OpenRouter credentials. The historical tests above used OpenRouter. There is no paid fallback.
Model switching and recovery
The selector in the host queries /provider of OpenCode and lists only active models of the opencode provider, with text and tools and numeric zero costs, including cache and additional tiers when declared. The choice is stored in state.json. Switching recreates only the OpenCode runtime, with equal main and helper models; the conversation, the session and River continue. Switching is blocked during a response; it is possible to stop first. There is no automatic fallback.
The initial interface shows only the chat, the send control and the discreet selector. Recovery opens in the same window from the native menu and from a left click on the recovery link of the main chat, with a Voltar ao chat (Back to chat) link; restoring returns to the chat after success. A middle click opens a separate recovery window pinned to /recovery: Voltar ao chat, and the return after a restore, close it. The open chat applies the restored profile CSS from its next /api/state poll (profileStyle, every 600 ms), without a reload. An output chat and the bars stay on their own route. Quota errors appear at sending; they are not treated as a visual failure and do not open recovery.
ChatGPT account
The Conta (Account) action opens a protected configuration with an OAuth login through OpenCode itself. There is no API key field, no copy of Codex tokens and no credentials in the public snapshot. In River, the login opens a Wayland Chrome with its own profile, next to the conversation; other windows keep running, hidden in the pair layout. The callback stays in OpenCode. After success, the runtime is recreated to refresh the catalog that was cached before, and only then a plan model is chosen. Do not use the catalog from before the OAuth as proof that no models exist.
Reading the OAuth type in native storage confirms the connection; a completed response confirms access to the model. Plan models are listed only when OpenCode confirms OAuth, the openai connection and zero cost for that route. There is never a fallback to an API key or a paid route. Canceling the login ends the responsible instance, including pending callbacks, without disconnecting the account that is already saved.
Window control by the agent
The authenticated MCP now announces desktop_state, open_application, window_action and arrange_windows. The prompt was updated: the agent can open Chrome/terminal, place it next to the chat and control focus/expansion/grid. The core validates the application and the live IDs; URLs accept only HTTP/HTTPS or about:blank. The open command waits for a native window and an applied geometry. Focus/layout also wait for confirmation from the WM. There is no arbitrary execution, no process closing, no mouse/keyboard and no access to the content of the applications through these tools. The WM draws frames for external applications, with close/minimize/maximize and appearance preferences; Galaxy Shell stays without a frame. See river-development.md.
Workspaces on several outputs, phase 1 of the core (2026-11-02)
History: the setting below was removed on 2026-11-03; see "Workspaces on several outputs always on" after the shared cameras section. Phase 1 of multi-output-workspaces.md is in the core behind the protected setting workspaceOutputs (off by default, POST /api/workspace-outputs-enabled with the shell token of the launch-cookie page; /api/state reports workspaceOutputs). No settings toggle exists before phase 4. The feature is inert in a real session until phase 2: the core renews the lease (workspace_outputs_enabled {enabled: true}) only with the setting on, after the login restore ends, and only on a compositor with both capabilities.workspaceOutputs and capabilities.outputChats; a compositor of phase 1 reports only the first. Without a live lease every rule below is the rule of today.
- web-shell/core/workspace-outputs.js holds the shared rules:
sharedWindow(the snapshot fieldshared, elseoutput === "secondary"of an older compositor), the shown workspaces, the step rule, the primary pick and theworkspace_on_outputrefusal text. - The agent tools act on
desktop.agentWorkspace(): the conversation of the turn (desktop.turnWorkspace, read fromturnin server.js), elseactiveWorkspace. Under a live leaseactivefollowsfocusedWorkspaceat once, also during a block, withmarkOpened, and sends noworkspacecommand. A selection sends oneworkspacecommand and waits until the workspace shows on an output. Super+Left/Right and the swipe step from the focused workspace and skip the workspaces of other outputs, with no wrap. The archive pick skips them too. A scheduled selection sendsprimary: true, only with the capability. - The agent
send_to_outputrefuses withworkspace_on_outputbefore the command, only on a compositor withcapabilities.workspaceOutputs.desktop_statereportsoutputs[].workspace,focusedWorkspaceandwindows[].sharedwhen the compositor reports them. - History (until 2026-11-03): off sent
workspace_outputs_enabled {enabled: false}; a refusal behind the lock was sent again after the unlock (workspaceOutputsOffAfterUnlock). Rollback was to turn the setting off first. - Tests: web-shell/test/workspace-outputs.test.js, web-shell/test/workspace-outputs-http.test.js, and the per-output tests in web-shell/test/smithay.test.js and web-shell/test/window-session.test.js, all against synthetic compositors.
Workspaces on several outputs, phase 2 of the core and the host: output chats (2026-11-02)
Phase 2 of multi-output-workspaces.md (W8) gives each extra output that shows a workspace its own chat window with the conversation of that workspace. It acts only under a live lease on a compositor with capabilities.outputChats. Without it every route below behaves as before, and the core never sends the new output key, because the compositor refuses unknown fields.
- The host snapshot
wm.workspaceOutputs(GET /api/stateand/host-layout, only withcapabilities.workspaceOutputs) is{enabled, outputs: [{name, position, workspace, chat}], primary, focused}.enabledis true only under a live lease with output chats.chatis true when a bound host chat draws on that output. - The Electron main process (
OutputChatsin web-shell/core/host-windows.cjs) reads that view every second. It declaresPOST /host-window {surface: "chat", output, token}with the host main key only, opens/#output=<name>, and closes and forgets a chat when its output stops showing a workspace. It repairs an output chat that does not bind, or that loses its binding, after 10 s: three new windows at once, then one per minute. It forgets the old token before it declares the new one. A refused declaration ("Only one window for this role", "Unknown output", "Output chats are unavailable") is logged and asked again after one minute. A close of an output chat never quits the host; the close of the primary chat closes every output chat. - The chat page reads
#output=<name>. It polls/api/state?output=<name>and addsoutputto the bodies of send, retry, approve, theme/approve, schedule-approval, chat-dock, desktop-chat-glass, desktop-chat-glass-regions and window-capture./api/stateanswerschat: {output, conversation, approvals}; an output that shows no workspace answers 400 "A saída não mostra um workspace.". The page showschat.conversation. The bars, quick settings, notifications, the tray, the HUD panels, the overview, the canvas dock and the change review stay on the primary chat. - One turn at a time. Send, retry, voice and the approvals name their conversation and output. The core refuses with "A conversa mudou. Tente novamente." when that conversation no longer shows in that chat. Only the chat that shows the conversation of the turn shows and answers its approvals; while that output chat is not bound, the primary chat shows and answers them. Every approval answer names a conversation (the tool approval the conversation of the dialog, the theme and schedule approvals the conversation of the chat); under a live lease an answer that names neither the conversation nor the output is refused.
focusChatraises the output chat that shows the conversation of the turn, else the primary chat, and an output chat expands its own hidden canvas chat for an approval. The Super tap acts on the chat of the focus output (chat_focus {output}), or on the primary chat while that output chat is not bound. - "Mostrar ao agente" of an output chat captures the focused window of its own output (
capture {output}) for the conversation of that chat. Pinned surfaces follow their conversation. - The core sends
chat_glass_regions,chat_glass,chat_dock,focus_chatandcapturewithoutputfor an output chat. The glass flag of an output chat keeps the heavier tint, because the snapshot does not report glass per output. - Rollback: roll back the host, the core and the compositor together, or let the lease end; the host then closes every output chat. (History: until 2026-11-03, turn
workspaceOutputsoff first.) - Tests: web-shell/test/output-chats-http.test.js (a real core against a synthetic compositor, the main-key refusals, the conversation refusals and the lease-off and phase-1 regressions), the output chat cases in web-shell/test/host-windows.test.js, host-script.test.js, smithay.test.js, window-capture.test.js, window-declarations.test.js and workspace-outputs.test.js, and
npm run test:output-chats(two chat pages against one synthetic core).
Shared workspace cameras, phase 2 of the core and the host (2026-11-03)
Phase 2 of shared-workspace-cameras.md lets a Canvas workspace show on several outputs with one camera each. It acts only with a live per-output lease and capabilities.sharedCanvas (until 2026-11-03 also only with workspaceOutputs on); see the spec section "As built (phase 2)".
- web-shell/core/smithay.js renews the
shared_workspaceslease after the per-output lease, sendsfocus_onlyon every resend ofworkspaceandfromon "Tirar de N", and routes the approval expand to the agent view. - web-shell/core/workspace-outputs.js holds
shareableWorkspace,viewOutputsandagentViewOutput, the step rule that skips only single-view workspaces and the menu labels. - web-shell/core/desktop.js adds
focusOutputandviewstodesktop_stateand mapssame_workspaceandworkspace_sharedto texts. - Rollback: roll back the core and the compositor together, or let the leases end (60 s after the core goes away); the compositor then collapses the views. (History: until 2026-11-03, turn
workspaceOutputsoff first.)
Workspaces on several outputs always on (2026-11-03)
The user said "remover opcao de mostrar workspace em outros monitores, ela deve ser ativo sempre, nao uma feature flag", so the protected setting workspaceOutputs is removed (openspec/specs/multi-output-workspaces/spec.md, Status; docs/architecture-decisions.md).
- web-shell/core/smithay.js always renews
workspace_outputsafter each connect (after the login restore) on a compositor withcapabilities.workspaceOutputsandcapabilities.outputChats, andshared_workspaceson the same connection withcapabilities.sharedCanvas. It never sends either lease off; a lease ends with its connection and the 60 s grace of the compositor, which is the version-skew safety. - Every connect reads
statebefore its firstworkspace, andfocusOnlyKeyneeds asharedCanvasproven by a state answer on this socket (stateSocket, set inconsumebeforeupdate), with no lease needed: the compositor acceptsfocus_onlywithout one, and without a second view it is a plain selection. A rollback to a compositor without the capability gets no unknown key (W1). The connect clears aresyncAfterUnlockof the last connection, because its own resend covers a reconnect. The chat dock refusal for an extra output without a live lease reads "Workspaces on several outputs are unavailable right now". - The route
/api/workspace-outputs-enabled,setWorkspaceOutputsEnabled,endSharedWorkspaces,workspaceOutputsOffAfterUnlock, the refusal codedisabledand the settings toggle are gone./api/statehas noworkspaceOutputs; web-shell/core/store.js drops a saved value when it loads the profile. The first save of a new core drops theworkspaceOutputskey from state.json: an expected hash change in a before/after comparison of the profile, not data loss. A rollback core reads the missing key as off, renews no lease, and the leases end through the 60 s grace. - The agent prompt and the tool descriptions say "on a compositor with per-output workspaces" instead of naming the setting.
scripts/nested-qa.py --settingtakes onlycanvasandcanvasWarp.- Tests: the lease tests in web-shell/test/smithay.test.js (renewal with no setting, never off, the rollback without
sharedCanvas), web-shell/test/workspace-outputs-http.test.js (renewal on connect, reconnect and restart with a profile that saved the setting off; the route is gone), the older-compositor cases in output-chats-http.test.js and workspace-menu-http.test.js, and the toggle absence in host-script.test.js and shadcn-settings.test.js.
Show to the agent
The protected composer has a "Mostrar ao agente" button that attaches a capture of the focused application window to the next message. The user clicks, sees a removable thumbnail and then sends. The agent cannot trigger a capture and generated HTML has no access. The contract, limits and evidence are in capture-tty4.md.
Local consolidation and clock
The code of the session in agent-native-os-opencode-free was merged into the main repository agent-native-os, which becomes the canonical working folder. The old copy was kept for safety and must not receive new changes. Runtime data stays outside Git; no history or credential was copied into the repository.
The host shows the local time of the device in 24-hour format in the top right corner, with the full date in the tooltip. It updates at startup, every second and when it regains focus or visibility, independently of the connection to the model and of reloads of the editable shell.
Consolidation validation: npm ci, format:check, check and 32 Node tests passed; native/river/test.sh built the WM and passed the frame tests. The clock was visually confirmed in the browser with synthetic data and OpenCode disabled. This change was not validated interactively in Electron or in a real River session.
Local voice conversation in Portuguese
The project owner authorized an experiment with a spoken conversation, with continuity and interruptions. The Voz (Voice) button belongs to the protected host. Turning it on loads a Python worker over a private stdio; only then does it ask the microphone for mono audio, with echo cancellation and noise suppression. It does not capture video. In Electron, both permission handlers require the main document, the exact chat URL and audio only. Permissions-Policy limits the microphone to the host itself and denies camera/display capture. Iframes with an opaque origin do not receive this permission, the token or the voice endpoints.
The host keeps a short pre-roll, requires sustained activity and sends PCM16 WAV after about 850 ms of silence, with a limit of 15 seconds per segment. The worker validates duration and format, applies Silero VAD and multilingual Whisper base on CPU/int8, forcing Portuguese. WAV is decoded with the standard library and resampled in memory before inference, without depending on the PyAV decoder. The PyAV version installed with the engine did not accept metadata_errors in the first test; the WAV path avoids this incompatibility. Recognized speech is sent automatically only while the user keeps this mode on, with the conversation ID validated in the core.
The agent keeps the session and the model selected in OpenCode and receives guidance to give short answers in Portuguese. After the turn finishes, the host splits the response into sentences, omits code blocks and synthesizes with the selected local engine: Piper pt_BR-faber-medium (default) or Kokoro v1.0 int8 with the Brazilian pf_dora voice. There is no streaming of the agent tokens in this milestone. Voice detection interrupts playback and asks to cancel the turn in progress. Late synthesis responses are discarded; canceling does not undo tools that already ran. Endpointing is based on energy, not on understanding intent: sustained noise can interrupt speech. While a segment is being recognized, capture does not accumulate a second segment; wait for the indicator to return to Ouvindo/Pensando (Listening/Thinking).
Ending releases the tracks and the AudioContext and terminates the worker. Hiding the tab, reloading, switching conversations or losing the microphone ends capture. A permission request without an answer has a timeout and allows a new attempt. There is no wake word, no permanent audio recording, no remote voice service, no API key and no paid fallback. Recognized text and the response are kept in the normal history. The text still goes to the selected provider; only recognition and synthesis are local.
scripts/setup-voice.py installs faster-whisper 1.2.1, piper-tts 1.3.0 and kokoro-onnx 0.6.1 in its own venv, with Python 3.10+ and without changing the system Python. The normal scripts/install.sh flow runs it before registering next-login routing and fails explicitly if installation fails. It downloads public models with pinned revisions into ~/.local/share/agent-native-os/voice (or AGENT_NATIVE_VOICE_DIR). Existing installations can run the script independently. Installation requires internet access and Python venv support; it does not activate the microphone or change the selected model. Inference uses HF_HUB_OFFLINE and local paths; startup never downloads models silently. Piper is GPL-3.0 and the dataset of the faber voice is CC0 according to its model card. The artifacts are not versioned.
The protected Configurações > Voz tab selects Piper or Kokoro through the authenticated /api/voice/engine route. The choice persists as voiceEngine in the profile; an older profile defaults to Piper. Only these two engine IDs are accepted, and the core checks the installed files before saving. A live or starting voice worker blocks changes, including from another chat. The setting changes speech synthesis only: Whisper, the selected agent model, microphone consent and the conversation remain the same. No agent tool, generated HTML or plugin panel receives this setting. The selected engine is passed to the private worker, which loads only that TTS model. There is no fallback to another engine or a remote service on failure.
The installer includes Kokoro v1.0 int8 and voices from the versioned model-files-v1.1 release of kokoro-onnx. It verifies pinned SHA-256 values before publishing the downloads, reuses verified files and preserves and reports damaged existing models. Kokoro runs through ONNX Runtime on CPU with two threads and bundled eSpeak phonemization. The model is Apache-2.0 and kokoro-onnx is MIT. Existing installations run python3 scripts/setup-voice.py once to add Kokoro. Publishing this source change and preparing the active checkout does not update the running core; the selector is available at the next login.
The voice button uses a native click listener: React/Base UI tooltip and composer state renders replace the onclick property, so assigning that property can silently disable the button. The browser regression covers tooltip activation, repeated startup errors, successful listening and release of a synthetic microphone. On 2026-11-04 the installed engines synthesized a Portuguese sentence in 119 ms and transcribed it in 759 ms after a 1.685 s worker load. This verifies local inference with synthetic audio, not physical microphone input or speaker playback.
Sources: faster-whisper, Piper Python API, faber model card, Electron permissions.
Validation of this delivery: npm ci, format:check, check and 42 Node tests passed; Python was analyzed with ast.parse. New tests cover endpointing, audio limits, exclusive host permission, HTTP rejection without a token, continuity of the sending of recognized speech and discarding of interrupted synthesis. Real models installed in the local profile: initial load of about 5.8 s, generation of a 0.4 s sample and synthetic recognition of 1.5 to 1.9 s on this i5-8265U. Synthetic audio does not measure real accents, noise or echo; in one test, the transcription of “cumprimentar” (to greet) came out as “complementar” (to complement).
In the real core, synthetic audio was recognized, sent to GPT-6 Luna of the plan already connected through OAuth, and the response was synthesized locally: recognition 1.455 s, agent about 4 s, synthesis 0.483 s. The follow-up “Você lembra qual é o meu nome?” (Do you remember my name?) kept the session and answered “Sim, lembro: seu nome é Rui!” (Yes, I remember: your name is Rui!), with reported cost zero. The free Big Pickle and DeepSeek returned a usage limit in the QA profile; the explicit switch in the synthetic profile did not change the model of the existing River profile. There was no automatic fallback.
Browser proof: the button to turn voice on/off, a reload that kept the history and the presentation of the conversation were verified through the UI. The embedded browser did not complete the microphone request; the timeout gave control back with an explicit error. Electron host: real installation in ~/.local and startup in nested River with a separate voice-preview profile; presentation and audio capture still need human evaluation. Real system control by voice: not exercised, because the validation used only conversation, without running desktop tools. No QA media, synthetic conversation or model was included in Git.
Local persistent memory
Integration of opencode-codex-memory@0.9.12 in OpenCode 1.19.4, loaded by the trusted adapter core/memory-plugin.js. The package-lock installs the dependency and its transitive dependencies; the adapter is referenced by a local URL relative to the module, including in the installed release. It is not necessary to install the plugin globally. Overrides of Zod 4.6.7 and toml 5.0.1 fix the dependency warnings found during the integration.
The exclusive directory is ${AGENT_NATIVE_DATA_DIR}/memory, or ~/.local/share/agent-native-os/web-shell/memory in the default core. In the River session, the data directory that the launcher already uses applies. The directory has mode 0700; the plugin keeps Markdown, SQLite and internal history in that location, outside the three editable files. Reloading the UI, restarting the core or switching the model keeps the same root. No memory from Codex CLI or Claude Code is imported or exported.
extract_model and consolidation_model receive the same full ID as model and small_model each time the runtime is created. Switching the selector recreates the process and applies the choice to the following jobs. The plugin uses the providers and the authentication that already exist in OpenCode; it does not receive a copy of credentials and does not use an external memory service. Extraction sends excerpts of the conversations to the selected provider, consolidation also uses that model, and both consume its quota. There is no promise of offline operation.
The global discovery of the plugin is filtered by the session IDs persisted in state.json, before any transcript is offered for learning. Only plugin helpers inside this root also go to the internal cleanup. Histories of other OpenCode projects are not candidates. The ID of a new conversation is saved before the first prompt is sent.
The runtime no longer uses --pure, which would prevent loading the plugin. The XDG configuration and the home used to discover configurations/skills stay temporary and isolated, without changing the native authentication storage. Project configurations and external skills stay disabled; unexpected inherited plugins and MCP make startup fail. The core checks the memory tools before it declares the connection ready.
Only the shell agent receives the desktop/UI MCP permissions, the browser permissions (playwright_*) and the narrow tools memory_read, memory_search, memory_list, memory_add_note, memory_inspect and memory_mode. The MCP permissions are no longer at the global level, so that they do not reach the learning helpers. The plugin provides the restricted extraction and consolidation agents. The HTML documents do not receive these tools, access to the database or automatic sending. The destructive memory reset was not released to the agent.
Explicit notes are saved right after the user approves them in the host; corrections enter as new notes and the later consolidation updates the summaries. Automatic learning keeps the default of the plugin: sessions become eligible after six hours of inactivity and run while OpenCode is active. This is not the same as saving every turn immediately. For a backup, stop the runtimes that use the profile and copy the whole memory folder, including databases, SQLite sidecars and hidden files. See the plugin documentation.
Proof of the integration: in the browser with a synthetic profile, memory_inspect confirmed the two models as openai/gpt-6-luna; memory_add_note wrote a note in extensions/ad_hoc/notes. After ending and restarting the core, a new conversation retrieved the note through memory_search. The tools finished and OpenCode reported zero cost in both turns. Big Pickle and Beam Free refused because of the free limit; GPT-5.4 mini was listed by the catalog, but the provider refused its use with a ChatGPT account. The explicit selection of GPT-6 Luna happened only in the synthetic profile, with no automatic fallback and no change to the River profile.
The proof exercised explicit writing, search and persistence between sessions. The automatic extraction/consolidation after six hours was not awaited. The Electron host and real system control were not exercised in this change. Activation in the TTY4 session depends on the coordinated update of the release; the isolated core test does not update the shared host. No QA conversation, media, database or credential was versioned.
Checks of the consolidated version with voice: npm ci, format:check, check and 44 Node tests passed; npm audit reported no vulnerabilities.
Product change process
The core manages changes to the interface, interface restoration, frames and model through core/changes.js. The existing MCP and HTTP entry points use the same process; the user does not need to issue registration or coordination commands. change_status is a read-only tool. The agent stays restricted to the three UI files and the existing typed tools; it does not receive editing of the host or the core, or execution of recovery callbacks. Release installation and executable updates stay in the external development flow.
Changes to the product sources do not use this process. They use the proposal flow with the protected review card (change_propose, change_submit, user approval), described in self-maintenance.md.
Each operation reserves the profile, writes a checkpoint and records the preparation, validation, application and verification phases before it finishes. A new UI must still pass the isolated preview in the browser. The materialized files and the manifest are read back before the confirmation; preferences are checked in state.json and the appearance is also checked in the confirmed state of the compositor. A failed model switch starts the previous model again; it does not select another provider or use a paid fallback.
Inside the AGENT_NATIVE_DATA_DIR directory are changes.json (private journal and active checkpoint), changes.log (JSONL metadata events, without prompts, code or error messages) and .changes.lock. The checkpoint contains only the affected resource: the two UI revisions or the model/frame preference. It does not store a snapshot of conversations, credentials or processes. The public state exposes only identification, type, phase and times, with up to 30 recent results; bundles and checkpoints are not exposed in that summary. New files use mode 0600. Atomic writes sync the file and the directory before they continue.
The exclusive flock lock is held during the whole operation, including the wait for the preview and the recovery. A minimal helper keeps the descriptor and ends when the pipe of the core closes, which releases the lock after a process failure. There is no lock recovery by deleting files or by trusting PIDs alone. A second operation is refused before it applies any effect. After it gets the lock, the core rereads the journal; UI checkpoints also check the persisted revision to refuse an outdated owner. The product lock is per profile and is distinct from the coordination.lock that the development agents use. The installer checks the flock dependency.
Failures go back to the checkpoint. If the recovery also fails, the journal keeps the operation pending and new changes stay blocked. The host offers “Tentar recuperar alteração” (Try to recover change) in /recovery. At the next startup, the core recovers interrupted operations before it materializes the active UI/configuration. An invalid journal causes an explicit failure and keeps the original; it does not silently reinitialize the profile. State write failures do not permanently poison the persistence queue, which allows a later recovery attempt.
The interface recovery does not write state.json; the preference recovery changes only the matching key in the in-memory state, and keeps the messages received while the change was in progress. The process does not close applications, restart River, change the Wayland socket or restore an old list of windows. A model switch restarts only OpenCode. Launching/closing applications, transient window actions, inline surfaces, OAuth login and release installation are not reversible transactions in this milestone. The mechanism does not try to compensate for them by ending or relaunching processes.
Validation: npm ci, format:check, check and 53 Node tests passed; sh -n scripts/install.sh passed. The tests cover exclusion between owners, stale revision, partial write, failed restore, a new message during rollback, a failed model switch with return to the previous runtime, a failure also in recovery and a retry, an invalid journal preserved and SIGKILL during application. An external sentinel process stayed alive during the recovery; this is not proof about real graphical applications.
In the browser, with a synthetic OpenCode transport and no provider calls, the conversation triggered MCP read_ui/replace_ui: a valid edit was activated and recorded; a preview with a startup error was refused and undone. Restoration through the host went back to the previous revision and kept the messages. A synthetic write failure left the operation in recovery_failed, disabled new changes and showed the recovery link. After the cause was repaired in the QA profile, the protected button completed the recovery. Restarting the core kept the six messages and identical session IDs. /recovery showed the history of the operations and no pending items. The Electron host and real system/TTY4 control were not exercised in this change; no shared runtime was installed, restarted or ended. QA data, logs and media stay outside Git.
UI review: icons, corners and conversation area
The protected controls use local SVGs with a common stroke and common dimensions for send, stop, voice, new conversation, settings and close. Voice mode changes only its label and keeps the icon. The host sets radii of 10 px for controls and 16 px for panels; the seed uses the same panel radius for messages and inline components. In narrow windows, new conversation and settings keep icons with accessible names, which frees space for the model selector.
The host measures its footer with ResizeObserver and reserves that height outside the conversation (at the time an iframe; today React in a ShadowRoot). The field can grow up to 180 px without covering the messages, including drafts prepared by the components or by voice; after sending, it returns to the initial height. The seed follows the last message on resize if the person is already at the end of the conversation.
Browser proof with a synthetic profile and conversation: inspection at 1280 px and 360 px, an eight-line draft, opening and closing of the settings. At 360x640, the history ended at y=371 and the send control started at y=387, with the settings inside the available width. No message was sent to a real provider. npm ci, format:check, check and the 53 Node tests passed. This proof does not validate native composition on TTY4 or voice capture.
Conversation tabs and archiving
The host presents sessions at the top as numbered tabs, keeping the conversation at the center and the sending protected. The numbering uses the persistent ID of the conversation: archiving a tab does not renumber the others. The tabs share the available space, hide the title when they get narrow and shrink to 36x36 px squares. Past that limit, the strip allows horizontal scrolling. The active tab stays visible on resize. The + button creates a conversation, and the archive icon reopens the archived ones.
The × archives without deleting the session, the messages or the inline components. When the user archives the current tab, the previous available one is selected; when the user archives the last one, an empty conversation is created. Reopening recovers the same session and the same number. The limit of 32 open conversations does not count the archived ones. The core refuses switches and archiving during a response, a login, a model change or a pending change. Drafts stay separate per conversation in the memory of the host while it stays open, including when archiving and reopening; they do not persist after the host reloads.
Synthetic QA through the browser: conversation selection, draft preservation, archiving the current conversation and reopening it with its history, 12 compact tabs, a minimum width of 36x36 at a 360 px viewport, preservation of the active tab on resize, and archiving by keyboard. No real turn was sent. Formatting, syntax and 62 tests passed, including preservation of session and surfaces, last tab, invalid IDs and limits on opening/restoring.
The tabs were activated on TTY4 through the local release release-zVVLt3fb, code aa09529, under the user unit agent-native-tty4-shell-tabs.service. The installation kept OpenCode 2.1.4 and the same profile. Core ready=true, busy=false, no pending change. The 5 conversations and 43 messages, the active conversation, the custom bundle, the model and the frames stayed identical by hash after the switch and after selecting a previous conversation and returning to the original one through the UI. River PID 314875 and Chrome PID 338879 kept running; the compositor did not restart. The clock stayed published on the active output. The visual validation of the tabs and the real selection were done in the browser connected to the TTY4 core; processes and the Electron window were confirmed on the new release, without a capture of the physical composition on the monitor. The original TTY2 was reactivated at the end.
Translucent panel in the empty conversation
The protected host shows CPU, memory and subscription quota cards when the conversation has no messages and the send field is empty. The panel collapses when the user types or selects a conversation with history. A very short window also hides it to preserve the send control. The tabs keep the existing numbering, closing by archiving and reopening.
The panels use a translucent gradient background, a soft border and SVG area charts. The native wallpaper shows through the transparent Electron. backdrop-filter acts only on content of the same renderer; this text does not claim a compositor blur over other windows or the wallpaper.
SystemMetrics samples the aggregate Linux counters of CPU and MemAvailable every two seconds. CPU uses the difference between samples, and the first point is unavailable instead of an invented zero. The 60-second history stays in memory, with no personal data, no disk and no external service. The UI pauses queries and redraws when it is hidden. /api/metrics requires the same protected token of the host and is not exposed to the generated HTML.
The quota is that of the ChatGPT subscription that OpenCode uses, not an estimate of the tokens of the conversation. The local plugin agent-native-plan resolves the OAuth connection inside OpenCode, which keeps the credential renewal, and queries only the read endpoint wham/usage. Only the window duration, the remaining percentage and the renewal time cross the RPC. Access tokens, credentials and account identifiers do not reach the core or the renderer. There is a 90-second cache and a stale-read state; a missing window does not become zero. The endpoint is not public and can change: a failure or an unknown format produces an explicit unavailable state, with no paid fallback and no use of a model turn. No reset is redeemed.
The plugin API was checked against the local SDK @opencode/plugin 2.1.4 and the V2 integration example. The RPC contract includes events even when empty, which the real loader needs. The plugin check of the runtime admits only the two known local plugins and the native ones; the protection against inherited configuration was not removed.
QA: formatting, syntax, 67 Node tests and C/Cairo tests passed. The real proof returned OAuth connected and 66% of the weekly quota remaining; no five-hour window was reported and none was invented. In the browser connected to the TTY4 core, typing and deleting a draft collapsed and reopened the panel; selecting a history and returning to the empty conversation also worked, with no message sent to the model. A Wayland capture confirmed transparency, charts and quota on the real desktop. The 6 conversations, 43 messages, selection, custom interface, model and frames stayed identical by hash.
React renderer with three runtime files
The editable conversation now uses React and React DOM 19.3.1, pinned in the lockfile, with local compilation by esbuild 0.28.2. web-shell/ui-src/app.jsx, index.html and style.css are the development sources. npm run build generates only the three seed files in web-shell/ui/. The JavaScript is classic, wrapped in an IIFE, with the production dependencies embedded and the MIT licenses in the file itself. It uses no CDN, no module import at runtime, no eval, no preload and no Node in the renderer. The initial HTML and CSS are identical to those of the previous renderer.
React publishes messages, titles and navigation through portals into the existing IDs. The React root adds no layer to the layout: custom documents that keep the contract stay compatible. Until 2026-11-05 the message portals used stable hand-made articles and moveBefore ordering to preserve inline contexts during reordering. Since the adoption of Motion (openspec/specs/motion/spec.md) React owns each message article as an m.article, and keepFramesOnMove makes the #messages container move a child with moveBefore, so a reorder still keeps the inline contexts; the fallback in old engines stays insertBefore. Scroll anchors the reading position before the commit, follows new user messages and keeps the position while the user reads the history. Components unmount when the conversation changes, as before; their local state does not persist across reloads or conversation switches.
The protected host, its sending, voice, settings, tabs and recovery stay separate from the editable React. window.shell and the sandbox of the components stay the same. Inline actions still prepare drafts for review. No thumbnail feature was included.
The build changes only the seed, never the data directory. Store.init still materializes the manifest that was already saved and its two revisions. A new installation receives React; an old customized profile keeps its three files, including classic JavaScript, until an explicitly requested and validated change. There is no automatic conversion of custom JavaScript to JSX. The existing HTML and CSS can be kept when adopting the React renderer, as long as they keep the documented contract.
In the product conversation, edits still go through read_ui/replace_ui, with revision, preview, checkpoint, journal, locks and restoration. read_ui({file:"style.css"}) selects one file; read_ui({file:"app.js",applicationOnly:true}) returns an exact excerpt of the compiled application and omits the minified dependency. The result flags partial; this excerpt serves unique replacements, not overwriting the complete file. Classic profiles without the marker return their whole script. A call without arguments still returns the three complete files. The prompt explains the difference between the JSX development sources and the editable artifacts of the profile.
The app.js limit of the shell grows from 100,000 to 512,000 bytes to fit React. HTML and CSS stay at 100,000 bytes each; generated components also keep the previous JavaScript limit. The authenticated MCP transport admits up to 1,500,000 bytes, so that it can receive the old text and the replacement of the bundle in the same request. This capacity is not offered to the HTML. Validation still uses vm.Script only as a parser, and the browser preview stays mandatory.
npm run build:check, included in npm run check, recompiles in memory and compares the three artifacts, without writing them. The generated bundle stays out of automatic formatting; JSX, the source HTML/CSS and the compiler go through Prettier. The installer copies sources and compiler and runs the build before it activates the release. Source changes require a new build; there is no watcher or JSX compiler in the profile.
npm run test:ui starts a synthetic loopback harness: open the printed URL, check that all lines show PASS and DONE, and end the server after the inspection. It runs the real bundle in an opaque iframe with CSP and a nested component, without a core, account or provider. The scenarios exercise the synchronous contract, inline filter/counter/draft through DOM events, continuity during polling, prepend and reordering, text update, message origin and cleanup when switching conversations. This complements the interaction through the protected UI and does not prove physical input or performance.
Validation of the refactoring on 2026-10-26: npm ci, build, build:check, format:check and check passed. The 80 Node tests and the 5 supervisor tests passed after integration with the main that contains the external recovery. One run under load exceeded the old one-second limit of the preview helper of the test; it now waits up to 15 seconds for the checkpoint, below the 20-second timeout of the product. No recovery assertion was removed.
In the browser, the 16 scenarios of the harness finished with PASS/DONE, including navigation, draft, reordering and scroll on resize. In the protected host with a synthetic profile and a V2 transport without a provider, the UI sent requests that triggered read_ui/replace_ui: CSS, a complete replacement of app.js and a readable excerpt were activated; a revision with a throw was refused; /recovery restored the previous revision and kept the messages and the session. Automation could not direct typing/clicks to the nested iframe in the IAB; filter, counter and draft bridge were exercised through DOM events in the harness, not through physical input.
The real installer produced a release in a temporary private prefix, rebuilt the WM and installed Electron; build:check confirmed the same bundle of 231,501 bytes and only app.js, index.html and style.css in the seed. This preparation did not start a host or a compositor. Interactive Electron and the real system were not updated by this proof. The historical TTY4 no longer exists: loginctl found only the GDM/TTY2 session, with another shared host running. Activation on that target depends on explicit confirmation from the project owner, in line with the rule not to replace the validation session without a request. The compositor, applications and real profile stayed intact. Sources, logs, profiles, media and QA binaries stay outside Git.
Explicit React adoption in an existing profile
POST /api/ui/upgrade-renderer, with protected authentication and an empty body, adopts the renderer in the existing profile without replacing the HTML or CSS. It is not available to the iframes. The operation refuses a response, login, model switch or change in progress. core/renderer-upgrade.js uses the same Store.read/Store.replace as the read_ui/replace_ui tools, including preview, journal, checkpoint and rollback. Only the two known public scripts of the previous seed are recognized by SHA-256; unknown custom JavaScript needs a deliberate migration and stays intact. A React renderer that is already present is not overwritten. There is no automatic migration at startup, and restoring the previous revision stays possible without reapplication at the next restart.
The additional tests check preservation of the custom HTML/CSS and of the session, confirmation before applying, idempotence, restoration, refusal of unknown JavaScript, rollback of a refused preview and HTTP authentication. The Node suite totals 82 tests.
Activation in the default session on 2026-10-27
After the project owner confirmed the default session, the release release-react-ada5138 was activated in the existing River of the GDM 2/TTY2 session, with socket wayland-1 and profile river-shell. The external installation process held coordination.lock, persisted the plan and the rollback in the state directory and started the supervisor through the transient user unit agent-native-shell-react.service. The current link in ~/.local now points to the new release; /usr/local was not changed.
The preview of Electron itself confirmed the explicit migration of the known renderer through the protected endpoint. The journal ended in committed, with nothing pending. The hash comparison confirmed the seven conversations and 53 messages, selection, sessions, saved surfaces, model, frame preferences, custom HTML and CSS, and window associations. Only app.js was migrated to React, with the old revision available for restoration. The core returned ready=true and busy=false. No message to the provider was needed.
Browser proof connected to the real core: history rendered by React, protected sending, opening and closing of the settings, and a draft typed and removed without sending. Electron proof: host and core on the new release, with real validation of the preview in the native renderer. System proof: a direct capture with grim showed the Wayland composition, the chat and the global strip; River PID 2451 and the ChatGPT application PID 3377 kept their PID and start time. The compositor was not restarted. The capture is private, temporary and outside Git; it does not prove audio, physical shortcuts or sustained performance.
The previous fallback also needed compatibility with the larger bundle: the old 100 KB release must not receive the React manifest directly. A separate immutable copy, release-react-legacy-compatible, received only the Store and the surface validation that were already tested in this refactoring; the original old release stayed intact. The core of this copy was started with synthetic data, without an additional Electron/River and without a real provider, and the browser confirmed React loading and protected restoration in both directions, keeping the synthetic history. The supervisor policy now uses this copy as previousRelease. This preparation did not restart the default runtime and avoids depending on an old core that would refuse the new size of app.js.
Local application search with a slash
The protected field accepts / followed by the name of the application. The list queries the XDG catalog through the core, filters name and ID without distinguishing case or accents, and shows up to eight suggestions. Click or Enter opens the selection, arrows change the result and Escape clears the search. The send button gets the accessible name of opening during the search. No message is sent to OpenCode and no turn is added to the history, including when there is no match or the model is unavailable.
Since 2026-11-16 short text also suggests applications without the slash (openspec/specs/app-launcher/spec.md): one to three words that match the start of a name or of one of its words show up to three apps in a strip above the field. Enter keeps sending the message; ArrowDown or Tab moves into the strip, where Enter opens the choice and Escape goes back to the text. The catalog is fetched once, at the first text that could match.
GET /api/applications and POST /api/applications/open require host authentication. Opening accepts only an ID that is present in the catalog and reuses callDesktop/open_application with placement tile. Extra arguments are refused. The generated HTML still has no token or automatic opening channel. A result without a confirmed window appears as a dispatched request. The pick clears the /name at once (2026-11-16); a refused opening puts it back only while the field is still empty in the same conversation, so it never erases new text or the draft of another conversation.
Validation: npm ci, format:check, check and 91 Node tests passed. An HTTP test covers the authenticated catalog, refusal without a token, a nonexistent ID, extra arguments and preservation of the conversations. In the browser with a temporary core and a disabled provider, the filter, arrows, Enter, Escape, the no-results state and an explicit error without a compositor were checked. The final round also isolated the Smithay socket inherited from the environment. There was no proof of a real window opening, of an Electron update or of an installation on the shared desktop. The session found was Smithay/TTY2, different from the TTY4 described as the authorized target; the existing runtime was not replaced.
The fix 43649a9 makes any non-empty text expand the Smithay palette to a sidebar, including / queries, which gives space to the suggestions. The search stays local, with no sending to the model. This adjustment of a condition adds no proof of a real opening or of activation in the runtime.
Trusted React UI in the host document
The decision of 2026-10-27 runs the compiled React bundle of ui-src/app.jsx directly in the trusted document, mounted in an open ShadowRoot under #surface. The host provides window.shell and the reference window.shell.root; the active JavaScript comes from the build of the checkout, never from the app.js saved in the profile. The ShadowRoot separates the CSS of the conversation from the protected outer controls, and it does not claim that Shadow DOM is a security boundary.
The style.css of the profile stays editable through the read_ui/replace_ui flow, is applied inside the ShadowRoot and goes through a preview with the trusted React, journal, lock and rollback. Historical global selectors are adapted in memory to the virtual container #trusted-ui-body, without rewriting the saved file. Custom index.html and app.js stay in interface.json, in the revisions and in the UI folder for recovery, but the host ignores them and refuses edits to them with an instruction to edit ui-src and rebuild. The host shows a visible warning when these files differ from the seed. There is no automatic migration or discarding of data.
The isolation of the interactive HTML responses does not change: each response runs only in an opaque sandbox iframe, with window.surface.action to prepare a draft. CSS changes are tested in the own React UI of the host, and the preview does not run the legacy JavaScript of the profile.
QA of the trusted React UI in the host
On 2026-10-27, npm ci, build, format:check, check and npm test passed: 122 Node tests after integrating the workspaces. The headless Chrome browser harness passed 15 checks of the React UI mounted directly in a ShadowRoot, node/iframe stability during polling and reordering, text update, scrolling, surface draft, CSS isolation of the protected field and restoration of the preview CSS.
The real HTTP host was also exercised, with a temporary profile and a synthetic OpenCode fixture, without a provider or credentials. A QA message triggered replace_ui; the trusted React received the candidate CSS, the core confirmed the revision with a committed journal, and /recovery restored the previous version with another confirmed revision. The conversation and the inline surface stayed active. A second synthetic response published a surface whose script tried to write to parent.document; the opaque sandbox blocked the access and the action only prepared synthetic-inline-isolated in the protected field. The iframe existed inside the ShadowRoot and no main iframe existed in the outer document. Inspected headless capture: /tmp/agent-native-trusted-host-http.png; capture of the harness: /tmp/agent-native-trusted-harness-final.png.
This proof covers the browser over the HTTP host and the synthetic core. Electron, Smithay and the shared session were not restarted or validated in this change. This test also did not synchronize the active source in the home.
Local opening and focus presentation in Smithay
The opening bridge now delegates the placement of the window to the backend. In Smithay with requestedLayout=focus, an opening requested as tile keeps the focus presentation and asks for immersion in the application, instead of passing all surfaces through tile. Confirmation requires the correct window, visible, focused, with positive dimensions and geometryConfirmed. Another pending surface does not prove a failure of this window. Explicitly active pair and tile keep the previous confirmation. The initial identification also waits for positive dimensions before it asks for focus.
The limited error output is also captured for the applications of the catalog and for the terminal. An exit with an error before a window is mapped reports the code and the diagnostic, which preserves the distinction between dispatch and confirmed window. There is no automatic retry of the opening and no call to the model.
Verification: npm ci, format:check, check/build:check and 125 Node tests passed. The new tests exercise focus confirmation with another pending surface, a window that disappears and a real failure of a synthetic executable with code 42 and stderr. The application and the investigation of the calculator in the shared session stayed blocked by the busy coordination.lock. This revision does not prove a real graphical opening and was not activated in the runtime by these tests.
Fix for React loading in Electron
The inspection of the active session on 2026-10-27 found the message “Não foi possível carregar a interface React confiável” (Could not load the trusted React interface). The server delivered /trusted-ui.js and /trusted-ui.css, but the onBeforeRequest filter of Electron did not allow these routes. The browser validation did not go through that filter and did not reveal the failure.
The host now allows exclusively these two exact paths on the origin of the core, through a helper shared with the regression test. External URLs, suffixes and parameters do not receive this permission. The fix requires reloading the Electron main process; reloading only the document does not update the filter. The procedure keeps the compositor and the external applications, with independent supervision and rollback.
The fix 9b98044 passed npm ci, format:check, check/build:check and 141 Node tests. It was activated in the existing session through a supervised switch of the host/core only. The first attempt found a hash difference caused only by the normalization of busy:false and approval:null in the newly created conversation; removing only these defaults reproduced the previous hash exactly. The second attempt normalized only these fields in the comparison, blocked pending activity/approvals in any conversation and checked the other data in full, including state.json, interface and external windows. The external guard finished with continuity confirmed.
In the native acceptance of 2026-10-27, two captures of the Smithay composition showed the rendered React history, no loading error, and a visible aurora with bands that changed between frames. The previous presentation was restored. The compositor kept the same identity during the activation; there was no logout or new session in this operation. The warning about the preserved legacy HTML/JavaScript is distinct from the fixed error and is still expected in the profile. No turn was sent to the provider and no GPU benchmark was run.
Prompt in the workspace overview
The overview keeps the protected message field at the top and gives it focus when it opens through Super+S or when it regains window focus. The host moves the same footer into the modal dialog, preserving draft, listeners, sending and local search; on close, it returns the node to the original position. The field still belongs to the trusted host. The dashboard and the model selector stay hidden in this presentation.
Verification: npm ci, format:check, check/build:check and 148 Node tests passed. In headless Chrome with synthetic state, opening focused the field, keyboard input worked, closing and reopening preserved the draft and the 390px layout showed no horizontal overflow. Captures at 1280px and 390px were inspected outside Git. This proof uses no provider and does not prove the physical Super key.
Markdown in the chat and single user bubble
Text messages from the user and from the agent use react-markdown 10.1.0 and remark-gfm 4.0.1, embedded locally in the build. Headings, emphasis, nested and numbered lists, disabled tasks, quotes, tables, links and code render as React elements. Raw HTML stays text, URLs other than HTTP/HTTPS/mailto do not become links and images show only their description, with no remote requests. Interactive HTML components stay in the existing opaque iframe. The parser recalculates only the messages whose text changed.
The user message has only the outer bubble; the Markdown content adds no background, border or padding. The style of the agent container was preserved. Tables and code blocks have their own horizontal scrolling.
Validation on 2026-10-28: npm ci, format:check, check/build:check and 175 Node tests passed. The harness in the browser UI finished with all checks PASS/DONE, including Markdown/GFM in both roles, inert HTML/URLs/images, update of partial content, 300px width, single bubble, iframe continuity, navigation and scrolling. The visual preview was inspected in the browser. Headless runs with virtual time were unstable on old animation/hover checks; the run in the browser with real time passed. There was no turn to the provider, no Electron restart and no change to the compositor. Publishing sources and preparing for the next login do not prove activation in the host that is already open.
Fixes from the 2026-10-28 review
Cancellation passes an AbortSignal per turn to the send preparation and checks the signal between agent/model selection, session read and session update. If the prompt was already dispatched, the interruption waits for the queue confirmation before it is sent, which prevents a late prompt from starting after Parar (Stop). Responses or errors of a canceled turn do not overwrite the state of the next turn.
Profile ownership keeps flock on .instance.guard during the whole execution,
without renaming that file. A helper loses the lock when it receives EOF as the
core ends, including by SIGKILL; an unexpected loss of the helper ends the core.
.instance.lock still reports the PID to the supervisors, and a live old core
still blocks the opening of the profile.
The HTTP JSON reader accumulates bytes before it decodes UTF-8 and applies the limit to the original bytes. Accents and emoji stay intact even when a character arrives split between chunks.
The empty conversation also left the Processador (Processor), Memória (Memory)
and Plano ChatGPT (ChatGPT Plan) widgets too tall: the host document loaded the
React CSS globally, besides the copy in the ShadowRoot. The message rule
article { white-space: pre-wrap } preserved the indentation of the HTML of the
cards. The host now leaves that stylesheet only in the ShadowRoot. In the
synthetic browser at 1280x720, the three cards went from about 503px to 215px,
with no horizontal overflow. The React stylesheet stayed loaded in the
ShadowRoot.
Validation: format:check, check/build:check, 195 Node tests and 68 Python tests with an isolated environment passed. The regressions cover concurrency of six processes on the profile, recovery after SIGKILL, compatibility with a legacy PID, cancellation at each step, prompt/interruption ordering, HTTP continuity of the next turn and all splits of the bytes of text with accents and emoji. In the browser UI, Parar (Stop) during preparation did not dispatch a prompt; a new message finished and published the isolated inline surface. There was no use of a real provider, no restart of Electron and no restart of the compositor. The captures and the QA profiles stay outside Git.
Acceptance in the existing session
On 2026-10-28, the fixes from the review were activated in the existing host/core, without restarting Smithay or the applications. The external guard finished the comparison of profile and processes, including the 17 conversations and 107 messages, sessions, selection, preferences, interface and bindings. The core confirmed ready=true and a connection to the same compositor. The native Electron capture in an empty conversation showed the compact cards; the previous presentation, workspace and focus were restored. The warning about the preserved legacy HTML/JavaScript stayed visible, as the contract says, and is not a loading failure. There was no turn to the provider. See the procedure and operational evidence.
Searchable model picker (2026-10-29)
The protected host uses a model panel with search by name and ID/provider, ignoring case and accents. The terms are combined; the list has its own scrolling, a count and an empty state. The panel opens above or below the button depending on the visible space, limits width and height and follows resizing. Arrows, Home/End and Enter select; Escape closes and returns focus, and a click outside closes. The current model stays marked. The bar below the send control has a transparent background; only the open panel gets a background for readability.
Selection still uses the protected endpoint and the switch block during turns,
login and changes. Search does not query the provider or change the catalog.
model-picker.js is part of the explicit list of HTTP assets and of the
Electron policy. Since phase 6 of openspec/changes/archive/2026-11-02-heroui-migration/design.md the panel is React
with HeroUI (ui-src/host/model-picker.jsx), and model-picker.js holds its
state; React Aria places the popover, and the arrows do not wrap at the ends
of the list. Validation in the browser with a synthetic catalog of 80
models: combined search, selection, empty state, closing and focus. This proof
does not run a real model switch in OpenCode. Publishing, build and activation
of the session are distinct steps.
CSS class and variable organization (2026-10-29)
The visual contract now uses explicit classes and shared defaults in
vendor/interface/host/theme.css. Existing IDs and states stay compatible; the
profile CSS stays restricted to the ShadowRoot. The shared stylesheet is an
exact local asset, allowed by the HTTP host and by Electron. See the contract
and the configuration points. Publishing, build preparation
and activation in the runtime stay distinct steps.
The later glass material uses the shared variables for transparency, CSS blur,
borders and shadows. material-solid, reduced transparency and forced colors
provide solid surfaces. The model strip stays transparent. The contract
distinguishes the filter in the renderer from the native blur that the quick
settings already have. The compositor was not restarted for this change.
Conversation identification when opening applications (2026-10-29)
The desktop bridge recognizes the title Agent Native OS [workspace:N] issued
by the trusted host and selects the conversation of the active workspace, even
when it is collapsed. Since window layers phase 4 only the window bound to the
role chat counts (chatWindow reads the declaration); no title, the legacy
title Agent Native OS included, makes a chat. Bar,
panels, wallpaper and external windows are not candidates. The same
identification is used for the opening on the right, for the return from login
and for the focus requested by workspace navigation. Before, the literal
comparison with the legacy title prevented the launch on the right and gave the
conversation-not-found error, even though the compositor was connected.
Synthetic regressions cover workspace selection, a hidden conversation, exclusion of other surfaces, process launch with pair confirmation and return from login. This proof does not confirm a real graphical opening of Chrome. Publishing sources, build and activation in the existing core are distinct steps.
Global bottom bar (2026-10-29)
At the request of the project owner, the bar of conversations/workspaces and indicators moves to the footer. The browser UI reserves its own strip; on the desktop, Smithay reserves the bottom 40px, keeps the applications above it and places the bar in that strip. Workspace transitions clip the footer, including the sampling limits of the shaders, and the active indicator uses the top edge. The quick settings open above the bar, including the protected declaration with default legacy offsets. Custom configurations are not rewritten. See the CSS contract.
Verification: 205 Node tests, 71 Python tests in an isolated environment and 85
Rust tests with session, including the EGL tests that were ignored before,
passed. The browser showed the bar at the bottom and the 390px layouts; the
React harness checks token inheritance, a solid alternative, Markdown, surface
isolation and scrolling. These proofs do not represent activation in Electron or
in the compositor in use.
Top bar (2026-10-31)
The desktop has two web bars, each in its own Electron window that Smithay places in a reserved strip of the primary output:
- The top bar (route
/desktop-topbar, Wayland title "Agent Native Top Bar") takes the top 40px. Start: a workspace indicator (a pill for the active workspace, a dot for each other one) and CPU and memory use. Center: one date control with the date, the time and the notification bell with its badge; it opens the notification center, like the date menu of GNOME, and the grid centers it as one unit. End: the web panel launchers and the quick settings button with Wi-Fi, Bluetooth (only while it is on, like GNOME), battery, volume and a power icon. Wi-Fi on without a network shows the empty signal; a muted volume shows the muted speaker. Since HeroUI phase 9 the bell and the power icon are Gravity UI icons and Wi-Fi, Bluetooth, battery and volume are the own icons ofui-src/host/system-icons.jsx; the battery icon shows the charge in steps of 10%, and the volume icon shows the level. - The bottom bar (route
/desktop-sessions, title "Agent Native Desktop") takes the bottom 40px and holds only the workspace tabs and the new workspace button.
host.js reads data-desktop-bar: "true" is the bottom bar, "top" the top
bar and "false" the chat. Both bar modes hide the chat, the composer and the
dashboard. Only the top bar reads the system indicators (status-bar.js):
battery, radios and notifications every few seconds, the volume when the
volume revision of the bar view changes (a reading every 30 seconds covers a
missed event), the web panel launchers when the panels revision of the bar
view changes, and GET /api/metrics?view=bar every 2 seconds. A metric
without a value hides; the section hides when both have none. The clock
checks the formatted minute every 2 seconds, so it is right soon after a
suspend, and writes the page only when the minute changes, never while the
page is hidden. That view
returns only {cpu, memory} in percent from the last sample, without the plan
quota, so the bar does not start quota requests. Network speed, disk use and
temperature are not collected yet; the top bar shows CPU and memory only.
A click on CPU or RAM opens the first installed system monitor of a fixed list
of desktop IDs in status-bar.js (GNOME System Monitor, Resources, Mission
Center, KDE System Monitor, Xfce Task Manager) through the protected
POST /api/applications/open; without one, the click does nothing.
workspaceDots in host/workspace-zoom.js builds the dots from the same
open workspaces as the tabs, and the React top bar (ui-src/host/bars.jsx)
renders them; the top bar builds no hidden tabs. The active pill
has aria-current="page"; each other dot has the label "Abrir workspace N:
nome" and calls the same select request as a tab. The top bar window cannot
take the keyboard focus (focusable: false, and Smithay gives no keyboard
focus to the desktop chrome), so the dots and the launchers have no keyboard
navigation and no focus refresh. A switch in progress sets aria-disabled.
React keys the dots by workspace id, so the same buttons stay and the button
and the pill animate their widths together. The top bar does not
read the host state or the desktop events: it reads GET /api/state?view=bar
(barState in core/state-response.js) every second while it is visible.
Each answer has a signature; the next request sends it as after, and the
core answers {unchanged, signature} at once while the view is the same. No
request waits for a change. The bar view also has revisions: a counter of
the volume events of the core and a signature of the web panel launchers,
which the core reads again at most every 30 seconds. The bottom bar reads
nothing while it is hidden. That view holds the active id, the open workspaces with
their name and only the short first request that labels an unnamed one, the
flags that block a switch, and the compositor connected and capabilities.
All host windows except the lock window share the partition
agent-native-isolated, so one Chromium pool of 6 HTTP/1.1 sockets for the
core. Each event stream holds one socket for the life of its window. Only the
chat window reads /api/desktop-events; the bars hold no event stream. By
default the chat, the toasts and the volume indicator hold 3 streams; quick
settings and the notification center add one each while open, so one socket
stays free for requests. test/held-streams.test.js counts them in the
source. The chat window polls the state each 600 ms and also at the
conversation_selected desktop event, which the core publishes when a
conversation selection changes the active conversation (and again when a failed
selection restores it). The bars switch by wheel, tab or key without that
window, so the event is what paints the new conversation inside the native
slide. At run time, GET /health reports the open streams of the core in
streams: {desktop, notifications, quickSettings, volume}. The lock
window has its own partition agent-native-lock with the launch cookie, which
loads only the lock page, its styles and script, theme.css and
POST /api/lock/unlock, and grants no permission.
The wheel switches workspace over the bottom bar and over the start zone of
the top bar (the workspace dots and the metrics): one step per 50 px, at most
one step every 250 ms, through createWorkspaceWheel in
host/workspace-zoom.js. The bar glass reporter stays on the bottom bar only.
The host creates the top bar window only when the compositor reports the
topBar capability. Before it creates the window, it reads GET /host-layout
with the launch cookie until the core is connected to the compositor. An older
compositor has no top strip and would map the top bar as an application
window. Without the capability, the bottom bar keeps the indicators in their
place from before the top bar: host.js sets the layout flag of
host/bar-state.js, the React bottom bar renders #desktop-indicators at its
end with the date control (date, time and bell) last
(body.legacy-indicators), and only then host.js reads them. Without the indicators,
the bottom pill fits its tabs and stays centered; a tab narrower than 100px
shows only its number, without the close icon. The
volume and the power icon stay top bar only. Both bars can open web panels.
The default protected declarations of quick settings, the notification center
and the toasts keep their legacy places above the bottom bar (bottom-right
0/40, and 8/48 for the toasts), so an older compositor shows each panel next
to its button. While a top bar is mapped, Smithay moves these exact defaults:
quick settings drops from the top bar at the right, the notification center
under the clock at the center, and the toasts to the top center, 8px under
the top bar, like GNOME. The volume indicator stays above the bottom bar.
Verification of 2026-10-31: the Node and Rust gates passed (see the final report of the change). A synthetic core (temporary data, private D-Bus, no compositor) served both bar pages to headless Chrome at 1920 and 1366 wide, dark and light: no horizontal overflow, the top bar 32px tall, the bottom bar with the tabs only, and a dot click changed the active workspace in the core. This proof does not cover the Electron host on the real compositor or the session in use; the new compositor and host take effect at the next login.
The selector button keeps name and indicator aligned to the left, with an
explicit justify-content: flex-start to prevail over the default centered
alignment of the host buttons.
Chat hierarchy refinement (2026-10-29)
The protected field and its model/settings row now form a single glass panel. The conversation uses smaller spacing, user bubbles on the right and visually hidden role labels, kept for screen readers. The side index is more discreet at rest. The empty screen shows short guidance; the metrics stay collapsed under “Estado do sistema” (System state) and are queried only when expanded and visible. The warning about the previous profile stays accessible in Configurações (Settings) through an indicator next to the model; in recovery, it appears on the page itself. IDs, sending, drafts, approval, cancellation, recovery and isolation of the HTML responses are preserved. See classes, variables and evidence.
205 Node tests, build/check and the React harness with 45 scenarios passed. The inspection of the synthetic HTTP host included 390px width, the searchable selector, on-demand metrics queries and the publishing of an inline response through the protected sending. There was no real provider, no change to the profile in use and no Electron/Smithay restart. Publishing, build, next login and activation stay separate.
Waveforms in the voice conversation (2026-10-29)
During an explicitly activated voice session, the field and the text send control give way to waveforms measured from the microphone or from the spoken output being played. Silence keeps a discreet line, with no simulated speech animation. The Encerrar (End) button and the cancellation of the response stay available; the text draft stays preserved and returns on ending, including by error or conversation switch. Sending through the form is blocked while voice is active.
The current local recognition shows partial transcriptions above the waveforms during speech and confirms the text after the pause. The next speech clears the previous caption. The waveforms and the caption belong to the protected host, and they do not widen the permissions of the generated HTML. The incremental implementation and its limits are described below.
Original validation of the waveforms, before the partials: format:check, check/build:check and the 205 Node tests passed. A first run had a timeout in the existing preview capture test; the full repeat passed. The host in headless Chrome, with isolated synthetic engines and audio, passed at widths of 1280px and 390px: sampled waveforms, transcription above, single recognized send, preserved draft, return of the field and end of capture. The captures were inspected outside Git. This proof does not validate a physical microphone, audio in Electron or activation in the runtime.
Partial transcription during speech (2026-10-29)
The detector keeps the accumulated audio of the phrase, limited to 15 seconds, and offers a preview every 1.2 seconds of speech. The host accepts only one pending preview; new samples are discarded while it is being recognized, so requests do not pile up. The same local Whisper base recognizes the segments and the text is replaced above the waveforms. Words can change with additional context. The first text waits for the initial segment plus the inference time, with no promise of instant or word-by-word updates.
The previews use a single decoding temperature, no timestamps and up to 128 tokens. The final pass keeps the previous recognition policy. Only the final result of each segment, after a pause or the 15-second limit, is sent to the agent. Partials do not create messages, do not change the draft and do not trigger the provider. An old result is discarded when the phrase finishes, on interrupt, on conversation switch or on end. A preview error keeps the capture and the final attempt. The final pass goes ahead of a preview that is still in the queue; an inference that already started must finish.
The worker stays private, over stdio, and the existing protected endpoint
accepts only one extra boolean partial in transcribe. There is no other
service, model, microphone permission or dependency. It is incremental
transcription by accumulated windows, without a native audio streaming protocol.
Validation: format:check, check/build:check and 207 Node tests passed with serial execution. The voice tests cover composition before the pause, no partial sending, backlog discard, preview errors, final priority and late results. Headless Chrome with synthetic capture and recognition passed at widths of 1280px and 390px, which showed two partials before a single final send and preserved the draft and the ending. A speech sample synthesized by Piper was recognized by the installed Whisper, with no physical microphone or provider; inferences took about 1.7 seconds in that run. This is no guarantee of latency in real use and no proof of audio in Electron. Publishing, build, next login and activation stay distinct steps.
Browser controlled by the agent (2026-10-31)
The runtime declares a second local MCP server, playwright, with
@playwright/mcp 0.0.83 pinned in package.json. The core offers it only when
WAYLAND_DISPLAY is set and /opt/google/chrome/chrome exists; otherwise the
core log says why and the turn has no browser tools. The server runs with the
Node of Electron (ELECTRON_RUN_AS_NODE=1) and opens the system Google Chrome
in its own window through Wayland (core/browser-mcp.json, headless: false).
The runtime copies WAYLAND_DISPLAY and XDG_RUNTIME_DIR into the server
environment. The entry file core/browser-mcp.cjs removes
ELECTRON_RUN_AS_NODE and the PLAYWRIGHT_MCP_*, OPENCODE_* and
AGENT_NATIVE_* variables before it loads the server, so only the JSON file
and the command line configure it and Chrome does not inherit the OpenCode
password or the path of the config that holds the ui bridge token.
Chrome opens at the first browser tool and closes after 10 minutes without a
browser call (timeouts.idle); the next call opens it again. The prompt also
asks for playwright_browser_close at the end of a web task. With isolated,
the profile is temporary: all conversations share it while the OpenCode runtime
runs, and it goes away when the browser closes or the runtime restarts, which
also happens on a model change, a login or a recovery. The personal Chrome
profile is not used. Downloads are refused (acceptDownloads: false). The
outputs go to <profile>/browser/output, with an outputMaxSize of 100 MiB;
snapshots and screenshots there can hold page secrets, so the runtime deletes
the folder each time it starts. --no-webmcp stops pages from registering
their own tools. Action and navigation timeouts (5 s and 60 s) and the 30 s cap
of browser_wait_for keep each browser call under the 180 s turn deadline,
which browser calls do not pause. When the MCP server ends, also by SIGKILL,
Chrome exits with its debugging pipe.
The Chrome window opens on top of the conversation. The prompt asks the agent
to call arrange_windows with layout tile after the first browser call, so the
conversation and its approval prompts stay visible. Each new approval request
also raises the chat window once (see the tool approval dialog below).
Chrome reaches the network only through an egress proxy of the core
(core/browser-egress-proxy.js). A Runtime starts it only when it will
configure the playwright server (WAYLAND_DISPLAY set and Chrome present),
on 127.0.0.1 with a random port before OpenCode (a close() before OpenCode spawns stops the
proxy, removes the temporary OpenCode config and fails the start without
spawning OpenCode), and passes --proxy-server http://127.0.0.1:<port>
to the MCP server, which sets it as the launch and context proxy. Playwright then
adds <-loopback> to the Chrome bypass list, so loopback also goes through the
proxy. core/browser-mcp.cjs removes
PLAYWRIGHT_DISABLE_FORCED_CHROMIUM_PROXIED_LOOPBACK and refuses to start
without a loopback --proxy-server or with any --proxy-bypass; the refusal
names the argument that is missing or not allowed. --proxy-server,
--init-script, --config and --output-dir must each appear once, as a
separate argument: the Playwright command line takes the last of a repeated
option and accepts the --option=value form, so a second copy could replace
the checked value. If the proxy
does not start, the core logs the reason and leaves the playwright server out
of the OpenCode configuration (fail closed); the ui tools stay.
Runtime.close() stops the proxy only after OpenCode exited (or its grace and
SIGKILL ran out), because Chrome uses the proxy until its MCP server stops and
another local process could take a freed port.
The proxy handles plain HTTP requests in absolute form, CONNECT (HTTPS and
every WebSocket that Chrome opens, ws: and wss:) and WebSocket upgrades sent
over plain HTTP. It resolves the host itself with c-ares (all A and AAAA
answers, without /etc/hosts, so the thread pool of the core stays free) and
refuses with 403 and a short plain text reason when any answer is loopback,
unspecified (0.0.0.0/8, ::), private (10/8, 172.16/12, 192.168/16),
CGNAT (100.64.0.0/10), link-local (169.254/16, fe80::/10), multicast,
reserved (240/4), unique local (fc00::/7), site-local, IPv4-compatible, an
address of an interface of this computer, global IPv6 included, or an address in
the on-link network (cidr) of a non-loopback interface, so a LAN with global
IPv6 or public IPv4 addresses stays out of reach (/32 and /128 interface
prefixes add no network). The networks of the main routing table
(/proc/net/route and /proc/net/ipv6_route) are refused too, read again at
each check: a site prefix that a router advertises through fe80::1 or a VPN
network passes no fixed range. Routes shorter than /8 (IPv4) or /16 (IPv6)
are taken as the default route, because a full-tunnel VPN splits it into
0.0.0.0/1 and 128.0.0.0/1 or 2000::/3. Known limit: the public NAT
address of the router is a public address, outside every route and interface
network, so the proxy cannot tell it from a web site and does not refuse it.
IPv4-mapped
(::ffff:0:0/96) and NAT64 (64:ff9b::/96) forms are checked as their IPv4
address, and 6to4 (2002::/16) and Teredo (2001::/32, server and client)
forms are refused when the IPv4 address inside them is refused. The proxy then
connects to the exact address that it checked, with no
second resolution, so a DNS rebinding answer cannot replace it. A redirect is a
new request from Chrome and gets the same check, and localhost., decimal or
hexadecimal IPv4 and names of LAN hosts resolve before the check. The proxy
limits connections (256), header size (16 KiB) and idle time (120 s), and it
logs no URLs. Other local programs can also use the proxy port, but it reaches
only public addresses.
network.blockedOrigins stays as a second layer. It blocks, by URL,
localhost, localhost. and their subdomains, 0.0.0.0/8, 127.0.0.0/8,
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, [::],
[::1], [::ffff:*], fe80::/10 and fc00::/7, on any port and also with
userinfo (http://user@127.0.0.1/ reached loopback before the *@ entries).
Chrome rewrites decimal, hex and trailing-dot IPv4 forms to the dotted form, so
they are blocked too. The option compares the URL, not the resolved IP, through
Playwright routes, which do not intercept WebSocket or redirects; prefixes such
as 10.* also block names that start with 10.. DNS names of private hosts,
redirects and WebSocket are left to the proxy. Playwright refuses only the
file: protocol: view-source:file:///etc/hostname opened the file in headless
Chrome through browser-mcp.cjs (2026-10-31). So core/browser-mcp-filter.cjs
reads the JSON-RPC requests of the MCP server on its stdin and answers
browser_navigate and browser_tabs itself, with an error result, when the
url parses with a protocol other than http: or https: (view-source:,
file:, chrome:, devtools:, data:, javascript: and others). An address
that does not parse passes, because Playwright puts https:// (or http:// for
localhost) before it. After the fix the same probe got the error for
view-source:, file:, chrome:, data: and javascript: addresses, also in
upper case or with a leading space, and example.com/x still opened as
https://example.com/x.
The filter also removes the client roots capability from initialize, and
browser-mcp.cjs changes its directory to --output-dir (required, absolute).
A file name in a tool call (browser_snapshot, browser_evaluate and others)
resolves against that workspace root, so page-written files stay in
<profile>/browser/output, which the runtime removes at each start.
browser-mcp.cjs also removes XDG_CONFIG_HOME and every variable whose value
holds the OpenCode temporary directory (OPENCODE_CONFIG_DIR,
OPENCODE_TEST_HOME), which holds the config with the ui bridge token.
WebRTC UDP does not go through an HTTP proxy: without a guard, a page in
headless Chrome 156 sent STUN packets to a UDP port on 127.0.0.1. Two layers
close it, and browser-mcp.cjs refuses to start without either one:
- The browser-level switch
--webrtc-ip-handling-policy=disable_non_proxied_udp(no system policy file). The Playwright MCP command line has no option for Chrome arguments, sobrowser-mcp.cjsremoves the switch from its command line and adds it tolaunchOptions.argsof a copy ofbrowser-mcp.json. The copy is unlinked at once and read through/proc/self/fd, so nothing stays on disk. With only this switch, every frame could create a peer connection, but no UDP packet left Chrome.--force-webrtc-ip-handling-policyand--enforce-webrtc-ip-permission-checkhad no effect in Chrome 156. - The init script
core/browser-webrtc-guard.js, passed with--init-script. Playwright adds it to the browser context, and Chrome runs it in every frame before page scripts. It redefinesRTCPeerConnection,webkitRTCPeerConnection,RTCDataChannelandRTCIceCandidateas non-writable, non-configurableundefinedproperties, so a page cannot delete, assign or redefine them. This layer is page JavaScript.
isolated stays unchanged. WebTransport and QUIC need no extra control while
the proxy is set: Chrome sent no UDP packet for them (see the validation below).
Only the shell agent receives the playwright_browser_* tools. A deny rule
removes playwright_browser_run_code_unsafe, which runs arbitrary JavaScript in
the MCP server process; 24 tools remain. browser_evaluate stays available and
runs JavaScript in the page only, so it can read what the page holds, including
typed passwords and local storage. The prompt tells the agent to read
playwright_browser_snapshot before it acts, treats page content as untrusted
data and forbids typing, reading back or extracting passwords, payment data or
other secrets; the user types these in the window. A secret that the user types
can show in snapshots and outputs that the agent reads. open_application stays
the path to open the browser of the user.
Because pages can carry injected instructions, ask rules make
ui_execute_command, ui_open_application, ui_open_path and memory_add_note
wait for the approval of the user in the host on every call. OpenCode 2.1.4 does
not apply ask rules to plugin tools, so the local memory plugin
(core/memory-plugin/index.js) hooks execute.before and calls
permission.assert before memory_add_note, with the note in
metadata.input. The same
hook records each session that calls a playwright_* tool in
<profile>/browser/sessions.json (0600). The core and the plugin both add marks through markBrowserSession, which holds an exclusive flock on sessions.json.lock (0600) while it reads the file, adds the id, writes a temporary file and renames it over sessions.json, so two marks at the same moment cannot lose one. The kernel releases the lock when the writer dies. A mark that is already in the file needs no lock, because marks are only added. In those sessions, memory_read,
memory_search, memory_list, ui_schedule_list, ui_command_status,
memory_inspect (its Files list names notes and summaries),
ui_list_directory, ui_system_context, ui_desktop_state,
ui_read_window_text and ui_read_wallpaper_theme (the wallpaper path can
name personal folders) assert browser_private_read, with the call arguments
in metadata.input, which also asks the user. The host shows that action as
"Ler dados privados depois de navegar" and lists the read tool under
recursos. A read that runs in the same step as a browser call waits for the
mark of that call. ui_change_status (journal and proposal state) and
ui_list_applications (desktop entries) stay free. Window titles hold names
of files, pages and messages: open_application, open_path, window_action
and arrange_windows return the windows without titles, and only
desktop_state, a private read, lists them. The agent's Chrome window shows
the title of its page, so in desktop_state every window whose process runs
below the OpenCode process of the core (/proc/<pid>/stat) has the fixed
title "Navegador do agente". A read_window_text call on that window adds the
session to sessions.json before it reads the text. Data the
agent read before its first browser call stays in the context. The memory
discovery leaves recorded browser sessions out, so automatic extraction never
turns page text into lasting memory. The upstream memory plugin adds the memory
summary to the system prompt of each model request (session.hook("context")).
scopedMemoryContext runs that hook and then removes the block it added when
the session is in sessions.json, or when the file cannot be read; sessions
that never used the browser keep the summary. A damaged sessions.json fails
closed: a private read asks in every session, a browser call fails and the
error names the file. replace_ui and the theme tools stay allowed: they change
only style.css through preview, journal and recovery, and run no code.
OpenCode registers and connects the MCP servers in the background and builds
each model request from the servers connected at that moment. A turn sent while
the browser server still starts gets no browser tools. So the core waits up to
15 seconds in total for the configured servers to leave pending before it
declares the connection ready, with a 1 s limit on each status read. A read
that runs out of time counts as one more read; another error fails the start,
and so does a wait in which no read answered, because the check for inherited
servers needs one answer. A pending, failed or
missing playwright server removes only its own tools (the runtime configures
it only with a Wayland socket, Chrome and a running egress proxy); the ui tools stay in
the turn and the core log names the server and its state.
Validation on 2026-10-31, with no real provider: a core isolated by
testEnvironment, with a temporary data directory, OpenCode 2.1.4 and a local
simulated model through OPENCODE_MODELS_PATH, received a turn right after it
became ready. Before the wait, the model request carried only the ui and memory
tools; after it, the request also carried the 24 playwright_browser_* tools. In
that core, each tool with ask raised the approval request in the host state; a
refusal cancelled the turn without running the command or saving the note, and
an approval ran both. The host page opened in a browser showed "Permitir uma
vez" and "Recusar" for ui_execute_command; "Recusar" cancelled the turn
without running the command. That check showed only the buttons; the approval
dialog below replaces them. With the browser server set to a missing
executable, the ui tools stayed in the turn.
The same core, given the socket of a private headless GNOME Shell, ran
playwright_browser_navigate through OpenCode: Chrome 156 started without
--headless, with --ozone-platform=wayland, the private WAYLAND_DISPLAY and
XDG_RUNTIME_DIR, and no OPENCODE_*, AGENT_NATIVE_* or
ELECTRON_RUN_AS_NODE variable. An earlier run of the server on that compositor
showed an xdg_toplevel window. ui_system_context ran without a prompt before
the navigation; after it, memory_list and ui_system_context each asked, the
approval ran memory_list and the refusal cancelled the turn. Chrome exited when
the core stopped. Directly against the server: localhost., a.localhost.,
user@127.0.0.1, 2130706433, 0x7f.1, 127.0.0.1. and [::ffff:127.0.0.1]
failed with ERR_BLOCKED_BY_CLIENT; a download link saved nothing (the same
page with downloads allowed saved the file); Chrome closed after an idle timeout
of 4 s in a test config and opened again on the next call; and Chrome exited
after a SIGKILL of the server. Not exercised: the window on Smithay, a turn with
a real provider, the Electron host and the next login.
Tool approval dialog (2026-10-31)
The host shows each permission request in a modal <dialog> of the protected
host document, in the top layer and outside the ShadowRoot: the action, the tool
name, the conversation and the full arguments as plain text, with "1 de N
pedidos pendentes" when more approvals of any kind wait. The core keeps the queue in the conversation
field approval and /api/approve answers the id that the user sees. Profile
CSS cannot cover or restyle the dialog. A new request raises the chat window
once. The schedule and theme approvals use modal dialogs with the same rules,
and only one approval dialog is open at a time. See self-maintenance.md.
Headless check with a hostile profile style.css, from web-shell:
node scripts/test-approval-browser.js [screenshot directory]. It uses
ANOS_CHROMIUM, the Playwright Chromium build or the installed Google Chrome,
headless with a temporary profile. Screenshots are QA media: keep them out of the
repository. npm test runs it through test/approval-browser.test.js.
Egress proxy validation on 2026-10-31: unit tests cover the classifier, a name
that resolves to 127.0.0.1 through an injected resolver, a redirect target,
CONNECT and WebSocket upgrade refusals, and an allowed target on an injected
address. Headless Chrome, started by playwright-core with the proxy options
that the MCP command line sets, loaded the allowed page and got 403 from the
proxy for http://localhost.:<port>/, localhost, 127.0.0.1, [::1] and a
redirect to 127.0.0.1; WebSocket and fetch to loopback did not reach the
local server, and https://example.com/ loaded through CONNECT. Not
exercised: headed Chrome on Smithay through the MCP server and a turn with a
real provider.
WebRTC guard validation on 2026-10-31: browser-mcp.cjs, started with the
command line from withBrowserEgress and --headless, opened a page that tried
WebRTC to a STUN server on a local UDP port from the top frame, a same-origin
iframe, about:blank iframes used synchronously (also inside a nested frame),
srcdoc, blob: and data: iframes (with their own scripts) and a
window.open("") popup. No frame found a constructor, delete, assignment and
defineProperty did not restore it, and the UDP port received 0 packets. The
same page without the guard created every peer connection and sent 32 packets.
Workers expose RTCDataChannel but not RTCPeerConnection. Not exercised:
headed Chrome on Smithay.
Browser-level WebRTC switch, 2026-10-31: with the guard off and the proxy set, a
STUN attempt sent 4 packets with no switch,
--force-webrtc-ip-handling-policy=disable_non_proxied_udp and
--enforce-webrtc-ip-permission-check, and 0 packets with
--webrtc-ip-handling-policy=disable_non_proxied_udp. With that switch alone,
the frame matrix above sent 0 packets (33 without it). The Chrome processes
under the real browser-mcp.cjs received the switch, --proxy-server and
--proxy-bypass-list=<-loopback>.
WebTransport and QUIC probe, 2026-10-31: a page served over HTTPS (synthetic
self-signed certificate, --ignore-https-errors) opened
new WebTransport("https://127.0.0.1:<udp port>/") and the same with
localhost, and fetched four times from a server that sent
Alt-Svc: h3=":<udp port>", h3="127.0.0.1:<udp port>". Through the real
browser-mcp.cjs and through playwright-core with the proxy, the UDP
listeners received 0 packets and the WebTransport handshakes failed. Without the
proxy, the WebTransport attempt sent 12 packets to 127.0.0.1; the Alt-Svc
fetches sent none even without the proxy, so that probe shows no QUIC use but
does not prove that a valid certificate would not trigger it.
Manual control of windows (2026-10-31)
The protected host can mark a window as held by the user. desktop_state reports
userHeld, and window_action and open_application refuse as described in
docs/architecture-decisions.md (manual control handoff). arrange_windows
skips held windows of the active workspace: when the compositor reports
capabilities.layoutExclude: true, the core calls arrangeWindows("tile", ids),
which sends the typed Smithay command
{"action":"layout","layout":"tile","exclude":[...]}. The result adds
arranged (the IDs of the application windows of the active workspace on the
primary output that the layout placed), skipped (the held IDs) and, when a
window was skipped, a note that tells the agent not to act on it. Without the
capability the tool refuses as before. The profile keeps the record in
manual-control.json. Publishing, build, next login and activation stay
distinct steps.
Moving a window to another monitor (2026-10-31)
window_action has the action send_to_output with output set to primary,
secondary (the first output after the primary one) or an output name from
desktop_state outputs, such as HDMI-A-1. The core sends the typed Smithay command
{"action":"send_to_output","window_id":N,"output":...} and confirms the move by
the output role of the window in the state the compositor returns, or by its
outputName when the request named an output. The core refuses a name that is not
in the current state. output is
accepted only with that action, and that action needs it. The rules of the other
window actions apply: a held window (userHeld) is refused before any command,
shell windows are protected, a primary window of another workspace is refused,
and the compositor refuses every window command while the session is locked.
The compositor also refuses secondary when no second monitor is connected.
desktop_state reports the name and role of each output and the output and
outputName of each window. Proof: test/desktop.test.js, test/manual-control.test.js and
test/smithay.test.js with a fake compositor socket. Not proven here: a real
second monitor.
Grid actions of window_action (2026-10-31)
Phase 4 of the tiling specification. window_action has three
more actions for the cell grid:
placewithcells: {col, row, width, height}puts the window on those cells of its grid. The core checks the cells against thegridsize of the state. Free cells: the window takes them. Cells of exactly one other window that fits in the cells this window leaves: the two swap, and the other window keeps its size. Anything else is refused, and nothing moves. A floating window returns to the grid on these cells.toggle_floatingtakes the window out of the grid at the geometry it shows, or returns a floating window to the grid as a new window (Super+Shift+Space).fill_gridarranges the grid of that window evenly (Super+G): its workspace, or its secondary output.
cells is accepted only with place, and place needs it. The core sends the
typed Smithay commands {"action":"place","window_id":N,"cells":{...},"held":[...]},
{"action":"toggle_floating","window_id":N,"held":[...]} and
{"action":"fill_grid","window_id":N,"held":[...]} through Smithay.gridAction, and confirms
place by the cells and toggle_floating by the floating flag of the window
in the state the compositor returns.
Refusals, before any command: a held window (userHeld); a held window in the
target cells of place, because a swap would move it; any held window on the grid
of the target (the same workspace on the primary output, or the same secondary
output, which every workspace shares) for fill_grid and for a toggle_floating
back to the grid (arrange_windows skips held windows instead); shell windows
such as the chat, dialogs and dialogs of shell windows (gridTargetRefusal in
core/grid.js); a primary window of another workspace; a locked session; a
compositor without capabilities.grid: true. Each command also carries held,
the IDs of every held window, so the compositor keeps their cells on every grid.
The compositor refuses again: shell windows, dialogs, minimized windows, a window
outside the grid layout, cells outside the grid or smaller than the 2x2 minimum of
the chat, and every grid command while the session is locked. The generated HTML gets none of these actions: they exist only in the
authenticated MCP tool. Proof: test/desktop.test.js and test/smithay.test.js
with a fake compositor socket. Not proven here: a real compositor session.
Reading application text with AT-SPI (2026-10-31)
The authenticated agent has one more narrow tool, read_window_text. It reads
the accessible text of one live window through AT-SPI (Assistive Technology
Service Provider Interface): roles, names, text content and numeric values. It is
read-only. It does not click, type, focus or set a value, and it does not change
the rule that the agent has no mouse or keyboard automation. The generated HTML
does not receive the tool.
Consent. The user allows each window in the protected host: Settings, section
"Leitura de conteúdo dos aplicativos", button "Permitir leitura". The host sends
POST /api/window-reading with {window, allow} and the CSRF (cross-site
request forgery) token, which the generated HTML does not have. The state of the
core lists the allowed window IDs in windowReading. The consent lives in
memory only. It belongs to one window identifier, which includes the compositor
session, so it ends when the window closes, when the process of the window
changes, when the compositor restarts and when the core restarts. The user can
revoke it at any time, also while a read runs: the content is then discarded.
Without consent, the tool returns a refusal (consent_required) that tells the
agent where the user can allow it. The tool does not touch AT-SPI before consent.
The shell window itself is always refused.
Mapping. The compositor reports the process ID of each Wayland client. The core
asks the helper for the AT-SPI applications with that process ID. It reads a
window only when the result is certain: exactly one application, and exactly
one top-level window whose name equals the window title (or the only top-level
window of the only window of that process). Otherwise it refuses with
mapping_uncertain or application_not_found and reads nothing. Sandboxed
applications that appear with another process ID are not found.
Limits. Password fields (role password text or state protected) are never
read: the helper does not request their name, text or children, and the core
omits them again. The output is an indented outline of at most 2000 nodes and
32 KiB, with truncated and truncation (nodes, bytes, depth, text).
Each field is cut at 2048 characters. The result carries a notice that the
content is untrusted data, not instructions. If the accessibility bus (at-spi2)
or the client libraries (python3-gi, gir1.2-atspi-2.0) are missing, the tool
returns accessibility_unavailable with the reason.
Implementation. web-shell/core/window-text.js holds the tool, the consent
store, the mapping and the outline. web-shell/core/accessibility-reader.py is
the helper. The core starts it once per request (/usr/bin/python3, then
python3), with a time limit. The helper checks the accessibility bus before it
loads libatspi, because libatspi aborts the process when the bus is unreachable.
Scope of the guarantee. The consent gates read_window_text. It is not a
sandbox against other agent tools: execute_command runs as the user and could
start its own AT-SPI client, as openspec/specs/self-maintenance/spec.md already states for
maintenance.
Validation. window-text.test.js uses a fake accessibility tree and a fake
desktop state: consent, refusal, revoke, window close, password skip, node and
byte limits, unsure mapping, unavailable service and a revoke during a read.
window-reading-http.test.js checks that only the protected host can change
consent. window-text-atspi.test.js starts a private session bus, a private
AT-SPI bus, a private Broadway display and one synthetic GTK 3 window, and reads
it through the real helper. It skips when dbus-daemon, broadwayd,
/usr/libexec/at-spi-bus-launcher or python3-gi with GTK 3 and Atspi are
missing. No test reads a real window. Not proven: Electron host rendering of the
new settings section, a real Smithay session with real applications, Wayland
(not Broadway) toolkits, Chromium or Qt applications, and the pt-BR copy in a
browser.
Memory policy for idle applications (2026-10-31)
Applications of old conversations stay open until memory is short. The core proposes closing them; the user decides. Implementation: web-shell/core/memory-policy.js.
- Low memory. The core reads
/proc/meminfoevery 5 s. Memory is low whenMemAvailableis below 15% ofMemTotal. The notice starts after 60 s in a row below that line. One sample at or above the line, or an unreadable sample, restarts the count. The constants areLOW_MEMORY_FRACTION,LOW_MEMORY_HOLD_MS,DISMISS_MS,SAMPLE_INTERVAL_MSandMAX_CANDIDATES, covered bytest/memory-policy.test.js. - Candidates. At most 8 windows, ordered by the conversation that was not open for the longest time. The core records
lastOpenedAton the conversation when the user leaves it or enters it (markOpened, called byWorkspaceNavigation.selectConversation); without it,createdAtcounts. A window is never proposed when it is a shell window, a child window (dialog), in the active workspace, held by the user (userHeldfromDesktopClient.publicState(), stored inmanual-control.json; see Manual control of windows), owned by no known conversation, or owned by a conversation that is working or waits for an approval. - Memory per application. The compositor reports the client
pidof each window. The core adds the resident set size (/proc/<pid>/statm) of that process and its descendants (at most 512). Pages shared between processes count more than once, so the figure is an estimate. Windows of one process show the same figure and carrysharesProcess. A process that cannot be read shows "memory not measured". - Notice.
/api/statecarriesmemoryNotice(null when there is nothing to show). The protected host draws the notice (#memory-notice) with one "Fechar" button per window and a "Dispensar por 10 minutos" button. The trusted React state and generated HTML never receivememoryNotice. - Approval.
POST /api/memory/closetakes exactly{windowId, identifier}. The core checks the pair against the live candidate list, accepts one request at a time, then sends one normal close request throughDesktopClient.command(..., {crossWorkspace: true}). That option works only forclose. The core never sends SIGTERM or SIGKILL. An application that asks to save keeps the window open; the host then reports that the window is still open. The Smithayclosecommand accepts windows of inactive workspaces for this path. - Dismissal.
POST /api/memory/dismiss(empty body) silences the host notice and the agent note for 10 minutes. The state is in memory only; a core restart resets it. - Agent.
desktop_stateandsystem_contextaddmemoryNotice: {lowMemory, availablePercent, note}while the notice is active. It carries no window titles. No agent tool closes windows for this policy, andwindow_actionhas no close action.
Proof in the repository: unit tests with synthetic meminfo samples, a synthetic /proc tree and a fake desktop state (test/memory-policy.test.js), and a synthetic core with a fake compositor socket (npm run test:memory, optional --api for the HTTP checks). The fixture sets AGENT_NATIVE_MEMORY_HOLD_MS=5000, so the notice needs 5 s of low memory instead of 60 s. The core reads that variable only when it is set and accepts 1000 ms up to the 60 s default; the production launchers never set it. Not proven here: Electron, the live Smithay session and real applications that ask to save before they close.