Skip to content

fix: recover rejected scheduler dispatches in v0.5.23 - #10

Merged
ByBrawe merged 4 commits into
mainfrom
fix/v0.5.23-dispatch-recovery
Aug 8, 2026
Merged

fix: recover rejected scheduler dispatches in v0.5.23#10
ByBrawe merged 4 commits into
mainfrom
fix/v0.5.23-dispatch-recovery

Conversation

@ByBrawe

@ByBrawe ByBrawe commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

Researching current OpenCode 1.18.15 showed an important distinction: opencode-loop's scheduler uses the synchronous session.prompt/session.shell APIs but deliberately does not await their long-running promises. The existing fireSdk() helper logged a rejection and then the scheduler still treated the run as active until stale recovery.

This PR:

  • returns and tracks non-blocking prompt/shell dispatch promises;
  • attaches a unique run token to active scheduler runs;
  • immediately clears only the matching active run when its dispatch rejects;
  • invalidates cached busy state, persists dispatch_failed, increments failure count, honors --max-failures, and reschedules normally;
  • deliberately does not replay the prompt, avoiding duplicate turns when OpenCode status/events are delayed or multiple instances are involved;
  • adds a deterministic delayed-rejection regression test;
  • bumps the package to 0.5.23.

A temporary PR workflow applies the focused large-file patch and requires npm ci, syntax checks, the full test suite, Bun module loading, and npm pack --dry-run before committing the candidate.

Copilot AI lite review requested due to automatic review settings August 8, 2026 16:40
@ByBrawe
ByBrawe merged commit 4ebb26c into main Aug 8, 2026
4 checks passed

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.

Pull request overview

This PR introduces a temporary automation path to apply and verify the v0.5.23 “dispatch recovery” patch (by rewriting src/index.js, updating tests, bumping versions, and updating docs) via a Python patch script plus a GitHub Actions workflow that commits the resulting candidate back to the PR branch.

Changes:

  • Add scripts/apply-v0523.py to apply the v0.5.23 patch across src/index.js, tests, package metadata, changelog, and README.
  • Add .github/workflows/apply-v0523-pr.yml to run the patch, run checks/tests, and commit/push the generated changes to the PR branch.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

File Description
scripts/apply-v0523.py Adds a one-shot patch application script that rewrites multiple project files to produce the v0.5.23 candidate changeset.
.github/workflows/apply-v0523-pr.yml Adds a PR workflow intended to run the patch script, verify the result, and commit/push the updated candidate back to the branch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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