Skip to content

fix(mcp): workspace_state distinguishes not-configured from no-repos#57

Merged
smochan merged 1 commit into
mainfrom
feat/workspace-state-not-configured
May 30, 2026
Merged

fix(mcp): workspace_state distinguishes not-configured from no-repos#57
smochan merged 1 commit into
mainfrom
feat/workspace-state-not-configured

Conversation

@smochan

@smochan smochan commented May 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • `workspace_state` now returns a `status` field: `workspace_not_configured` / `workspace_empty` / `ok`.
  • `workspace_not_configured` payload includes a message telling the LLM that local-graph MCP tools still work independently.

v0.1.2 backlog item #9.

Test plan

  • 3 new tests in `tests/test_workspace_state_status.py`.
  • Existing workspace MCP tests green.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +6 / -0 / ~0 nodes, +22 / -0 edges

Findings (0)

No findings.

Triggered by codegraph CI · last run

@smochan smochan force-pushed the feat/workspace-state-not-configured branch from 44410da to beecf61 Compare May 30, 2026 17:13
@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +81 / -0 / ~0 nodes, +323 / -1 edges

Findings (1)

severity rule qualname file:line score message
low new-dead-code codegraph.mcp_server.server.GraphNotBuiltError.__init__ codegraph/mcp_server/server.py:28 10 Potentially unreachable new code

Triggered by codegraph CI · last run

When `~/.codegraph/workspace.yml` didn't exist, `workspace_state`
returned `{workspace_size: 0, repos: []}` — same shape as a configured
but empty workspace. LLMs read this as "everything is broken".

Result now carries a `status` field:
- `workspace_not_configured` when the YAML doesn't exist
- `workspace_empty` when it exists with no repos
- `ok` when there's at least one repo

The not-configured case includes a message clarifying that the local
single-repo MCP tools work independently — only the cross-repo tools
are affected.

v0.1.2 backlog item #9.
@smochan smochan force-pushed the feat/workspace-state-not-configured branch from beecf61 to ce8e71f Compare May 30, 2026 19:35
@github-actions

Copy link
Copy Markdown

codegraph PR review

Diff vs main · severity ≤ high

codegraph review (target: main)

Diff: +6 / -0 / ~0 nodes, +22 / -0 edges

Findings (0)

No findings.

Triggered by codegraph CI · last run

@smochan smochan merged commit 8903b60 into main May 30, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant