fix(scheduler): eliminate intake double-create (+ fmt normalize) #207

Merged
clawdie merged 2 commits from fix/intake-task-no-duplicate into main 2026-06-26 10:39:46 +02:00

2 commits

Author SHA1 Message Date
Sam & Claude
b812c1ee22 style: cargo fmt — normalize pre-existing drift inherited from main
Some checks are pending
CI / rust (pull_request) Waiting to run
CI / markdown (pull_request) Waiting to run
CI / port (pull_request) Waiting to run
CI / agent-jail-pkgs (pull_request) Waiting to run
main's fmt gate was red (over-indented host/last_seen in scheduler test
fixtures + drift in socket/store/tests from earlier Phase-3 merges). This
brings the branch to fmt --all --check clean so the gate passes; kept
separate from the dedup fix commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 08:08:03 +02:00
a336f172df fix(scheduler): eliminate double task creation on intake
The merged #206 created a regression: cmd_intake_task created a task
at submit time (returning id A) AND the scheduler tick created a second
task from the same request (id B, which got claimed). Two tasks per
intake, with the returned id pointing to the orphaned copy.

Fix: TaskRequest now carries the pre-created task_id. The tick drops
its create_task() call and only does pick_agent + claim_task on the
existing id. One task, one id, the returned id is the one the
scheduler routes.

- TaskRequest gains task_id field
- cmd_intake_task creates once, pushes id to queue
- scheduler tick claims via req.task_id (no create_task)
- scheduler unit test pre-creates task before submit
- multi_agent_board test verifies id in response
2026-06-26 08:01:35 +02:00