Skip to content

fix: preserve queued Goal steering across scheduler dispatch - #99

Merged
ByBrawe merged 25 commits into
mainfrom
test/loop-goal-queued-steering-host
Aug 17, 2026
Merged

fix: preserve queued Goal steering across scheduler dispatch#99
ByBrawe merged 25 commits into
mainfrom
test/loop-goal-queued-steering-host

Conversation

@ByBrawe

@ByBrawe ByBrawe commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve experimental /loop-goal across normal queued user steering instead of pausing or losing the Goal
  • preempt only the in-flight Goal model turn, keep Goal state active/unpaused, let the foreground user turn run, then resume autonomous Goal work
  • gate every autonomous maybeRunDueJobs path while steering is pending, including heartbeat/due/watchdog dispatch
  • handle steering at OpenCode's pre-submit chat.message hook so abort cannot erase the queued foreground prompt
  • keep Loop-owned synthetic prompt ownership alive across the ID-less chat.message phase and bind it when message.updated supplies the real message ID
  • reject stale Goal lifecycle tool updates while foreground steering is pending
  • add focused steering regressions and an exact real-OpenCode prompt_async QUEUED canary
  • run the exact canary on Ubuntu + Windows for both the committed plugin and a freshly rebuilt single-file bundle
  • run clean generated-bundle host verification before the full regression suite, then restore locked dependencies and run all regressions

Real-host regressions found and fixed

  1. Scheduler heartbeat could bypass session.idle suppression and dispatch a second Goal before the queued user message.
  2. Aborting after message.updated could cancel the already-queued foreground prompt, so steering never reached the provider.
  3. Moving to chat.message exposed ID-less Loop-owned synthetic prompts; consuming their guard too early caused the Goal to abort its own continuation repeatedly.
  4. Bundle Gate ran a second OpenCode server only after the full test suite, producing bootstrap timeouts unrelated to bundle semantics; clean host verification now runs immediately after rebuilding the artifact.

Final validation

  • CI: success (Ubuntu/Windows full tests, minimum/current peer compatibility, real OpenCode host canaries)
  • V2 Lifecycle Contract: success
  • Single-file Bundle Gate: success on Ubuntu and Windows
  • exact Linux real-host QUEUED proof: goalStarted=2, goalClosed=1, steeringStarted=1, goalStatus=active, paused=false
  • source real-host QUEUED canary: Ubuntu + Windows success
  • freshly rebuilt bundle real-host QUEUED canary: Ubuntu + Windows success
  • generated-bundle full regression suite: Ubuntu + Windows success

Package version remains 0.5.28; no npm publish in this PR.

Copilot AI lite review requested due to automatic review settings August 17, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ByBrawe ByBrawe changed the title test: verify queued Goal steering on real OpenCode hosts fix: preserve queued Goal steering across scheduler dispatch Aug 17, 2026
@ByBrawe
ByBrawe merged commit e04973b into main Aug 17, 2026
10 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.

2 participants