5050install_promoted_overlay ()
5151
5252from nanobot .runtime import llm_proposer , demand # noqa: E402
53+ from nanobot .agent .tools .toolsets import EXECUTOR_TOOL_NAMES # noqa: E402
5354from nanobot .runtime .cycle_ledger import ( # noqa: E402
5455 VALID_OUTCOMES ,
5556 append_event ,
@@ -1606,7 +1607,8 @@ def build_task(req: dict, goal_text: str, report_source: str,
16061607 repair_context : 'str | None' = None ,
16071608 selfevo_repo_root : 'Path | None' = None ,
16081609 max_iterations : int = 15 ,
1609- charter_in_system : bool = False ) -> str :
1610+ charter_in_system : bool = False ,
1611+ declared_tool_names : tuple [str , ...] | None = None ) -> str :
16101612 """Build a concrete task prompt for the subagent from the request payload.
16111613
16121614 Args:
@@ -1832,6 +1834,7 @@ def build_task(req: dict, goal_text: str, report_source: str,
18321834 _verification_note = (
18331835 '' if _pytest_available else ' (pytest is not installed — use python3 -c imports as smoke tests)'
18341836 )
1837+ declared_tool_names = declared_tool_names or ("read_file" , "write_file" , "edit_file" , "list_dir" , "exec" )
18351838 lines += [
18361839 '## Your instructions' ,
18371840 'You MUST take a concrete action in this session. Do not return a review only.' ,
@@ -1857,7 +1860,7 @@ def build_task(req: dict, goal_text: str, report_source: str,
18571860 ' "findings": ["<observation1>", "<observation2>"]' ,
18581861 '}' ,
18591862 '' ,
1860- 'Use your tools: read_file, write_file, edit_file, list_dir, exec .' ,
1863+ 'Use your tools: ' + ', ' . join ( declared_tool_names ) + ' .' ,
18611864 f'You have up to { max_iterations } tool iterations. Use them deliberately.' ,
18621865 ]
18631866
@@ -2513,6 +2516,7 @@ async def _main_impl_body():
25132516 selfevo_repo_root = _selfevo_repo_check ,
25142517 max_iterations = resolved_iterations ,
25152518 charter_in_system = bool (_charter ),
2519+ declared_tool_names = EXECUTOR_TOOL_NAMES ,
25162520 )
25172521
25182522 # Extract backlog title for MEMORY.md safety-net update after execution
@@ -2849,6 +2853,7 @@ async def _evaluate_candidate(cand_cycle_id: str, do_integration: bool, meas_met
28492853 model = config .agents .defaults .model ,
28502854 web_search_config = config .tools .web .search ,
28512855 web_proxy = config .tools .web .proxy ,
2856+ web_tools_enabled = False ,
28522857 exec_config = config .tools .exec ,
28532858 subagent_config = config .tools .subagent ,
28542859 restrict_to_workspace = False ,
@@ -3127,6 +3132,7 @@ async def _evaluate_candidate(cand_cycle_id: str, do_integration: bool, meas_met
31273132 req , goal_text , report_source ,
31283133 state_dir = STATE_DIR ,
31293134 repair_context = _smoke_output ,
3135+ declared_tool_names = EXECUTOR_TOOL_NAMES ,
31303136 )
31313137 # Spawn repair subagent
31323138 from nanobot .agent .subagent import SubagentManager as _SM2
@@ -3139,6 +3145,7 @@ async def _evaluate_candidate(cand_cycle_id: str, do_integration: bool, meas_met
31393145 model = _repair_cfg .agents .defaults .model ,
31403146 web_search_config = _repair_cfg .tools .web .search ,
31413147 web_proxy = _repair_cfg .tools .web .proxy ,
3148+ web_tools_enabled = False ,
31423149 exec_config = _repair_cfg .tools .exec ,
31433150 subagent_config = _repair_cfg .tools .subagent ,
31443151 restrict_to_workspace = False ,
0 commit comments