Skip to content

refactor(cli): server sessions build their tools through the tool roster (#420, 2/3) - #426

Merged
ajianaz merged 1 commit into
developfrom
refactor/roster-session-host
Oct 26, 2026
Merged

ajianaz merged 1 commit into
developfrom
refactor/roster-session-host

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

What

session_host::open_session (used by tole serve, tole acp and the MCP session tools) now builds its registry with tool_roster::build, the same module the CLI and MCP-server faces use since #421. Part 2 of 3 of #420.

Why

open_session was the third copy of the per-tool registration rules and had drifted from the CLI: no verify_package, a binary probe that accepted non-executable files, no sibling tracking or handoff tool for children, and agent-tool registration errors silently ignored.

Changes

  • session_host.rs: the ~95-line registration block becomes a Roster (workspace = session cwd for files and shell tools, plan mode, child agents without worktrees, the ACP plan emitter) passed to tool_roster::build. tole_cli_binary_available is removed (the roster's executable-only probe replaces it). Turn-end hooks, storage and todo registration are unchanged (todo moves in part 3).
  • Server sessions gain verify_package; children additionally get sibling tracking and the handoff tool, as on the CLI. Probe misses (uteke / cora / GitHub origin) are now reported on stderr.
  • delete_file still registers only behind an interactive approver (ACP); plan mode still leaves only ReadOnly tools (update_plan, systemone_decide, web_* and job_poll are ReadOnly, so plan-mode sessions keep them).
  • CHANGELOG.

MCP servers on server faces stay out of scope: those faces refuse --mcp-server today, so attaching MCP there is a separate feature.

Testing

  • New roster_tests::server_sessions_use_the_shared_roster (open_session with an allowlist approver): verify_package and write_file present, delete_file absent; in plan mode only ReadOnly tools, no write_file / run_command / agent_start / todo_write.
  • cargo fmt, cargo clippy --workspace --all-targets -- -D warnings, bare-profile clippy (none / shell-tools), cargo test --workspace (all green), plus acp_approval and serve_approvals re-run on the final code.
  • Cora agent-as-reviewer on the exact staged diff (review_prepare → own review → review_finalize): 0 findings, should_block: false. Two info qual-clone hits from the first pass were fixed (values moved instead of cloned).

…ter (#420, 2/3)

session_host::open_session (tole serve, tole acp, the MCP session tools) now calls tool_roster::build instead of its own copy of the registration rules. Server sessions gain verify_package, the executable-only binary probe, and sibling tracking plus the handoff tool when running as a child; the lenient tole_cli_binary_available probe is gone. delete_file still registers only behind an interactive approver (ACP); plan mode leaves only ReadOnly tools.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 419e85b into develop Oct 26, 2026
16 checks passed
@ajianaz
ajianaz deleted the refactor/roster-session-host branch October 26, 2026 06:24
ajianaz added a commit that referenced this pull request Oct 27, 2026
#446)

## What

The three startup probe notices are silent by default and printed only
with `TOLE_VERBOSE=1`. Closes #435.

## Why

`uteke binary not found`, `cora binary not found` and `no GitHub origin
remote detected` are expected on most machines, yet every run printed
them, on every face (since #426 the server faces too). They landed in CI
logs, piped output and every headless `tole run`. The information is not
lost: `tole doctor` reports cora and uteke against the supported
versions (#423).

## Changes

- `tool_roster.rs`: `probe_notice` prints a probe miss only when
`TOLE_VERBOSE` is `1` / `true` / `yes`; the three notices use it.
`mcp[<name>]: no tools registered` stays unconditional: an explicitly
configured MCP server that fails is a real problem, not noise.
- README env table: `TOLE_VERBOSE`. CHANGELOG.

## Testing

- New e2e `quiet_startup` (real binary, no uteke / cora on PATH, not a
git checkout): by default stderr contains none of the three notices;
with `TOLE_VERBOSE=1` it contains all three. The default-silent test
fails on the previous code.
- Unit test for the `TOLE_VERBOSE` parsing.
- `cargo fmt --all --check`, `cargo clippy --workspace --all-targets --
-D warnings`, bare-profile clippy (none / shell-tools; the first run
caught the helpers being unused without shell-tools, fixed with the
existing `allow(dead_code)` idiom), `cargo test --workspace`: all green.
- Cora agent-as-reviewer on the exact staged diff, judged from
`review_finalize`: `should_block: false`, 0 issues.

Co-authored-by: ajianaz <[email protected]>
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