Delivery init-stamp-is - #416
Merged
Merged
Conversation
llama.cpp's OpenAI-compatible server rejects tool schemas whose pattern
lacks ^...$ anchoring. isStartsWith("dag") serialized to ^dag and broke
every request carrying the workflow tool. isPattern(/^dag.*$/) keeps
identical starts-with semantics with a fully anchored pattern.Delivery dagid-schema-pattern
…agnostics The stamp listener (Command.Event.Executed) can lose the race with /init, leaving time_initialized NULL forever; re-running /init hits the same race. statusReason now heals the row when a non-empty AGENTS.md (the durable /init artifact) exists, and the no-artifact blocker carries the DB row state so stale identities are visible.
LeXwDeX
marked this pull request as ready for review
August 21, 2026 04:09
Shared XDG_CONFIG_HOME across bun test files let an earlier file's enabled global memory.jsonc turn the post-heal statusReason into a model-unavailable blocker on CI.
LeXwDeX
enabled auto-merge
August 21, 2026 04:49
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 21, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes#415
Why
The
/initstamp (project.time_initialized) is written only by aCommand.Event.Executedlistener (packages/opencode/src/project/project.ts:418-424). If the event is missed (subscription not yet established when/initruns), the stamp is never written and/memory onblocks with "run /init first" — re-running/initcan lose the same race again. Real case: a project carriedtime_initialized = NULLforever; recovery required manual sqlite surgery.What changed
packages/opencode/src/memory/memory.ts(statusReason): when the stamp is NULL but the worktree has a non-emptyAGENTS.md(the durable artifact/initproduces), heal the row viasetInitializedinstead of reporting the blocker. FSUtil is accessed throughEffect.serviceOptionso a missing wire degrades to no-heal, not a crash.time_initialized=NULL, worktree=..., sandboxes=...) so a stale identity (worktree pointing at a deleted clone) is visible at a glance.packages/opencode/test/memory/memory-init-stamp-selfheal.test.ts: both behaviors pinned (heal-on-artifact; blocker-with-diagnostics without artifact).Evidence
bun test test/memory/: 104 pass (existing fix(memory): /memory on fails silently for uninitialized projects — should tell the user to run /init #350 statusReason tests unchanged — they use no AGENTS.md, still blocked with diagnostics).bun typecheckclean;bun run test:dag-coregate passed.Checklist