Skip to content

[Bug] CLI: resolve --mode is accepted, documented, and recommended but never affects retrieval #1007

Description

@AdityaPainuli

Area

Other

Potpie version

potpie v2.0.0

Install source

uv tool install potpie

System

macOS

Coding agent and model

No response

Command or workflow

# Identical retrieval regardless of mode
potpie --json resolve "how does the payment retry flow work?" --mode fast
potpie --json resolve "how does the payment retry flow work?" --mode deep

# Invalid values are accepted silently and echoed back
potpie --json resolve "some task" --mode garbage

# The MCP agent surface exposes the same inert parameter
# context_resolve(task=..., mode="deep")

What happened?

Problem

potpie resolve --mode (documented as fast | balanced | verify | deep, described as retrieval depth) is accepted and echoed back in the response, but no code path ever reads it.

Observed Behavior

  • ResolveRequest.mode and SearchRequest.mode have exactly two consumers in the engine, both metadata echoes: graph_service.py:125 and graph_service.py:139 (metadata={"mode": request.mode, ...}). Nothing downstream — orchestrator, readers, ranker — branches on it. The only retrieval-shaping preference on the read path is freshness_preference.
  • ResolveMode = str (domain/ports/agent_context.py:33) with the valid values living only in a comment, so --mode garbage is accepted and reported back as if it were a real mode.
  • The inert knob is advertised on three surfaces:
    • the CLI reference (docs/context-graph/cli-flow.md) documents --mode fast|balanced|verify|deep;
    • the MCP agent contract exposes mode: str = "fast" on context_resolve (adapters/inbound/mcp/server.py:106), so harness agents are offered a parameter that does nothing;
    • CONTEXT_RESOLVE_RECIPES assigns per-intent modes (balanced for review/operations/planning/refactor/security) and report_status.py serves them in the recommended recipe — so potpie status actively recommends a mode that resolve then discards.

Excepted Behavior

One of:

  • mode actually shapes retrieval (e.g. depth/limits/verification behavior differing between fast and deep), or
  • the value is validated against the documented set and the response transparently reports it as not yet implemented, rather than echoing it back as if it were honored.

Either way, an invalid --mode value should be rejected or flagged, not silently accepted.

Impact

Same failure class as #994 and #996: a documented flag that silently does nothing. Agents (and the skill/recipe guidance itself) select modes expecting different retrieval depth, spend nothing differently, and trust an output header that implies the mode was applied. Since the recommended recipes ship non-default modes, every agent following potpie status guidance is passing a dead parameter.

Source or build details

No response

Output or logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions