Repository navigation
feat(core): advisor seam, advisor_max_uses and doctor line (#587 part 1) - #653
Merged
Merged
Conversation
tole_core::advisor builds an advisor call from the host's view of a run (fixed instructions, then the task contract, the last 12 transcript entries and the question, each redacted, neutralized and capped before it is fenced as data), parses only a verdict (plan, correction, stop) and capped text from the reply, caps consultations per run and shares the run's token budget with the advisor. profiles.<name>.advisor_max_uses (default 3, 1 to 20) needs models.advisor; tole doctor names the profiles that declare one, never the model. No run consults an advisor yet.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 13, 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
Part 1 of #587 (the advisor tier): the core seam in
tole-core, theprofiles.<name>.advisor_max_useskey with its validation, and thetole doctorline. No run consults an advisor yet;consult_advisorin runs comes in part 2.Depends on: nothing unmerged; based on the latest
develop.Why
A cheaper executor that can consult a stronger model on hard decisions does better at lower cost, but Anthropic's server-side advisor tool cannot be used through tole's OpenAI-compatible provider. Design A10 puts the advisor on the host side. This PR holds the parts that decide what the advisor sees, what the host reads back and what it costs, with no I/O, so part 2 only has to wire them in.
Changes
crates/tole-core/src/advisor.rs(new): no I/O, no provider call, builds with--no-default-features.request(contract, entries, question, secrets)builds the advisor call:SYSTEM_PROMPT(the executor cannot change it);parse_replyreads only a verdict word (plan,correctionorstop, before a colon) and capped, redacted text (2,000 characters).plan, never astop.Verdict::fencedreturns it to the executor as{verdict, advice}between advisory-data markers.Usescaps consultations per run.Budgetis the run's token budget, shared by the run's meter and the advisor:admitbefore a call,chargeafter, never below zero. Advisor tokens come out of the run's budget.usage_valuetags a consultation's usage"role": "advisor".config.rs:profiles.<name>.advisor_max_uses(default 3, 1 to 20).models.advisor, naming the remedy.models.advisoris refused.profile.rs:Profile::advisorandadvisor_max_uses, plusadvisor_doctor_lines: profile names and caps only, never the model.tole doctorprints that line.[Unreleased], design A10 "as implemented, part 1" (including your part 2 constraints of 2026-11-13), a threat-model row, the README profile example anddocs/epics.md.Testing
cargo fmt --allcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspacecargo test -p tole-core --no-default-featurescargo check -p tole-cli --no-default-featurescargo clippy -p tole-cli --no-default-features --features shell-tools -- -D warningscargo test -p tole-cli --no-default-featurescora review --no-llm --staged: no issues.advisor_tests.rs: 7 tests;profile.rs: 2 tests;doctor_ecosystem.rs: 1 test on the real binary.advisor_max_uses = 0is allowed;advisor_max_useswithout an advisor is allowed;