Files
kandev/apps/backend/internal/task/models
José Almeida 2314027386 fix(workflow): store profile IDs in task metadata for deferred auto-start (#437)
* fix(workflow): store profile IDs in task metadata for deferred auto-start

When creating a task with "Create without starting agent", the
agent_profile_id and executor_profile_id were only parsed as top-level
request fields but never persisted into task.Metadata. When the task was
later moved to a step with auto_start_agent, handleTaskMovedNoSession
read empty strings from metadata, causing PrepareSession to fail with
ErrNoAgentProfileID.

Both task creation handlers (WS and HTTP) now inject profile IDs into
task metadata when the agent is not started immediately, so deferred
auto-start works correctly.

* refactor: extract metadata keys to constants

Address CodeRabbit review: extract repeated "agent_profile_id" and
"executor_profile_id" metadata key strings into constants in
task/models, used by both the creation handlers and the orchestrator.
2026-03-14 13:03:45 +00:00
..
2026-02-19 22:18:01 +00:00