fix(contextual): narrow tool palette + forbid legacy read tools
Smoke trace 0b46841484ba7d024ed9f8d5ac8b1df0 showed the agent defaulting to list_projects + get_project for a 'summarize project Nexus' query, returning a shallow row without aiSummary or tasks/notes. The legacy read tools were exposed via *PROJECT_TOOLS / *TASK_TOOLS spreading. Now _contextual_tools exposes exactly: - get_page_details (sole read; supports per-entity + list views) - create_task, update_task - create_note - create_timeline Prompt rule 2 explicitly forbids the legacy reads, and the test asserts they are excluded from the palette. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,3 +74,12 @@ async def test_run_contextual_stream_includes_scope_block(monkeypatch):
|
||||
|
||||
# Note edit tools must NOT be exposed.
|
||||
assert "propose_note_edit" not in names, "propose_note_edit must be excluded"
|
||||
|
||||
# Legacy read tools must be excluded — they return shallow snapshots and
|
||||
# cause the agent to under-answer (see trace 0b46841484ba7d024ed9f8d5ac8b1df0).
|
||||
assert "list_projects" not in names, "list_projects must be excluded (legacy read)"
|
||||
assert "get_project" not in names, "get_project must be excluded (legacy read)"
|
||||
assert "list_tasks" not in names, "list_tasks must be excluded (legacy read)"
|
||||
assert "get_task" not in names, "get_task must be excluded (legacy read)"
|
||||
assert "list_notes" not in names, "list_notes must be excluded (legacy read)"
|
||||
assert "get_note" not in names, "get_note must be excluded (legacy read)"
|
||||
|
||||
Reference in New Issue
Block a user