Pre-existing, systemic (surfaced by review of #5205).
An agent node's config.agent_ref routes to OpenHumanAgentRunner::run_via_harness → Agent::run_single → build_agent_result, which passes the agent's full response downstream. The selected agent definition's max_result_chars cap is only enforced in the separate subagent-runner path, NOT here. So a verbose agent_ref agent (context_scout, researcher, flow_memory_agent, …) can place far more than its declared cap into the flow's downstream context.
Scope: affects every agent_ref agent, not one — a shared limitation of the flow engine seam (src/openhuman/tinyflows/caps.rs), not any single agent PR. Deliberately not fixed inside #5205 (that PR is purely additive; this is a main-module engine change touching all agents).
Fix: truncate the harness turn's final text to the resolved definition's max_result_chars in run_via_harness/build_agent_result (char-safe), matching the subagent-runner's enforcement. Add a test.
Meanwhile #5205's flow_memory_agent mitigates via prompt guidance (return a short, distilled answer).
Pre-existing, systemic (surfaced by review of #5205).
An
agentnode'sconfig.agent_refroutes toOpenHumanAgentRunner::run_via_harness→Agent::run_single→build_agent_result, which passes the agent's full response downstream. The selected agent definition'smax_result_charscap is only enforced in the separate subagent-runner path, NOT here. So a verboseagent_refagent (context_scout, researcher, flow_memory_agent, …) can place far more than its declared cap into the flow's downstream context.Scope: affects every
agent_refagent, not one — a shared limitation of the flow engine seam (src/openhuman/tinyflows/caps.rs), not any single agent PR. Deliberately not fixed inside #5205 (that PR is purely additive; this is a main-module engine change touching all agents).Fix: truncate the harness turn's final text to the resolved definition's
max_result_charsinrun_via_harness/build_agent_result(char-safe), matching the subagent-runner's enforcement. Add a test.Meanwhile #5205's
flow_memory_agentmitigates via prompt guidance (return a short, distilled answer).