Repository navigation
ADR 0004: system chat in the shell, and the command-execution switch [skip ci] - #132
Merged
Merged
Conversation
…ystem_agent_tools_in_effect) [skip ci] Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…witch (ADR 0004 §6, §8, §12) [skip ci] - crates/shell/src/system_chat/: a pane (Setup > Assistant > Assistant chat, F8; full screen on narrow screens and phones) on _main:api:octosense#system over the shell's own kernel connection: streamed text, tool calls with status, questions, interrupt, new conversation, history via session/hydrate, reconnect-and-resume after a kernel restart. Approvals go to the approval router batched per request (syschat: ids); the pane never approves. - Setup > Assistant > Command execution: off by default, on only with the typed confirmation (CommandGesture), terminal.run joins the system agent's set from the next kernel start with a restart offered; each command is an auto_approvable:false router request; developer mode still answers it. - Kernel README (en, zh-CN) and ADR 0004 follow-ups updated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 29, 2026
chrislearn
pushed a commit
to chrislearn/OctoSense
that referenced
this pull request
Sep 29, 2026
Factual corrections checked against main baa90bd and octos acffad3b: octos#2567 and OctoSense-org#106 are merged; the pin is acffad3b; generic_tools is an exact list and omitting it keeps the whole roster (ask_user_question and shell included), so octos's shell is kept out only by the _main tool_policy (OctoSense-org#117); the peer link method is octos.session.open. architecture.md and ai-services.md now reflect the system chat (OctoSense-org#132), the peer link's shell side, the macOS sandbox and the Restart tile (OctoSense-org#130), and the host-tool relay (OctoSense-org#145). ADRs 0002 and 0003 get dated amendment notes for OctoSense-org#117. The system_tools.rs module doc no longer says the command-execution switch does not exist. Records two decisions of 2026-09-29 in ADR 0004: host.ask is dropped for octos's ask_user_question routed by the shell (G11), and terminal.run is process-only (G12). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two ADR 0004 follow-ups: a chat with the system agent inside the shell, and the Settings switch for the system agent's command execution.
1. System chat (
crates/shell/src/system_chat/)--test-action system-chatandsystem-chat-send:<text>open it in hidden-window runs._main:api:octosense#system(the kernel'sSYSTEM_SESSION). It connects over the shell's own kernel connection,octosense_ai_host::kernel::connect(). That is stdio, or the host-token WebSocket while Talk to Octos is on. It never starts a second kernel and never uses an external token. It connects when the pane opens and lets go when the pane closes, unless a turn is still running, so the kernel can still stop when idle.message/delta, and v2projection/envelopedeltas and saved text)tool/started,tool/progress,tool/completed)user_question/respond)turn/interrupt) and New conversation (the kernel's/new, which does not call the model)session/hydrate, falling back tosession/messages_pageapproval/requestedgoes to the ADR 0004 §8/§4: approval router, standing rules, shell sheets, first-use consent #120 router as a system-agent call, with idsyschat:<approval id>. Approvals from one turn go on one shell sheet, and the turn's prompt is the plan. The chat sendsapproval/respondonly with the router's decision (approvals::take_system_chat_decisions). The pane only shows the approval's status.2. Setup › Assistant › Command execution (
system_chat/grants.rs)PersonGesture: onlyCommandGesture::settings_phrasemakes the gesture, and a test checks that only lib.rs's Settings handler calls it. The row shows what turning it on risks. Turning it off never needs a gesture.SystemAgentTools::grant_command_execution(true)addsterminal.runto the system agent's host tools. It never adds octos's shell.ToolSpec::command()(auto_approvable: false), so no rule, not even "everything for 60 min", can approve it. A live sheet shows the exact command. Developer mode still approves it (§13).system_tools::set_grants,grants_at_startandsystem_agent_tools_in_effect()incrates/kernelhandle this. After a change the menu shows "Restart the assistant to apply" with a restart row (kernel::restart()), or "Applies when the assistant starts" if no kernel is running.<home>/assistant/system-agent.json(0600).terminal.runon the system session needs octos#2567's per-session host tools. Until then the grant is recorded but the kernel does not offer the tool, andgrants::request_commandis the path each call will take.Seams touched outside the new modules
crates/kernel:system_tools.rs(grant store and start snapshot),launch.rs(one call inprepare),lib.rs(system_agent_tools_in_effect). The README (en and zh-CN) now says command execution is done as a Settings grant, and that its host-tool registration waits on octos#2567.crates/shell/build.rs: akernelcfg, matching the one ai-host's build.rs sets.crates/shell/src/approvals/mod.rs: routessyschat:decisions to the chat.approvals/tests.rs: the gesture scan allowssystem_chat/tests.rs.crates/shell/src/lib.rsandshell/menu.rs: the widget, F8, pointer and keyboard routing, and the Setup › Assistant rows.octosense_ai_host::kernelre-export was enough.Tests
system_chat::tests, against a scripted kernel link: streaming assembly (legacy and v2), tool-call status, questions, interrupt, history load, new conversation, reconnect and resume after a restart, no provider and no kernel, closing the pane releases the connection, approvals answered only with the router's decision, batching into one sheet.CommandGesture.a_start_takes_the_grants_of_that_moment.a_system_agent_turn_from_the_pane_on_a_real_kernelruns withOCTOS_CORE_TEST_KERNELand the scriptedmock_llm.py. It drives the pane's driver through a turn, a kernel restart, resume, and a second turn. It passed locally with an octos 2.0.3-rc.13 build; without the variable it skips.setup_assistant_offers_the_chat_and_the_command_switch.MAKEPAD_HIDE_WINDOWS=1 MAKEPAD_REMOTE, temporary home, no provider): the pane opened with the no-provider state and the Open AI providers button. F8 and typing filled the prompt. Setup › Assistant › Command execution showed the risk row and Allow; typing the phrase and choosing Allow saved the grant and showed "Command execution is on … Restart the assistant to apply". The runs ended with/gq. I checked the grabs.Local checks run
cargo checkfor desktop (default andmobile-apps) and phone (mobile-apps);cargo test -p octosense-shell --libfor desktop (default andmobile-apps) and phone;cargo test -p octosense-kernel;tools/check-shell-graph.shfor both shells;tools/setup.py --check --cargo;tools/native_apps.py --check;rom/tests/test_no_local_paths.py.Still to do
terminal.runregistration and execution wait on octos#2567.🤖 Generated with Claude Code