Skip to content

fix(missions): resolve scheduled wakes from native message records (OpenCode 2.2.6) - #1350

Merged
pascalandr merged 6 commits into
devfrom
fix/oc-226-schedule-wakes
Nov 7, 2026
Merged

pascalandr merged 6 commits into
devfrom
fix/oc-226-schedule-wakes

Conversation

@pascalandr

@pascalandr pascalandr commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On OpenCode 2.2.6, scheduled Mission wakes no longer start their passage. Upstream anomalyco/opencode#61018 removed the metadata copy from the LLM messages plugins see in session context hooks. CodeNomad classified wakes from metadata.schedule on that projection, so a 2.2.6 wake looked inconsistent: the drain failed with schedule-carrier-wake and the passage was never admitted.

Fix

The context projection still carries each native message id, and the stored native message still carries metadata.schedule. Wake classification now resolves user-role context IDs through the existing bounded native message reader and classifies the authoritative stored records by type and status, ignoring projected metadata. Resolved records are reused for the candidate proof, so a wake row is read once. Classification and recovery reads have separate read and byte budgets, and exceeding a bound surfaces a coverage error instead of dropping the wake. Placement, mapping, deterministic identities, source-byte fences, RPC checks and CAS/high-water behavior are unchanged. The minimum stays 2.2.3.

The canonical authority and bounds contract is in dev-docs/MISSIONS_NATIVE_SCHEDULE_TRANSPORT.md.

Native facts, checked on isolated CLIs:

CLI Context message ID Context metadata.schedule Stored metadata.schedule
2.2.3 kept present present
2.2.5 kept present present
2.2.6 kept absent present

Tests

  • Unit coverage for metadata-free and conflicting projections, notices, compactions, invalid native records, a context of 128 wake entries, eight recovery reads and independent byte budgets.
  • tests-runtime-contracts gains a native context/storage check and the cold scheduled-Mission product check on minimum and latest, and uploads the fixtures' receipts and failure diagnostics when a step fails. The schedule fixtures read the actual CLI version instead of a hardcoded 2.2.3, poll for the PID-matching ready registration, and set the at time after activation, just before Play. The cold wait allows 120 s (leader-lease recovery exceeds 45 s on dev too).
  • On 2.2.6, an origin/dev snapshot fails the cold product check (schedule-carrier-wake); this branch passes at and in with the exact CI command (product step: 102 s on 2.2.3, 208 s on 2.2.6).
  • Foundation fixtures pass on 2.2.3 and 2.2.6 (3 CAS applications, cold recovery, no provider requests); an earlier revision also passed them on 2.2.5. Server Missions suites: 1,406 passed. Server/UI typechecks and native bundle builds pass. The full runtime-contract sequence passes locally on 2.2.3 (15 min) and 2.2.6 (23 min 26 s, against the job's 25-minute timeout).

Known limitation

experimental.part_rows (off by default) stores assistant parts in session_part, which CodeNomad's history, search, outline, gallery and pruning readers do not read. Documented in dev-docs/SESSION_HISTORY_QUERIES.md, not addressed here.

OpenCode context messages retain their native IDs while schedule metadata is optional in the LLM projection. Resolve every user-role context ID through the existing bounded native reader so scheduled passages start on 2.2.6 while retaining the 2.2.3 minimum and existing dependency pins.

Use native user, restart-notice and completed-compaction records in both carrier compositions, including auxiliary adoption after a lost create acknowledgement. Preserve exact session placement, fixed native signal, mapping, deterministic identity, shared read/byte limits, source fences and receiving RPC CAS/high-water checks. Projected metadata and prose supply no authority.

Add a real native context/storage probe and cold at/in product regression to the minimum/latest runtime CI matrix. Fixture version checks compare against the explicitly selected private CLI; cold recovery allows the native scheduler leader lease and loop to expire. Document the consumed contracts and the separate experimental part_rows limitation.

Validation: 14 focused tests; 1403 Missions tests passed with one opt-in native test skipped; server and UI typechecks; Missions, automation and pruning builds; native plugin bundle tests. Isolated 2.2.3, 2.2.5 and 2.2.6 foundation and cold at/in product checks pass. The origin/dev product bundle fails the same 2.2.6 cold regression with schedule-carrier-wake.
Keep native schedule qualification independent of ancestor project configuration and the host runtime namespace. Use the current project-discovery disable flag and pin the fixture HOME and database explicitly alongside its private XDG and AppData roots.

The driver continues to launch and stop only its own managed service. Fresh complete foundation runs pass on isolated 2.2.3, 2.2.5 and 2.2.6 CLIs, including lost acknowledgements, compaction, exact replay and cold restart with zero provider HTTP requests.
@pascalandr

Copy link
Copy Markdown
Contributor Author

Independent OpenCode 2.2.6 requalification

Tested commit: bedc3d8, using the exact official 2.2.6 CLI from the initial qualification.

  • Missions, automation and pruning builds and root typecheck pass.
  • Wake regression units: 14/14.
  • Native context/storage correlation passes on 2.2.6: projected IDs remain present, while schedule metadata is resolved from native records.
  • Full native schedule foundation passes on 2.2.6, including lost ACKs, replay and cold recovery, with zero provider HTTP.
  • The retained-product cold at/in journeys both pass with the CodeNomad backend closed and the owned service restarted.
  • Minimum 2.2.3 native context/foundation checks also pass.

The original scheduled-wake qualification blocker is resolved on this commit. This is targeted requalification, retaining the initial unchanged API/package and default-storage evidence, rather than a second full suite. The documented experimental part_rows limitation remains outside scope; historical split rows are not repaired by disabling the flag. Previously reproduced baseline failures in other fixtures remain separate.

The PR is still open at the time of this evidence; this does not assert the fix is present on dev or in a published release.

…tion

A full carrier context must leave room for the original wake proof and all eight principal recovery reads. Reuse invocation-local native records for candidate proofs, give classification and deterministic recovery separate bounded read/byte lanes, and surface coverage failures instead of swallowing them. Bound SQL bodies before transfer while distinguishing an oversized existing row from an absent message. Classify resolved records by native type and status without a separate ID allowlist.

Refresh the isolated product fixture's absolute date after creation and activation, immediately before Play, retaining the default thirty-second wake delay. Record and print structured refusal reasons. Export fixture roots for failure artifact uploads, retain foundation receipts, remove temporary CLI-version directories, poll exact PID-owned service registration, and keep unbound auxiliary notice turns quiet before reading context rows. Consolidate schedule read authority in the transport contract and locate split-part history coverage beside the history readers.

Validation covers full 128-entry wake contexts, independent recovery byte/read budgets, visible coverage errors, native notices/checkpoints and lost auxiliary acknowledgements. Cold at/in product qualification and the foundation pass on private OpenCode 2.2.3 and 2.2.6 runtimes; 1406 Missions tests pass with one opt-in skip. Server/UI typechecks, native plugin builds and bundle checks qualify the unchanged 2.2.3 minimum.
pascalandr added a commit that referenced this pull request Nov 7, 2026
… pruning (#1359)

## Summary

Support OpenCode's optional `experimental.part_rows` storage throughout
direct history/search, navigation/outline, image gallery and technical
cleanup. Reconstruct ordinal split rows followed by any inline tail,
including existing split data after the flag is disabled. Missions
source projections share the same ordering.

Validate the actual storage schema, part ownership/type/call identity
and byte/row budgets before reconstruction. Keep metadata reads free of
JSON decoding and preserve native rowid seeks. Cleanup deletes selected
split rows and inline entries atomically with the envelope CAS,
media-reference release and retry receipt; retained split rows keep
their exact bytes and ordinals.

## Validation

- Storage-specific regressions: 10/10 passed, covering mixed messages,
stale revisions, rollback, media ownership, gallery pixels/provenance,
metadata queries and malformed/oversized storage.
- Final-source pruning and affected native Missions tests: 318/318
passed.
- Full server suite: 4,098 passed, 23 skipped, one timeout in the
70-passage recurring-Missions scenario; the same scenario passed in
isolation in 35 seconds.
- Server and workspace typechecks passed; help tests passed 31/31 over
all ten locales.
- Rebuilt final committed bundles: official private CLI 2.2.3 passed the
complete default-storage journey; 2.2.6 passed split storage with real
UI cleanup and persisted reload, media release, claim concurrency, next
model payload and mixed content after flag-off/restart.
- Official private CLI 2.2.6 passed the split Design gallery journey:
exact pixels, proven lineage and late read-back with unverifiable
provenance.
- Add a latest-runtime split-storage CI journey. Update technical
documentation and history help in all ten locales.

Minimum runtime and dependency pins stay at 2.2.3; the recommendation
remains 2.2.5. No user database or shared service is modified by the
isolated fixtures. This PR does not include the separate scheduled-wake
fix in #1350.
Integrate current dev, retaining both schedule and runtime failure artifacts and the latest-runtime split-storage journey. Describe the actual shared split-plus-inline projection now shipped by history and Missions, including flag-off reads, rather than advising users to disable part_rows.

The original PR head passes 17 wake regressions, server/UI typechecks, 2.2.3 and 2.2.6 native context/foundation checks and the 2.2.6 cold at/in product journeys. Rebuild and qualify this integrated tree before promotion.
@pascalandr

Copy link
Copy Markdown
Contributor Author

Gatekeeper review and final OpenCode 2.2.6 qualification

Reviewed head: 735a9714c0d2bf0227dbb19871064f11df9a894b. Findings: 0.

Reconciled the current schedule fix with dev, including merged #1359. Kept both workflow diagnostic families and the split-storage CI journey; corrected the stored-part documentation to describe the working shared split-plus-inline projection. Workflow YAML parses with unique keys.

Reviewed the changed reader, classifier, product/foundation context hooks, callers, tests and fixtures. Exact same-session native records provide scheduling authority. Classification cannot exhaust the independent deterministic recovery budget. Resolved proofs stay invocation-local; receiving RPC placement, schedule ACK, source, claim and document-CAS/high-water fences remain in force. Coverage failures remain visible.

Exact integrated-source checks

  • Server and all plugin bundles build. Server/UI typechecks pass.
  • 335/335 combined pruning, wake and affected Missions projection tests pass.
  • Official private CLI 2.2.6 and 2.2.3 both pass native context/storage correlation, full schedule foundation (lost ACK, replay, compaction and cold recovery, zero provider HTTP), and retained-product cold at/in journeys with the backend closed and the owned service restarted.
  • Official private CLI 2.2.6 passes default pruning and split pruning through the real UI, including persisted reload, media release, mixed tails after flag-off/restart and the next model payload.
  • Split Design gallery passes: exact pixels, series/lineage and late read-back provenance.
  • Native history migrations 2.2.3 → 2.2.6 and 2.2.5 → 2.2.6 pass.
  • Native host/plugin bindings, Code Mode run-to-completion, automation, memory, Goal, Missions tool contract and parallel/recursive trajectory all pass.
  • Original head aeb07068 separately passed 17 wake tests, server/UI types, minimum/current context/foundation and 2.2.6 cold at/in before reconciliation.

All fixtures used private synthetic databases/configuration, isolated official CLIs and local providers, stopping only their own processes. The same official 2.2.6 CLI SHA256 is 98cb0aa854c7c015cf6febafa7afb872c359bfe5a823a526f3b4fd347a9e9677. The earlier exact-tag/API/package and unchanged-contract evidence remains applicable; previously reproduced cross-version baseline fixture failures are not claimed fixed.

The original CI run had one unrelated Electron preview 500 ms key-event wait failure; its retry was superseded by the reconciled push. CI for this head is separate from these completed native checks. Minimum and authoring pins stay 2.2.3. A recommendation-only follow-up will record 2.2.6 after verifying the actual merged tree matches this tested source.

@pascalandr
pascalandr merged commit 4d6a517 into dev Nov 7, 2026
17 of 19 checks passed
@pascalandr
pascalandr deleted the fix/oc-226-schedule-wakes branch November 7, 2026 21:01
pascalandr added a commit that referenced this pull request Nov 7, 2026
## Summary

Recommend OpenCode **2.2.6** after the scheduled-wake correction (#1350)
and split assistant storage support (#1359) were qualified together and
merged. Keep the technical minimum and client/schema/plugin pins at
**2.2.3**. This changes the displayed qualification target, not the
service, user configuration or capability-based admission policy.

Update the runtime/update-status regressions, server guide, architecture
references and installation/setup/server/troubleshooting help in all ten
locales. Describe the host-provided Effect/Schema runtime independently
of a release number.

## Qualification provenance

The exact integrated source `735a9714c0d2bf0227dbb19871064f11df9a894b`
passed the final campaign. After merging #1350, `git diff
735a971
4d6a517` was empty: actual merged dev
is byte-identical to the tested tree. Detailed gatekeeper evidence:
#1350 (comment).

- **335/335** combined pruning/wake/affected Missions regressions;
server/UI typechecks; server and all plugin builds.
- **18 isolated native invocations**, all successful: context, full
foundation and retained-product cold at/in on **2.2.6 and minimum
2.2.3**; default pruning; split pruning with real UI and reload; split
Design gallery; native migrations **2.2.3 → 2.2.6** and **2.2.5 →
2.2.6**; host plugin bindings, Code Mode, automation, memory, Goal,
Missions contract and recursive/parallel trajectory.
- The original exact-tag/API/package review and its unchanged-contract
evidence remain applicable to the same official 2.2.6 CLI (SHA256
`98cb0aa854c7c015cf6febafa7afb872c359bfe5a823a526f3b4fd347a9e9677`).
Previously reproduced cross-version baseline fixture failures are not
claimed fixed; optional third-party MCP pooling and the broader
experimental VM remain outside these native journeys.
- This recommendation change passes **32/32** runtime/update-status
tests, server typecheck and **31/31** help checks over ten locales.
Verified exact recommendation-only substitutions across all 40
translated help pages and the four guide/reference files; package
manifests and lockfile are unchanged.

All native checks used private synthetic state, isolated official CLIs
and local providers. No shared daemon, user database, user configuration
or production provider account was changed.
@pascalandr

Copy link
Copy Markdown
Contributor Author

Merged-tree verification and recommendation

#1350 is merged as 4d6a517602b9387c32d793cbac35e045a3c508ee. The full-tree diff against tested integrated source 735a9714c0d2bf0227dbb19871064f11df9a894b is empty, binding the completed native campaign to actual merged dev.

Recommendation-only #1379 is now merged as 7292e4e3b188c9aaf9caf7bca90616250225a4f6: recommended runtime 2.2.6, technical minimum and client/schema/plugin pins 2.2.3. Its 32 runtime/update-status tests, server typecheck and 31 help tests passed. The owned final qualification worktree and both temporary qualification/recommendation branches were removed; unrelated work and earlier evidence were preserved.

GitHub validation workflows for the integrated schedule head and recommendation head are still running/queued and are monitored separately from the completed local/native qualification.

@pascalandr

Copy link
Copy Markdown
Contributor Author

CI follow-up: startup and standalone Electron preview

Workflow https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/42412855101 finished with two failed jobs. Server tests, the minimum runtime lane, all three native pruning platforms, compatibility platforms, Tauri checks and three browser shards passed.

In the latest lane, native runtime/Missions contracts, split pruning and context correlation passed. The retained-product at receipt also reports passed. The subsequent in case failed at initial service connection, before any product HTTP request, provider call or Mission creation. Its receipt records the expected private 2.2.6 PID/registration; the diagnostic contains no native error output. The fixture currently calls Service.discover once immediately after registration publication. A bounded readiness follow-up reuses its existing wait primitive while checking the owned PID on every discovery probe; no mutation or cold-window condition is retried.

Browser shard 3 again failed the 500 ms Key:a observation in automation-preview.test.ts. That test runs a local HTML server and isolated Electron guest and does not launch OpenCode. Its failure is tracked separately from the runtime qualification.

Diagnostics were downloaded and retained; one rerun of only the failed jobs has been submitted. The completed local/native qualification remains documented above, while the full GitHub workflow is not reported as green.

pascalandr added a commit that referenced this pull request Nov 7, 2026
…on (#1380)

## Summary

Fix the isolated scheduled-Mission fixture's startup race observed in
#1350 CI. The at journey passed; the next in journey observed the
expected private 2.2.6 registration but failed its one-shot discovery
before any product HTTP, Mission creation or provider request.

Reuse the existing 40-second wait in the shared connect path, with
cancellation and exact owned-PID checks before each read-only discovery
probe. Preserve the subsequent URL/version/PID checks and all
cold-window/mutation gates. No production runtime code or user-facing
behavior changes.

## Validation

- Server and plugin builds pass.
- Retained-product cold **at/in** pass on the exact isolated official
**2.2.6** CLI and minimum **2.2.3** CLI.
- `git diff --check` passes.

Reviewed all connect callers: initial launch, explicit post-cold
reconnection and later observation. The separate standalone Electron
preview Key:a test failure remains outside this fixture correction.
@pascalandr

Copy link
Copy Markdown
Contributor Author

Integrated qualification CI successful

The failed-job rerun completed successfully: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/42412855101/attempts/2. The complete integrated scheduled-wake workflow is now successful, including ensuing platform builds. The first-attempt startup and standalone Electron observations remain recorded above.

Both the integrated correction (#1350) and recommendation (#1379) now have successful full workflows. The separate #1380 fixture-only follow-up retains its documented Linux/Tauri Text file busy test failure. Recommended runtime remains 2.2.6, with minimum and dependency pins 2.2.3.

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