Skip to content

fix: headless init does not stamp project time_initialized so memory stays inert - #405

Merged
LeXwDeX merged 3 commits into
devfrom
fix/404-headless-init-does
Aug 20, 2026
Merged

fix: headless init does not stamp project time_initialized so memory stays inert#405
LeXwDeX merged 3 commits into
devfrom
fix/404-headless-init-does

Conversation

@LeXwDeX

@LeXwDeXLeXwDeX commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Closes#404

Root cause (runtime-proven)

Headless /init (opencode run, serve POST /session/:id/message text part) delivered "/init" as plain text; slash-command routing existed only in the TUI client (client-side parse → POST /session/:id/command). SessionPrompt.command never ran → Command.Event.Executed never fired (sole publish site: prompt.ts:2144) → project.time_initialized stayed NULL → MEMORY fail-closed inert.

Fix

Server-side routing in handlers/session.ts: parseCommandPayload + promptOrCommand route single-text-part prompts that name a registered command through promptSvc.command; registry miss falls through to the plain prompt (existing semantics preserved). Both prompt and promptAsync endpoints covered. TUI /command handler byte-identical (additive change only).

Verification (verify node, independently reproduced)

  • RED proof at parent commit: repro arms 1 (run "/init") + 4 (serve message text) fail; controls (run --command init, serve /command) pass
  • GREEN on fix commit: 4/4 arms pass; E2E from-source run stamps non-NULL
  • Gates: typecheck 0 · lint 4838/4850 (zero new) · test:dag-core all floors · command/session suites 25/25

Sign up for freeto 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

@LeXwDeX