Skip to content

feat: apply wise-mcp improvements — constrained inputs, recovery errors, next-action hints, GUI URLs, tool tags, typed config#198

Merged
ichoosetoaccept merged 1 commit intomainfrom
wise-mcp-improvements
Feb 24, 2026
Merged

feat: apply wise-mcp improvements — constrained inputs, recovery errors, next-action hints, GUI URLs, tool tags, typed config#198
ichoosetoaccept merged 1 commit intomainfrom
wise-mcp-improvements

Conversation

@ichoosetoaccept
Copy link
Member

@ichoosetoaccept ichoosetoaccept commented Feb 24, 2026

Description

Aligns the codereviewbuddy MCP server with wise-mcp skill best practices and Arcade's 52 agentic tool design patterns. Implements all 9 improvements from the audit plan.

Changes by improvement

#1 Constrained inputsstatus parameters use Literal["resolved", "unresolved"], TriageItem.severity uses Literal["bug", "flagged", "warning", "info"], action uses Literal["fix", "reply", "create_issue"], limit on list_recent_unresolved uses Annotated[int, Field(ge=1, le=50)].

#2 Recovery-guided errors — new _recovery_error() helper in server.py classifies exceptions (auth, rate limit, not found, workspace, GraphQL, config) and returns actionable recovery hints. All 13 tool handlers updated.

#3 Next-action hintsnext_steps: list[str] added to TriageResult, ResolveStaleResult, StackReviewStatusResult, CIDiagnosisResult. Populated contextually (e.g. "Fix the 2 bug/flagged items first").

#4 Async-wrap diagnose_cidiagnose_ci call wrapped in call_sync_fn_in_threadpool() to avoid blocking the event loop.

#5 GUI URLscomment_url added to TriageItem, url added to ReviewComment. GraphQL query updated to fetch comment URLs.

#6 Typed config responseConfigInfo now includes an explanation field with a human-readable summary of active configuration highlights.

#7 Tool classification tags — all 13 tools tagged query, command, or discovery via @mcp.tool(tags={...}).

#8 Empty result messagesmessage field added to result models. Populated when results are empty (e.g. "No actionable threads — all threads have owner replies or are resolved.").

#9 Limit parameter boundslist_recent_unresolved limit uses Annotated[int, Field(ge=1, le=50)] so the JSON Schema communicates bounds.

Also includes

  • README updates: 5 missing tools added to table, new Features sections (Triage & CI, Agent Experience), updated workflow, FastMCP v3 stable (removed RC disclaimer)
  • 13 new tests for _recovery_error covering all classification branches
  • Existing test assertion updated for new error message format

Checklist

  • Tests added/updated
  • Documentation updated
  • poe check passes
  • Commit messages follow conventional commits

Related Issues

Closes #136 (PEP 758 false positive acknowledged in plan)

Copy link
Member Author

ichoosetoaccept commented Feb 24, 2026

@greptile-apps
Copy link

greptile-apps bot commented Feb 24, 2026

Greptile Summary

Implements 9 wise-mcp improvements to enhance agent experience: constrained inputs via Literal types and Field bounds, recovery-guided errors with _recovery_error() classifier, next-action hints via next_steps fields, async-wrapped diagnose_ci, GUI URLs (comment_url, url), typed config with explanation, tool classification tags, empty result messages, and validated limit bounds. All 13 MCP tools updated to return structured guidance. README updated with 5 missing tools, new Agent Experience section, and removed FastMCP RC warnings. Includes 13 new tests for error recovery covering all classification branches.

Confidence Score: 5/5

  • Safe to merge — well-tested improvements with comprehensive test coverage and no breaking changes
  • All 9 improvements are backwards-compatible additions. New _recovery_error helper has 13 tests covering all branches. Type constraints use Literal correctly without breaking existing callers. Next-steps logic is additive (new fields with defaults). All changes follow established patterns in the codebase.
  • No files require special attention

Important Files Changed

Filename Overview
src/codereviewbuddy/models.py Added next_steps, message, url, comment_url, and explanation fields; constrained severity/action with Literal types
src/codereviewbuddy/server.py Added _recovery_error helper for error classification; added tool tags; constrained status parameter with Literal; added bounds to limit parameter; async-wrapped diagnose_ci; added config explanation
src/codereviewbuddy/tools/comments.py Added GraphQL url field fetch; populated next_steps/message in results; extracted _thread_to_triage_item and _build_triage_hints helpers; added comment_url to triage items
tests/test_server.py Added 13 tests for _recovery_error covering all error classification branches (auth, rate limit, not found, workspace, GraphQL, config, generic)
README.md Added 5 missing tools to table, new Agent Experience and Triage & CI sections, removed FastMCP RC warnings, updated workflow with next_steps guidance

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Tool Handler Called] --> B{Try Tool Operation}
    B -->|Success| C[Populate next_steps hints]
    C --> D[Return Result with guidance]
    B -->|Exception| E[_recovery_error classifier]
    E --> F{Error Type?}
    F -->|GhNotFoundError| G[Auth error: Install gh CLI]
    F -->|GhNotAuthenticatedError| H[Auth error: Run gh auth login]
    F -->|Rate limit/403| I[Wait 60s and retry]
    F -->|Not found/404| J[Check PR/repo exists]
    F -->|Workspace error| K[Set CRB_WORKSPACE or pass repo]
    F -->|GraphQL error| L[Retry once - transient issue]
    F -->|Config blocked| M[Call show_config to inspect]
    F -->|Generic| N[Generic fallback with hints]
    G --> O[Return error with recovery steps]
    H --> O
    I --> O
    J --> O
    K --> O
    L --> O
    M --> O
    N --> O
Loading

Last reviewed commit: edc542e

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Feb 24, 2026

Additional Comments (1)

src/codereviewbuddy/tools/stack.py
incorrect exception syntax — multiple exception types must be wrapped in parentheses

        except (ValueError, AttributeError):
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/codereviewbuddy/tools/stack.py
Line: 562

Comment:
incorrect exception syntax — multiple exception types must be wrapped in parentheses

```suggestion
        except (ValueError, AttributeError):
```

How can I resolve this? If you propose a fix, please make it concise.

@ichoosetoaccept
Copy link
Member Author

The except ValueError, AttributeError: syntax on line 562 is not a bug — it's valid Python 3.14+ syntax introduced by PEP 758 (Allow except and except* expressions without parentheses). This project requires Python 3.14+ (see badge and pyproject.toml).

The confidence score should not be impacted by this. All other observations in the review are accurate.

Copy link
Member Author

ichoosetoaccept commented Feb 24, 2026

Merge activity

  • Feb 24, 4:39 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 24, 4:40 PM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 24, 4:41 PM UTC: @ichoosetoaccept merged this pull request with Graphite.

@ichoosetoaccept ichoosetoaccept changed the base branch from 02-19-test-improve-ci-coverage to graphite-base/198 February 24, 2026 16:39
@ichoosetoaccept ichoosetoaccept changed the base branch from graphite-base/198 to main February 24, 2026 16:39
@ichoosetoaccept ichoosetoaccept merged commit 6d9ef26 into main Feb 24, 2026
7 checks passed
@ichoosetoaccept ichoosetoaccept deleted the wise-mcp-improvements branch February 24, 2026 16:41
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.

Auto-resolve PEP 758 false positives from AI reviewers

1 participant