Skip to content

fix: run mode hangs forever on early-return commands like memory and trust #409

Description

@LeXwDeX

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

  • opencode run "/memory" prints the status and exits
  • run "/trust", run "/goal" (same early-return shape) verified
  • Regression test: run-mode early-return command completes (exit 0, output non-empty)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions