Skip to content

Ending prompt with an absolute path blocks starting inference. #54190

Closed

Description

@rjeffman

Description

When a prompt ends with an absolute path (e.g. list files in /tmp), typing Enter is not possible and No matching commands is displayed.

It seems opencode treats the absolute path as a slash command.

Using quotes fix the issue.

Plugins

None.

OpenCode version

opencode v2.0.20

Steps to reproduce

Type list files in /tmp and try to hit ENTER.

Screenshot and/or share link

Image

Operating System

macOS 26

Terminal

Kitty

Activity

  1. opencode-agent commented on Oct 9, 2026

    @opencode-agent
    Contributor

    Thanks for the clear report! I can reproduce this on 2.0.20, and it still happens on the latest v2 branch (d2905b8).

    Steps: type list files in /tmp in the prompt with no trailing space. The slash-command popup opens with No matching commands, and Enter does nothing. The prompt isn't sent. The recording and screenshot below show this, and the script below reproduces it.

    From the code, a / typed after a space starts a slash-command lookup, as long as no space or second / follows it. While that popup is open, Enter is ignored even when no command matches. Until this is fixed, these should work around it: quote the path (as you found), add a trailing space or other text after the path, or press Esc to close the popup before pressing Enter.

    recording.mp4

    Screenshot

    Reproduction script (drive.ts)
    // Reproduces anomalyco/opencode#54190: a prompt ending with an absolute path
    // (e.g. "list files in /tmp") opens the slash-command menu ("No matching commands")
    // and Enter does not submit the prompt.
    import { Effect } from "effect"
    import { OpenCodeDriver } from "opencode-drive"
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tui: { recording: true, keypressOverlay: true },
      },
      ({ ui }) =>
        Effect.gen(function* () {
          yield* ui.screenshot("01-home")
          yield* ui.type("list files in /tmp")
          yield* Effect.sleep(800)
          yield* ui.screenshot("02-typed")
          yield* ui.enter()
          yield* Effect.sleep(2000)
          yield* ui.screenshot("03-after-enter")
          const frame = yield* ui.capture()
          const text = JSON.stringify(frame)
          const menu = text.includes("No matching commands")
          // No LLM response is queued: if the prompt were submitted, Drive would report an unexpected request.
          const answered = text.includes("Thinking") || !text.includes("list files in /tmp")
          yield* Effect.log(`menu visible after Enter: ${menu}; response shown: ${answered}`)
          if (!menu || answered) return yield* Effect.fail(new Error("Did not reproduce: prompt was submitted"))
          yield* Effect.log("REPRODUCED: Enter did not submit; 'No matching commands' shown")
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  2. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Fixed by #54857, released in v2.0.28: the command menu now only opens when / is at the start of the prompt, so a prompt that ends in a path like /tmp sends normally. If you still see this on v2.0.28 or later, comment and we'll reopen.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions