Route a request to pick work through the suggestion tool - #203
Merged
Merged
Conversation
Asked what to work on, the mentor could answer without ever naming a task. Nothing routed the question: `get_suggested_tasks` appeared only inside the hire-state list, which sorts tools by subject, and task selection is neither how the product works nor the hire's own progress. Starter Work is also a product noun, and `search_docs` is described as covering how the product works -- so the model explained the feature, accurately, and suggested nothing. The backend was never the cause: its tool always returns prose, "there are no starter-work tasks to suggest yet" included, so a hire who saw no tasks saw a turn in which the tool was never called. The routing rule is now its own clause, gated on the tool being mounted. It names the wordings that carry the intent, says the ranking exists nowhere else -- not in the corpus, not in the conversation summary, not in a list given earlier in the visit -- and says what to do when it comes back empty, because a mentor with nothing to offer will otherwise assemble something that reads like a task. Arrival gets its own sentence, mounted with its own tool. Reading it pauses the turn for the backend to run it, and the hop that resumes has already said something helpful about setup; the question is dropped on the way back unless both tools belong to the one reply. Dropped in team mode with the rest of the hire's clauses: a manager must never be handed a list of what they should work on. Closes #200 Co-Authored-By: Claude Opus 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.
Closes #200.
What was wrong
Asked what to work on, the buddy could answer without ever naming a task.
Nothing in the persona routed the question.
get_suggested_tasksappeared only inside the hire-state clause (buddy_persona.py:205-212), which sorts tools by subject — and task selection is neither "how this codebase, product, or process works" nor "the hire's own progress". Starter Work is also a product noun, andsearch_docsis described as covering how the product works, so "my PM told me to pick something from Starter Work" reads as a product question. The model explains the feature, accurately, and suggests nothing.The second half is the arrival hop.
_ARRIVAL_CLAUSEmakes the first move on this exact question "Before suggesting anything to work on, checkget_arrival_steps". A backend tool pauses the turn (buddy_agent.py:290); the backend re-invokes with the result, and the hop that resumes has already said something helpful about setup. The clause forbids withholding a suggestion but never says where the suggestion comes from, so the question is dropped on the way back.The backend is not the cause.
BuddyToolExecutor.getSuggestedTasksnever returns an empty string — an empty pool yields "There are no starter-work tasks to suggest yet.", no project membership yields its own sentence, and the spec is mounted unconditionally with a description that already names the question. A hire who saw no tasks saw a turn in which the tool was never called, not one where it came back empty.What changed
A routing clause of its own, gated on
get_suggested_tasksbeing mounted. It names the wordings that carry the intent, says the ranking exists nowhere else — not in the corpus, not in the conversation summary, not in a list given earlier in the visit — and says what to do when it does come back empty, because a mentor with nothing to offer will otherwise assemble something that reads like a task.Arrival gets its own sentence, gated on its own tool, saying both belong in the one reply.
Dropped in team mode with the rest of the hire's clauses, asserted rather than assumed: a manager must never be handed a list of what they should work on.
Checks
ruff check·ruff format --check·pyright src/clean;uv run pytest950 passed, 8 skipped. Six new persona tests plus two assertions added to the existing mode tests.🤖 Generated with Claude Code