Skip to content

feat(cli): model-facing discussion tools under the rules of delegate - #701

Merged
ajianaz merged 1 commit into
developfrom
feat/discuss-tool
Nov 14, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/discuss-tool

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What

discuss, discuss_status and discuss_stop: the model-facing entry point of the multi-round discussion (#588), step 2 of the owner's decision (c) in docs/automation-design.md "Entry point". An orchestrator can start a discussion, read it and stop it, under exactly the rules of delegate.

Why

The owner wants the mode open to agents as well as to the owner. A model-written contract is an injection path, so the tools add no power the caller does not already hold: the budget is carved from the caller's remaining budget, participants stay within the caller's allow list, depth and approval rules are delegate's, and the owner's own tole discuss (#697) is unchanged.

Changes

  • Tools (tole_cli::discuss_tool), all Risk::Write (approved or allowlisted like delegate; the prompt shows question, participants and budget). Registered in tool_roster only inside the delegate branch, so never at the goal's depth limit, in plan mode or without a provider.
  • Budget: Delegator::carve_discussion carves from the caller's remaining budget in the delegation tree (budget_tokens, else half of what is left, never more) as a running consult node with a host-only profile marker; the tree is charged the ledger's token count when it ends, a crash is charged the whole carve. At most two discussions run at once per process.
  • Participants: user-config profiles whose allow patterns the caller's allow list covers (Delegator::may_seat, a refusal where delegate trims); never a built-in role. They are inline voices with no tools, so none can start a discussion, call a tool or write.
  • No new power: five input fields only; allow, profile, tools, secrets or anything else is refused; the id is the host's (a-...), so a model cannot name or overwrite an owner discussion.
  • Management: discuss_status / discuss_stop work only on discussions the same session started (the host-only tree node, not a task string a model can write). Status is redacted and fenced as data. A stop is the ledger's own escalation: new Reason::Stopped and DiscussionLog::stop in tole-core, so no participant text can start, prevent or delay it. A discussion whose process died is closed by a stop without a model call, or continued by the owner with tole discuss resume.
  • Not in this PR: independent child-process participants for agents (they would hold tools and need the owner's approval surface and a no-nested-discussion rule). Inline voices have no Write to approve, so none can reach the caller's allowlist.
  • docs/automation-design.md turns the open question into the decision; CHANGELOG and docs/epics.md updated.

Testing

  • 14 tests in discuss_tool_tests.rs plus a roster test and a core stop test: runs in the background and settles the tree (charged what it spent); carve never exceeds what is left, never added, refunded when unspent; default is half; live cap of two; unknown fields refused with nothing carved or written; bad contract, unknown profile, built-in role and duplicate participants refused before any carve; allow-list cover rule both ways; participants answering with a discuss tool call run nothing and start nothing; ownership (owner's ledger untouched, a planted delegate node with a discussion-looking task is not accepted); stop ends a running discussion with a stopped escalation and charges what it spent; stop closes an interrupted discussion with no model call and settles its node; status fenced and redacted; tools are Risk::Write with a prompt showing the contract; no host at the depth limit; roster registers the tools only with delegate and a provider.
  • Mutation checks (each fails a test): unknown-field check off, cover rule off, carve ignored, live cap 3, ownership without the profile marker, fence removed, stop of an undriven discussion not closing, node settled at 0 tokens, built-in role check off, Reason::Stopped recorded as Budget.
  • cargo fmt, clippy --workspace --all-targets --all-features -D warnings, bare and shell-tools clippy, cargo test --workspace, tole-core and tole-cli --no-default-features pass.

Refs #588

…588 part 3b)

discuss, discuss_status and discuss_stop: Risk::Write, registered only where delegate is, budget carved from the caller's remaining budget, participants within the caller's allow list and read-only, management limited to the session's own discussions, and a ledger-level stop.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

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.

2 participants