Skip to content

Add detail_level and max_flows to get_affected_flows (fixes #849) - #853

Open
asemraza wants to merge 1 commit into
tirth8205:mainfrom
asemraza:feat/affected-flows-detail-level
Open

Add detail_level and max_flows to get_affected_flows (fixes #849)#853
asemraza wants to merge 1 commit into
tirth8205:mainfrom
asemraza:feat/affected-flows-detail-level

Conversation

@asemraza

Copy link
Copy Markdown

Fixes #849

Problem

get_affected_flows_tool is step 2 of the documented review-pr workflow with its <=800-token target, but it was the only tool in the chain without detail_level and had no result bound. Each flow embeds a full steps list, so a 75-file change set produced a 247k-token response.

Change

  • detail_level="minimal": per-flow metadata only (id, name, criticality, depth, node_count, file_count), same convention as the sibling tools.
  • max_flows (default 50, 0 disables): bounds the returned list. total always reports the untruncated count and truncated flags the cut, mirroring the impact-radius truncation contract. The summary appends "showing N" when truncated.

Both parameters are wired through the MCP tool wrapper with updated docstrings.

Tests

Three new tests: minimal drops steps/path, max_flows truncates with correct total/truncated/summary, max_flows=0 disables the limit. Full suite 2,401 passed, ruff and mypy clean.

get_affected_flows_tool was the only tool in the review chain without
detail_level, and it had no result bound. Every flow carries a full
steps list, so a 75-file change set returned a 247k-token response in
the middle of the documented minimal-first workflow.

detail_level="minimal" strips flows to per-flow metadata (name,
criticality, depth, counts). max_flows bounds the list (default 50,
0 disables); total always reports the untruncated count and truncated
flags the cut, mirroring the impact-radius truncation contract.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_affected_flows_tool has no detail_level or limit parameter and returns 247k+ tokens, breaking the documented token budget

1 participant