Summary
codelens --lsp-status (top-level flag) and codelens lsp-status (subcommand) return different payload shapes, despite the documentation treating them as the same operation.
Evidence
Path A — top-level flag (scripts/codelens.py:829-837):
# Handle --lsp-status as a special top-level flag (not a subcommand)
if "--lsp-status" in sys.argv:
try:
from hybrid_engine import get_lsp_status
status = get_lsp_status()
print(format_output(status, _default_format, "lsp-status"))
sys.exit(0)
except Exception as e:
...
Returns: hybrid_engine.get_lsp_status() payload.
Path B — subcommand (scripts/commands/lsp_status.py, auto-registered as "lsp-status"):
Calls lsp_client.detect_available_servers() and returns its payload.
The two functions (hybrid_engine.get_lsp_status vs lsp_client.detect_available_servers) are defined in different modules and emit different JSON shapes.
Impact
- User confusion:
codelens --lsp-status and codelens lsp-status look interchangeable in docs but produce different output. AI agents that parse the response schema have to handle two shapes.
- MCP exposure: The MCP server exposes only the subcommand path (
codelens_lsp_status -> lsp_client). CLI users typing --lsp-status get a different result than MCP clients calling the tool with the same name.
- Documentation drift:
SKILL-QUICK.md mentions only lsp-status; the top-level --lsp-status flag is undocumented in the trigger map but intercepted in code.
Repro
diff <(python3 scripts/codelens.py --lsp-status --format json | python3 -m json.tool) \
<(python3 scripts/codelens.py lsp-status --format json | python3 -m json.tool)
# Output differs (different top-level keys, different per-server fields).
Suggested fix
Pick one of:
- (A) Consolidate on the subcommand. Remove the top-level
--lsp-status interception in codelens.py:829-837. Update commands/lsp_status.py to call hybrid_engine.get_lsp_status() (the richer payload) instead of lsp_client.detect_available_servers(). This makes CLI and MCP behavior identical.
- (B) Keep both but unify the payload. Make
lsp_client.detect_available_servers() and hybrid_engine.get_lsp_status() return the same schema, and document both entry points explicitly in SKILL-QUICK.md trigger map.
Either way, add a test that asserts both invocations produce structurally-equal JSON (same top-level keys).
Files
scripts/codelens.py (L829-837)
scripts/commands/lsp_status.py
scripts/hybrid_engine.py (get_lsp_status)
scripts/lsp_client.py (detect_available_servers)
SKILL-QUICK.md (trigger map)
Summary
codelens --lsp-status(top-level flag) andcodelens lsp-status(subcommand) return different payload shapes, despite the documentation treating them as the same operation.Evidence
Path A — top-level flag (
scripts/codelens.py:829-837):Returns:
hybrid_engine.get_lsp_status()payload.Path B — subcommand (
scripts/commands/lsp_status.py, auto-registered as"lsp-status"):Calls
lsp_client.detect_available_servers()and returns its payload.The two functions (
hybrid_engine.get_lsp_statusvslsp_client.detect_available_servers) are defined in different modules and emit different JSON shapes.Impact
codelens --lsp-statusandcodelens lsp-statuslook interchangeable in docs but produce different output. AI agents that parse the response schema have to handle two shapes.codelens_lsp_status->lsp_client). CLI users typing--lsp-statusget a different result than MCP clients calling the tool with the same name.SKILL-QUICK.mdmentions onlylsp-status; the top-level--lsp-statusflag is undocumented in the trigger map but intercepted in code.Repro
Suggested fix
Pick one of:
--lsp-statusinterception incodelens.py:829-837. Updatecommands/lsp_status.pyto callhybrid_engine.get_lsp_status()(the richer payload) instead oflsp_client.detect_available_servers(). This makes CLI and MCP behavior identical.lsp_client.detect_available_servers()andhybrid_engine.get_lsp_status()return the same schema, and document both entry points explicitly inSKILL-QUICK.mdtrigger map.Either way, add a test that asserts both invocations produce structurally-equal JSON (same top-level keys).
Files
scripts/codelens.py(L829-837)scripts/commands/lsp_status.pyscripts/hybrid_engine.py(get_lsp_status)scripts/lsp_client.py(detect_available_servers)SKILL-QUICK.md(trigger map)