Skip to content

fix(runtime): recover OpenCode context after failed starts - #36

Open
hopeatina wants to merge 2 commits into
mainfrom
codex/opencode-failed-start-recovery
Open

hopeatina wants to merge 2 commits into
mainfrom
codex/opencode-failed-start-recovery

Conversation

@hopeatina

@hopeatina hopeatina commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • claim staged Wizard context before remote hydration, including chat-message-first ordering
  • deliver bounded context only on the user message, avoiding title and small-model system transforms
  • retry delivery after pre-inference failures, then stop after proven assistant or tool work
  • atomically release unused interactive activations through the Wizard SessionAbandoned contract
  • keep Gateway runtime sessions off the claim-capable SessionStart path so unrelated cwd-only activations cannot be consumed or misattributed
  • clear Gateway-scoped failures without requeueing dispatch context
  • canonicalize POSIX symlink aliases so Wizard and plugin agree on the exact cwd
  • prepare @useorgx/orgx-opencode-plugin 0.1.0-alpha.19

Dependency

  • Depends on hopeatina/orgx-wizard#116 at 539910f43134b2db74dc30897d448e3ec0d2780e.
  • Wizard 0.1.79 must merge and publish before this plugin is released because it supplies OpenCode SessionStart context and the exact-owner SessionAbandoned recovery result.
  • Wizard PR #116 currently has a blocking activation race under repair. Do not merge or publish alpha.19 until that dependency is fixed and green.
  • This PR does not merge or publish either package.

Verification

  • npm run type-check
  • npm test: 13 Vitest files / 139 tests plus 9 Node tests passed
  • npm run build
  • npm pack --dry-run --json: alpha.19, 89,864-byte tarball, 87 entries
  • npm registry readback before the bump: alpha tag was alpha.18 and alpha.19 was unused
  • focused recovery suite covers chat-message-first claim, Gateway no-claim precedence, bounded delivery, provider-auth failure, fail-closed release, successful consumption, missing native idle, unpersisted consumption with exact cleanup, tool use, and Gateway cleanup

Rollout and remaining proof

  • No hosted data, user config, merge, or package publish was performed.
  • An OpenCode 1.16.2 diagnostic proved user-message system context reaches the main model while the experimental system transform also runs for title and small-model calls. That diagnostic validated the delivery surface, not this packaged branch end to end.
  • After the Wizard dependency is fixed, Wizard 0.1.79 and this alpha.19 package are published, install both on a disposable actual-host profile and rerun the successful and ProviderAuthError canaries before promoting the alpha tag.

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