agora.fleet.inner_tools
Inner tool definitions and executors per agent role.
Tools are described to the LLM as JSON-schema-ish dicts. At execution time the
runtime resolves a tool call’s name to a coroutine via get_tool_executor()
and feeds back the result.
Tool categories:
- research: web_search, fetch_url (optional — require injected callables)
- filesystem: read_file, write_file, list_directory (scoped to work_dir)
- git: git_commit, git_diff, git_log (Sprint 4 wires in a real RepoManager)
- coordination: report_progress, request_review, mark_complete, report_learning
Module Attributes
Tool names hidden from the LLM when |
Functions
|
Return the tool schemas for the given role. |
|
Return a |
Classes
Per-task execution context threaded through every inner tool call. |
- class agora.fleet.inner_tools.ToolContext[source]
Bases:
objectPer-task execution context threaded through every inner tool call.
The
ToolContextholds the work directory, the Matrix client, the git repo manager, and per-task mutable state (written_files,progress_log,completions,reported_learnings, theplan_draftfor plan-authoring stages). It’s the single object every tool factory receives, so adding a new piece of per-task state is a one-line change here.Several flags gate what tools are exposed to the model:
auto_hooks_enabled— when True, the framework runs validation +git_commit+mark_completeautomatically afterwrite_file, and those tools are hidden from the LLM manifest.plan_authoring_enabled— gates theplan_*tool category; only the plan-builder runner enables this.write_file_blocked— flipped by the overwrite guard once the model tries to clobber a file outside its declared output path. Stays set for the rest of the task sowrite_fileis dropped from the manifest, forcing the model onto the edit primitives.
Most fields default to safe no-op values; tests construct
ToolContextinstances with fakes formatrix_clientandgit_repoto exercise tools in isolation.- matrix_client: MatrixClientProtocol
- matrix_live: bool = True
no room, no human. Tools MUST branch on this rather than posting into the void — informational tools say “recorded to log” instead of claiming delivery, and tools that block on a person refuse loudly rather than pretend. Defaults True so every existing caller/test keeps today’s behaviour.
- Type:
False when the Matrix surface is off (
NullMatrixClient)
- __init__(work_dir, matrix_client, agent_room_id, project_room_id, matrix_live=True, git_repo=None, search_fn=None, fetch_fn=None, knowledge_refs=<factory>, knowledge_fetcher=None, control=None, progress_log=<factory>, reviews_requested=<factory>, completions=<factory>, reported_learnings=<factory>, written_files=<factory>, write_file_blocked=False, auto_hooks_enabled=False, expected_output_path='', task_focus='', distill_fn=None, read_distill_threshold=8000, plan_draft=None, plan_authoring_enabled=False, active_test_file='', tool_errors='raw', nudge_budget=0, review_budget=0, salvage_budget=0, run_check_records=<factory>)
- agora.fleet.inner_tools.AUTO_HOOKED_TOOL_NAMES: frozenset[str] = frozenset({'check_python', 'git_commit', 'git_diff', 'git_log', 'report_learning'})
Tool names hidden from the LLM when
ToolContext.auto_hooks_enabledis True. The framework runs these automatically afterwrite_file, so exposing them to weak models only adds cognitive overhead.
- agora.fleet.inner_tools.get_tool_definitions(role, *, auto_hooks_enabled=False, plan_authoring_enabled=False, fill_test_body_bound=False)[source]
Return the tool schemas for the given role.
Always hides the deprecated granular plan-authoring tools. When
auto_hooks_enabledis set, additionally hides tools whose behaviour is already automated byagora.fleet.auto_hooks.When
plan_authoring_enabledis False (default), drops the entireplan_authoringcategory — the plan-builder runner opts in via ToolContext; other runners don’t, so emitted plans whose architect role would otherwise see plan_upsert_agent / plan_add_task_spec don’t accidentally drift into meta-authoring calls. Also hidesawait_user_decisionin the build path: the plan-builder legitimately drives user decisions via declarative decision STAGES (framework-owned); build agents callingawait_user_decisionad-hoc blocks on 300s timeouts without advancing the task — observed disruption in live url-shortener build runs.v2.7:
fill_test_body_boundgates thefill_test_bodytool. It only makes sense inside afill_assertionsstage where the stage runner has boundctx.active_test_file; everywhere else the tool is hidden so the model can’t pick it up as a generic file-editor.