Skip to content

docs: correct who can type into the Terminal and how Linux hosts it - #340

Merged
ymote merged 1 commit into
mainfrom
docs/errata-terminal-run-cpu-copy
Oct 5, 2026
Merged

ymote merged 1 commit into
mainfrom
docs/errata-terminal-run-cpu-copy

Conversation

@ymote

@ymote ymote commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

What

This corrects four statements in the docs, in English and Chinese. I found them while re-checking the code issues listed in #333.

Where It said It now says
docs/architecture.md, "Where the code and the ADRs disagree", item 11 (from #333) The in-process Terminal still offers run, so the AI pane can type into it. Only the system agent's terminal.run checks the sandbox.
The AI pane can use a process Terminal's own run whether or not the Terminal's sandbox applied. In developer mode, the host-tool relay grants terminal.run to every covered app agent without that check. On Windows there is no sandbox, so both paths reach an unsandboxed Terminal.
The in-process Terminal is read-only on the bus, as the ADR says.
The same list, item 8 (from #333) terminal.run is never offered on Windows. That holds for the system agent only. Other callers are covered in item 11.
README.md, "Zero-copy frames for process apps" (from #331) Linux with OpenGL can only copy frames, so every app runs inside the shell there. On Linux the shell starts the Terminal as a process only in a Vulkan build in a Wayland session. Task has no module, so it is a process either way. Its frames are copied only where the GL driver cannot export a DMA_BUF.
desktop/README.md, the app-terminal row The row had six errors:
- in either hosting the assistant may type a command;
- the command is confirmed on the assistant's card;
- a command too long for the card is refused;
- the app is built with cargo run;
- it runs in-process "as on phones";
- release packages are waiting on #94.
The AI pane reads the Terminal in either hosting, but types only into a process Terminal. Outside developer mode, each command waits for a host sheet. The limit is 4 KiB. The shell builds the Terminal with cargo build and starts it itself. Phone builds don't link it. Release packages ship only octosense and the kernel (#94 closed unmerged).

Evidence

At a287d530 and the Makepad pin c155f61d.

  • The in-process Terminal is read-only on the bus.
    • At creation, the shell reads the manifest of the module's own executor (crates/shell/src/module_host.rs:573). That is Makepad's read_only_manifest (apps/terminal/src/module.rs:80).
    • The read happens before host_executor swaps the executor (:608). The instance keeps this manifest (:616).
    • crates/shell/src/lib.rs:2590 and :2611 register it. Replays and re-announcements reuse it.
    • The pane's engine refuses any tool the manifest doesn't declare (Makepad libs/ai/services/src/engine/core.rs:551-553). AiBus::shell_call filters by the same manifest.
  • The sandbox check.
    • Windows process apps run unsandboxed (crates/shell/src/sandbox/mod.rs:493).
    • The Terminal process registers its full manifest, run included (Makepad apps/terminal/src/main.rs:379).
    • Only system_chat/grants.rs:205 and shell/menu.rs:879 read the sandbox state. ai_bus.rs and host_tools/relay.rs don't.
    • In developer mode, Catalog::may_call (host_tools/relay.rs:354-360) grants every shareable tool except the toolbox's.
  • Release packages have no AI pane.
    • They ship no aichat binary (desktop/packaging/release.json).
    • They don't build the app-aichat feature.
    • So opening the pane says "Assistant unavailable" (crates/shell/src/lib.rs:2343-2344).
  • Frames on Linux.
    • With OpenGL, Makepad exports each frame as a DMA_BUF through eglExportDMABUFImageMESA (platform/src/os/linux/x11/opengl_x11.rs:30-115). It falls back to a software readback only when that fails (platform/src/os/shared_framebuf.rs:437-466).
    • The shell starts the Terminal as a process only when vulkan_wayland() holds (crates/shell/src/apps.rs).
    • AppRegistry::hosting applies process-if-vulkan only to linked modules, and Task's entry has "module": null.
  • The app-terminal row.

Not in this PR

Verification

  • A link check of the six files, using GitHub's slug rules, finds no broken link or anchor.
  • Table rows keep their pipe counts. No raw tags remain outside code, and backticks are balanced.
  • git diff --check is clean.
  • python3 -m unittest discover -s rom/tests -p test_no_local_paths.py passes.
  • Before commit, an independent reviewer checked each changed sentence against the code and the Makepad pin. I verified each of its corrections and applied them:
  • No command was added or changed.

🤖 Generated with Claude Code

- architecture.md item 11 said the in-process Terminal still offers
  `run` to the AI pane. It doesn't: the shell announces the module's
  read-only manifest, and the pane and `AiBus::shell_call` call only
  declared tools. The real gap is that only the system agent's
  `terminal.run` checks `sandbox::launch_sandboxed`. A process
  Terminal offers the AI pane its own `run` either way, and developer
  mode grants `terminal.run` to every covered app agent. On Windows
  there is no sandbox.
- architecture.md item 8 said `terminal.run` is never offered on
  Windows. That holds for the system agent only.
- README: OpenGL does not mean a CPU copy. Makepad exports DMA_BUFs
  through EGL and copies only when that fails. The shell runs the
  Terminal as a process on Linux only in a Vulkan build in a Wayland
  session. Task, with no module, is a process either way.
- desktop/README app-terminal row:
  - the AI pane types only into a process Terminal;
  - outside developer mode it waits for a host sheet;
  - the limit is 4 KiB;
  - the shell uses `cargo build`, not `cargo run`;
  - phone builds don't link the Terminal;
  - #94 closed unmerged.

English and Chinese change together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymote
ymote merged commit ef3ce91 into main Oct 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant