Why
opencode run "/memory" (and run --command memory) hangs forever with zero output, while the same command via serve POST /session/:id/command returns instantly.
Mechanism
Early-return command dispatches (/memory at packages/opencode/src/session/prompt.ts:1887-1927, same shape as /trust) write a user message + text parts and return WITHOUT any assistant step. The run CLI waits for a turn-completion signal (assistant step-finish / session idle) that these commands never emit, so it waits forever.
Evidence
Acceptance
Why
opencode run "/memory"(andrun --command memory) hangs forever with zero output, while the same command via servePOST /session/:id/commandreturns instantly.Mechanism
Early-return command dispatches (
/memoryatpackages/opencode/src/session/prompt.ts:1887-1927, same shape as/trust) write a user message + text parts and return WITHOUT any assistant step. The run CLI waits for a turn-completion signal (assistant step-finish / session idle) that these commands never emit, so it waits forever.Evidence
run "/memory"hangs in bare and configured repos alike; serve +/command{command:"memory"}returns the full parts payload in <1srun --command memoryhangs identically - pre-existing gap, NOT a fix: headless init does not stamp project time_initialized so memory stays inert #405 regression (before fix: headless init does not stamp project time_initialized so memory stays inert #405 the text path never reached the real dispatch; the model improvised an answer)run "/memory"Acceptance
opencode run "/memory"prints the status and exitsrun "/trust",run "/goal"(same early-return shape) verified