Skip to content

fix: pause compatibility commands before admission - #45

Merged
danyel117 merged 1 commit into
mainfrom
fix/v2-goal-command-precedence
Sep 4, 2026
Merged

fix: pause compatibility commands before admission#45
danyel117 merged 1 commit into
mainfrom
fix/v2-goal-command-precedence

Conversation

@danyel117

Copy link
Copy Markdown
Contributor

Summary

  • enforce /pause_goal at the V2 prompt-admission boundary when OpenCode executes the V1-compatible static command definition instead of the V2 command executor
  • sanitize appended arguments and attachments for both static /pause_goal and /resume_goal prompts
  • keep resume model-mediated so existing Plan-mode enforcement remains authoritative
  • register/dispose the fallback only when command registration is enabled
  • add a regression reproducing the real V1-command/V2-runtime order and cleanup assertions

Reproduction

After installing 0.1.43, an OpenCode V2 standalone smoke showed /pause_goal calling get_goal while the goal was still active; it only became paused after the model called update_goal_status. With this change loaded from dist/server.js, the model context already observes the paused goal and no active-state get_goal occurs.

Verification

  • bun run lint
  • bun run typecheck
  • bun test (231 passing)
  • bun run build
  • bun run pack:dry-run
  • real OpenCode V2 v0.0.0-beta-18593 standalone smoke with isolated goal state
  • internal correctness review: approved
  • internal standards review: approved

Follow-up to #36 and #44.

AI assistance: diagnosed from an end-to-end smoke, implemented, and reviewed with OpenCode agents; an independent Claude Opus review will be attached before merge.

@danyel117 danyel117 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Opus independent review: APPROVE.

No merge-blocking findings. Opus verified the V2 SessionPrompt mutability contract, complete attachment sanitization, full-template ownership check, idempotence with native command executors, lifecycle/race guards, Plan-mode resume behavior, register_command: false, disposal, regression quality, 231 tests, lint, typecheck, package contents, and byte-for-byte reproducibility of dist/server.js.

Residual risks are non-blocking: template-format coupling to beta-18593 and a pre-existing narrow close-vs-pause TOCTOU shared by all pause paths.

@danyel117
danyel117 merged commit b557c23 into main Sep 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant