You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4a2a834
Browse filesBrowse the repository at this point in the historyBrowse files
Round-4 review: instance-scoped journal, crash-safe child recovery, awaited model release
- runtime_state rows carry the writing instance's directory; rehydration
is instance-scoped: a second location instance on the same db in one
v2 serve no longer hydrates (and N-fold polls/re-delivers) a sibling's
watchers; sibling rows are never pruned either
- foreign-pid child rows now mean 'child died with the process': the
snapshot requeues as plain pending entries and the row drops - never
restoring 'extracting', which permanently suppressed both extraction
paths on the resumed session
- foreign-pid wrap-up rows drop instead of inheriting (an inherited arm
could auto-fire compact/exit on the resumed session's first idle)
- SharedModelPool.release awaits the model dispose at zero refs - the
dropped promise could let the process exit while ONNX sessions were
still releasing (NAPI finalizer panic)
- the v2 adapter seeds its event-forwarding child set from the
rehydrated child map (ThatchRuntime.childSessionIds), so a below-root
reload keeps receiving child events
- restored sessions get a synthetic noReply re-attach notice
- test env save/restore for THATCH_DB_PATH
Copy file name to clipboardExpand all lines: docs/dev/features/opencode-plugin.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ the shared runtime needs. It is the lifecycle-level sibling of `CoreContext`
73
73
| compaction trigger |`client.tui.executeCommand("session_compact")`| none | degrade (no `session.compact` on the promise domain's Pick, and the built-in `/compact` is a TUI palette action calling the server endpoint directly - the server command registry only knows config/plugin-registered names; the wrap-up checklist and flush still run, the automatic compaction is skipped) |
74
74
| toasts |`client.tui.showToast`| none reachable | degrade (the `tui.toast.show` event has no producer surface from the promise context) |
75
75
| TUI app exit |`client.tui.publish`| none | degrade (the wrap-up exit's checklist and flush run; the process exit does not - upstream [anomalyco/opencode#50984](https://github.com/anomalyco/opencode/issues/50984)) |
76
-
| dispose |`dispose` hook | cleanup returned from `setup`| must be idempotent: v2 auto-reloads plugins on file change, and a non-idempotent cleanup doubles pollers/pumps/nudges. Volatile runtime state (extraction buffer + accepted entries, child bookkeeping, wrap-up arms, watcher definitions) is journaled to the `runtime_state` table and rehydrated on the next `setup()`: rows written by the same process (a reload) all restore; rows from a dead process are pruned unless the session is the `-c`/`-s` startup resume (crash recovery). The embedding model is refcounted per db path, so N location instances share one resident model |
76
+
| dispose |`dispose` hook | cleanup returned from `setup`| must be idempotent: v2 auto-reloads plugins on file change, and a non-idempotent cleanup doubles pollers/pumps/nudges. Volatile runtime state (extraction buffer + accepted entries, child bookkeeping, wrap-up arms, watcher definitions) is journaled to the `runtime_state` table - instance-scoped by the writing location's directory - and rehydrated on the next `setup()`: rows from the same process AND directory (a reload) all restore; rows from a dead process are pruned unless the session is the `-c`/`-s` startup resume, which inherits recovery-safe state only (buffer requeued, no live child bookkeeping - the child died with the old process). Restored sessions get a synthetic re-attach notice. The embedding model is refcounted per db path, so N location instances share one resident model |
ON CONFLICT (kind, session_id) DO UPDATE SET directory = excluded.directory, value = excluded.value, pid = excluded.pid, created_at = excluded.created_at`,
0 commit comments