Skip to content

[Bug] workflow run-step env_vars silently dropped with session_name — CAO_WORKFLOW_RUN_ID lost, workflow_return misroutes #408

Description

@chaogebaba

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions