fix: headless init does not stamp project time_initialized so memory stays inert - #405
Merged
Conversation
release: memory silent-failure repair + dag-auto routing reduction
LeXwDeX
marked this pull request as ready for review
August 20, 2026 17:26
This was referenced Aug 20, 2026
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 free
to 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 #404
Root cause (runtime-proven)
Headless
/init(opencode run, servePOST /session/:id/messagetext part) delivered "/init" as plain text; slash-command routing existed only in the TUI client (client-side parse →POST /session/:id/command).SessionPrompt.commandnever ran →Command.Event.Executednever fired (sole publish site:prompt.ts:2144) →project.time_initializedstayed NULL → MEMORY fail-closed inert.Fix
Server-side routing in
handlers/session.ts:parseCommandPayload+promptOrCommandroute single-text-part prompts that name a registered command throughpromptSvc.command; registry miss falls through to the plain prompt (existing semantics preserved). BothpromptandpromptAsyncendpoints covered. TUI/commandhandler byte-identical (additive change only).Verification (verify node, independently reproduced)
run "/init") + 4 (serve message text) fail; controls (run --command init, serve /command) pass