Repository navigation
feat(cli): model-facing discussion tools under the rules of delegate - #701
Merged
Merged
Conversation
…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.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 14, 2026
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.
What
discuss,discuss_statusanddiscuss_stop: the model-facing entry point of the multi-round discussion (#588), step 2 of the owner's decision (c) indocs/automation-design.md"Entry point". An orchestrator can start a discussion, read it and stop it, under exactly the rules ofdelegate.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 owntole discuss(#697) is unchanged.Changes
tole_cli::discuss_tool), allRisk::Write(approved or allowlisted likedelegate; the prompt shows question, participants and budget). Registered intool_rosteronly inside thedelegatebranch, so never at the goal's depth limit, in plan mode or without a provider.Delegator::carve_discussioncarves from the caller's remaining budget in the delegation tree (budget_tokens, else half of what is left, never more) as a runningconsultnode 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.Delegator::may_seat, a refusal wheredelegatetrims); never a built-in role. They are inline voices with no tools, so none can start a discussion, call a tool or write.allow,profile,tools,secretsor anything else is refused; the id is the host's (a-...), so a model cannot name or overwrite an owner discussion.discuss_status/discuss_stopwork 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: newReason::StoppedandDiscussionLog::stopintole-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 withtole discuss resume.docs/automation-design.mdturns the open question into the decision; CHANGELOG anddocs/epics.mdupdated.Testing
discuss_tool_tests.rsplus a roster test and a corestoptest: 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 adiscusstool call run nothing and start nothing; ownership (owner's ledger untouched, a planteddelegatenode with a discussion-looking task is not accepted); stop ends a running discussion with astoppedescalation and charges what it spent; stop closes an interrupted discussion with no model call and settles its node; status fenced and redacted; tools areRisk::Writewith a prompt showing the contract; no host at the depth limit; roster registers the tools only withdelegateand a provider.Reason::Stoppedrecorded asBudget.cargo fmt,clippy --workspace --all-targets --all-features -D warnings, bare andshell-toolsclippy,cargo test --workspace,tole-coreandtole-cli--no-default-featurespass.Refs #588