fix: agent broken — migrate to service_agent_v3 template #36
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_router#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The router agent (
router.agent.run) is fully broken after hero_logic'sbuild_node_input()refactor (commit2c8299f). Edge-mapped outputs are now namespaced underoutputs.*instead of flattened to root.The old
service_agent(v1) template uses bare{{code_generation}}which stays literal, causing PythonNameError.Root cause
hero_logic's
build_node_input()was restructured:Old (flat):
{ "prompt": "...", "code_generation": "<python>" }New (namespaced):
{ "inputs": {...}, "outputs": {"code_generation": "<python>"}, "prompt": "..." }Workflow inputs are still flattened to root, but edge-mapped outputs live only under
outputs.*. hero_proc's template engine resolves{{code_generation}}against root — doesn't find it — leaves it literal.Plan
1. Fix
{{var}}→{{outputs.var}}in both hero_logic templatestemplates/service_agent.json(v1):{{service_selection}}→{{outputs.service_selection}}{{code_generation}}→{{outputs.code_generation}}{{script_execution}}→{{outputs.script_execution}}{{error_output}}→{{outputs.error_output}}{{prompt}},{{scripts_dir}},{{model}}as-is (workflow inputs, flat at root)templates/service_agent_v3.json:{{fetch_catalog}}→{{outputs.fetch_catalog}}{{service_selection}}→{{outputs.service_selection}}{{compile_stubs}}→{{outputs.compile_stubs}}{{code_generation}}→{{outputs.code_generation}}{{error_output}}→{{outputs.error_output}}{{execution_output}}→{{outputs.execution_output}}{{debugged_code}}→{{outputs.debugged_code}}2. Migrate hero_router
run_agent()to use v3 templateThe v3 template is self-contained —
fetch_catalogandcompile_stubsnodes call the router's Python client directly. The router no longer needs to pre-compute catalog/stubs/interfaces in Rust.Simplify
run_agent()inagent.rs:build_service_catalog(),stage_client_library(),get_service_interface()"service_agent"to"service_agent_v3"input_datato just{"prompt": ..., "model": ...}Update
extract_agent_response():service_selection,code_generation,script_execution) are the same in v3retry_executionnode (v3 has error retry loop)attempts: count bothscript_executionandretry_executionraw_result: checkretry_executionfirst, fall back toscript_executionDelete dead code:
build_service_catalog()(lines 326-389)stage_client_library()(lines 285-320)get_service_interface()(lines 262-282)python_codegenimportsVerification
Expect:
success: true, non-emptyanswer,play_sidpointing to an 8-node v3 play.Relates to #34
fix: agent broken after hero_logic input namespace changeto fix: agent broken — migrate to service_agent_v3 template