Reference: huberp/agentloop · run 24935457632 · job 73020142658 step 6
Sorted by: criticality (Critical → High → Medium → Low)
H-1 · Parallel Branches s4 + s5 Both Mutate package.json Concurrently Without Resource Locks
Log evidence (lines 230-240):
runnable: ["p1.b0.s4", "p1.b1.s5"] ← dispatched simultaneously
s4 (npm install @anthropic-ai/sdk):
→ npm error ETARGET No matching version found for @anthropic-ai/sdk@^0.25.3
→ retry: npm install @anthropic-ai/sdk@latest → installed
s5 (file-edit package.json, adding @anthropic-ai/sdk ^0.25.3):
→ success (wrote stale/conflicting version string)
Both steps ran in parallel and both modified package.json. npm install @latest rewrote the lockfile and package.json at the same time as file-edit inserted ^0.25.3. The result is a package.json with ^0.25.3 in dependencies but @latest in node_modules (and possibly the lockfile) — an inconsistent state.
Root cause: The scheduler in src/langgraph/scheduler.ts has a correct file:write: locking mechanism, but it is entirely inert here because the planner LLM never emitted resources: ["file:WRITE:package.json"] hints in the plan. The scheduler can only protect what is declared.
Structural problem: Resource hints are purely advisory and LLM-generated. The planner has no enforced obligation to declare them, and the schema hint in BLOCKS_PLAN_SCHEMA_HINT only shows them as an example. The consequence is that the entire write-conflict protection system is silently bypassed whenever the planner omits resources.
Actionable fixes:
- Add npm-install to serial-only steps: Instruct the planner explicitly — "Steps that run
npm install, pip install, cargo build, or any package manager command must never be parallelised with steps that edit the corresponding manifest file." Add this as a hard constraint in BLOCKS_PLANNER_SYSTEM.
- Infer file locks from
toolsNeeded: In compileBlocksPlanToDag, if toolsNeeded contains file-edit or file-write, mark the step as potentially writing to files and prevent its parallelisation with npm-install steps automatically.
- Post-plan validation: After the planner produces the plan, validate that no parallel branch pair contains one npm-install-like step and one file-edit step without a declared resource lock, and trigger refinement if so.
Reference:
huberp/agentloop· run24935457632· job73020142658step 6Sorted by: criticality (Critical → High → Medium → Low)
H-1 · Parallel Branches s4 + s5 Both Mutate
package.jsonConcurrently Without Resource LocksLog evidence (lines 230-240):
Both steps ran in parallel and both modified
package.json.npm install @latestrewrote the lockfile andpackage.jsonat the same time asfile-editinserted^0.25.3. The result is apackage.jsonwith^0.25.3independenciesbut@latestinnode_modules(and possibly the lockfile) — an inconsistent state.Root cause: The scheduler in
src/langgraph/scheduler.tshas a correctfile:write:locking mechanism, but it is entirely inert here because the planner LLM never emittedresources: ["file:WRITE:package.json"]hints in the plan. The scheduler can only protect what is declared.Structural problem: Resource hints are purely advisory and LLM-generated. The planner has no enforced obligation to declare them, and the schema hint in
BLOCKS_PLAN_SCHEMA_HINTonly shows them as an example. The consequence is that the entire write-conflict protection system is silently bypassed whenever the planner omitsresources.Actionable fixes:
npm install,pip install,cargo build, or any package manager command must never be parallelised with steps that edit the corresponding manifest file." Add this as a hard constraint inBLOCKS_PLANNER_SYSTEM.toolsNeeded: IncompileBlocksPlanToDag, iftoolsNeededcontainsfile-editorfile-write, mark the step as potentially writing to files and prevent its parallelisation with npm-install steps automatically.