Symptom
Workflow run-steps that target a session by session_name silently lose their env_vars. In particular CAO_WORKFLOW_RUN_ID is not set in the spawned terminal, so workflow_return routing breaks — the step's result never reaches the run.
Root cause pointer
src/cli_agent_orchestrator/api/main.py — the run-step guard rejects env_vars only when combined with reuse_terminal_id. With session_name the request passes validation, but the downstream create_terminal(new_session=False) path ignores env_vars entirely — they are dropped without an error.
Suggested direction
Either honor env_vars on the new_session=False path, or reject the combination loudly in the same guard that already covers reuse_terminal_id. Silent acceptance-then-drop is the worst of both: the workflow looks correctly configured and fails only at return-routing time.
Symptom
Workflow run-steps that target a session by
session_namesilently lose theirenv_vars. In particularCAO_WORKFLOW_RUN_IDis not set in the spawned terminal, soworkflow_returnrouting breaks — the step's result never reaches the run.Root cause pointer
src/cli_agent_orchestrator/api/main.py— the run-step guard rejectsenv_varsonly when combined withreuse_terminal_id. Withsession_namethe request passes validation, but the downstreamcreate_terminal(new_session=False)path ignoresenv_varsentirely — they are dropped without an error.Suggested direction
Either honor
env_varson thenew_session=Falsepath, or reject the combination loudly in the same guard that already coversreuse_terminal_id. Silent acceptance-then-drop is the worst of both: the workflow looks correctly configured and fails only at return-routing time.