mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
Fix: open findings cleanup (#122)
* refactor(usage): remove the unconsumed per-agent USAGE_UPDATE event USAGE_UPDATE was published per active agent each sweep, bridged, and broadcast to /ws/system, but no panel client ever consumed it — the dashboard reads only the aggregate USAGE_SNAPSHOT. Every emission was wasted event-bus and WebSocket traffic. Drop the UsageUpdate payload, publish_usage_update and its throttle, the EventType member, and the bridge subscription. Keep USAGE_SNAPSHOT, which already carries the per-agent breakdown, so no live data is lost. * refactor(prompter): remove the legacy local-LLM HTTP endpoints The panel uses only the live SDK-intake path (/prompter/live/*); the legacy /prompter/chat, /draft and /sessions/* endpoints — backed by the local Ollama LLM with hardcoded prompts — had no remaining caller. Remove the router, its mount in app.py, and its integration test. The live router and the shared draft-confirmation service are untouched. * refactor(prompter): drop the dead legacy local-LLM service + schemas With the legacy HTTP endpoints gone, the local-LLM chat/draft/session methods, their prompt constants, the ConfirmOverrides/TurnResult dataclasses, and the entire prompter schema module had no production caller (only their own tests). Remove them, keeping the live-intake path: create_task_from_draft / confirm_live_draft, the enum/priority/team coercion, and the pure description/readiness helpers. * refactor(agents): stop granting the Task sub-agent tool to roles Every agent role was granted the built-in Task tool, but no role prompt or workflow uses it and there are no custom sub-agent definitions — so a Task call only spawns a context-blind generic sub-agent that burns budget (ToolSearch, the comment's stated use, is MCP-only and not callable in agent containers). Drop Task from all three grant points in lockstep: the --tools spawn flag and both _ROLE_BUILTIN_TOOLS maps (system-prompt + briefing layers), with a regression guard added to each layer's test. --------- Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -68,6 +68,26 @@ def test_pm_blocks_exclude_edit_and_write() -> None:
|
||||
assert "Write" not in names, f"{role} must not list Write"
|
||||
|
||||
|
||||
def test_no_role_block_lists_the_task_subagent_tool() -> None:
|
||||
"""Task (sub-agent dispatch) is dropped from the briefing tool grant.
|
||||
|
||||
No role uses Task and there are no custom sub-agent definitions, so it only
|
||||
spawns a context-blind generic sub-agent that burns budget.
|
||||
"""
|
||||
for role in (
|
||||
"developer",
|
||||
"documenter",
|
||||
"qa",
|
||||
"main_pm",
|
||||
"cell_pm",
|
||||
"product_owner",
|
||||
"head_marketing",
|
||||
"auditor",
|
||||
):
|
||||
names = _tool_names(_orch()._build_tool_load_block(role))
|
||||
assert "Task" not in names, f"{role} must not list Task: {names}"
|
||||
|
||||
|
||||
def test_unknown_role_returns_empty() -> None:
|
||||
assert _orch()._build_tool_load_block("nonexistent") == ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user