Skip to content

codegraph index tells you to run codegraph daemon stop, which the CLI rejects #2770

Closed

Description

@inth3shadows

When codegraph index can't stop the project's daemon, it says:

✗ Failed to index: Could not verify that the active CodeGraph daemon has stopped. Run `codegraph daemon stop` to stop it, then retry `codegraph index`.

That command doesn't exist. codegraph daemon takes no arguments, so following the advice fails:

$ codegraph daemon stop
error: too many arguments for 'daemon'. Expected 0 arguments but got 1.

codegraph daemon is an arrow-key picker (codegraph.ts#L1960-L1969). Without a TTY it only lists the daemons. The message is at codegraph.ts#L909, and the writer-lock message gives the same advice (writer-lock.ts#L241: "codegraph daemon stop if a shared daemon").

Seen on a 1.6.2 build of main at efff745 plus a few fixes that don't touch the daemon command or these messages (both are unchanged at 0abae11), Linux / WSL2, Node 22.23.2.

How I hit it. The daemon holding the index was an older build's, left running after the session that started it had ended (its parent was init). index reported unverified/still-running from stopDaemonAt, and the only way out was finding the pid with ps and sending SIGTERM. I didn't check whether the picker would have listed that daemon. Related: #2335 (a daemon outliving an upgrade) and #2311 (stopDaemonAt outcomes).

Possible fixes:

  • Make the messages say codegraph daemon, and mention that it's interactive.
  • Or add a non-interactive codegraph daemon stop [path] (default: the current project), which both messages could point to and scripts could call.

Activity

  1. danusha2345 commented on Oct 22, 2026

    @danusha2345
    Contributor

    #2373 (open since 2026-10-06) is the first of your two options: both messages — index's "Could not verify that the active CodeGraph daemon has stopped" and the writer-lock's — name codegraph daemon and say to pick the daemon there instead of the daemon stop that the CLI rejects. It changes the two strings and nothing else, so it is independent of a non-interactive codegraph daemon stop [path], which would be a sensible follow-up for scripts (and for the case you hit, a daemon whose session is gone). The PR is rebased on current main and mergeable.

  2. inth3shadows commented on Oct 22, 2026

    @inth3shadows
    ContributorAuthor

    Thanks, @danusha2345. I missed #2373 when filing. I checked its diff at 6a4e200: both messages now say codegraph daemon and no longer say daemon stop, and the tests assert that. That covers the first option.

    I'll leave this issue open for the second option, a non-interactive codegraph daemon stop [path], for scripts and hooks that can't drive a picker. I still haven't checked whether the picker lists a daemon whose session has ended, which is the case I hit.

  3. added a commit that references this issue on Oct 22, 2026
    5e5dc21
  4. added a commit that references this issue on Oct 22, 2026
    3f58e34
  5. colbymchenry commented on Oct 22, 2026

    @colbymchenry
    Owner

    Thanks for the report, @inth3shadows.

    #2819 is merged to main. When the project's daemon lock names a process that isn't CodeGraph, such as a reused pid or a leftover lock, codegraph index now clears the stale lock and rebuilds, and codegraph unlock clears it too. When the lock is held by a CodeGraph process that doesn't answer, like the older daemon you hit, the message now names its pid and the command that stops it, instead of codegraph daemon stop.

    A non-interactive codegraph daemon stop [path] is left for a separate change, and @danusha2345's #2373 guided the wording. It ships in the next release.

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