Skip to content

fix(taskctl): verdict command fails — missing allowImmutable flag in Store.updateTask #267

@randomm

Description

@randomm

Task Description

taskctl verdict fails with:

Cannot update immutable fields: pipeline. Use specialized methods for comments and pipeline events.

The adversarial agent calls taskctl verdict to submit its review, but the verdict command handler in tool.ts (line 976) calls Store.updateTask without the allowImmutable=true third argument, hitting the immutability guard on the pipeline field.

Root Cause

Same class of bug as #265 (retry/override). PR #266 fixed retry and override but missed verdict.

// Line 976 — missing true as third argument
await Store.updateTask(projectId, taskId, {
  status: "review",
  pipeline: { ...task!.pipeline, adversarial_verdict: verdictData, stage: "reviewing" }
})

Fix

Add true as the third argument:

await Store.updateTask(projectId, taskId, {
  status: "review",
  pipeline: { ...task!.pipeline, adversarial_verdict: verdictData, stage: "reviewing" }
}, true)

Quality Gates (Non-Negotiable)

  • TDD: Write failing test first
  • Coverage: test that verdict command succeeds on a task in adversarial-running stage
  • Linting passes
  • Local verification: all tests pass

Acceptance Criteria

  • taskctl verdict successfully records an APPROVED verdict without throwing
  • Test in packages/opencode/test/tasks/ verifies the verdict is stored and task transitions to reviewing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions