Skip to content

fix: annotate Result type in item claim's with_backend_db closure - #177

Merged
getappz merged 1 commit into
masterfrom
fix/claim-arm-result-type-ambiguity
Jul 13, 2026
Merged

fix: annotate Result type in item claim's with_backend_db closure#177
getappz merged 1 commit into
masterfrom
fix/claim-arm-result-type-ambiguity

Conversation

@getappz

@getappz getappz commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

item_inner's "claim" arm builds Ok((outcome, item, target_branch)) inside a with_backend_db closure that also uses ? on backend errors. The closure's error type is meant to resolve to ErrorData (via the ?s inside it, e.g. .map_err(map_backend_err)?), but Ok(...) on its own has no direct evidence forcing that — rustc reported E0283, ambiguous between our impl From<AgentflareError> for ErrorData and core's reflexive impl<T> From<T> for T.

This passed CI (whatever rustc version is pinned there) but failed a genuinely clean build on a newer local toolchain (rustc 1.95.0) — confirmed via cargo clean -p agentflare + rebuild, with an unmodified Cargo.lock. Toolchain-sensitive inference edge case, not a logic bug.

Fix

Ok::<_, ErrorData>((outcome, item, target_branch)) — explicit annotation removes the ambiguity outright, independent of toolchain version.

Testing

  • cargo test --workspace — 412 passed, 0 failed
  • cargo clippy --workspace --all-targets -- -D warnings -A unsafe_code -A clippy::pedantic — clean
  • cargo fmt --check — clean

Summary by CodeRabbit

  • Refactor
    • Improved internal error-type clarity for the item claim operation without changing its behavior or user-visible results.

E0283: rustc couldn't infer the Result error type for
Ok((outcome, item, target_branch)) here — ambiguous between our own
impl From<AgentflareError> for ErrorData and core's reflexive
impl<T> From<T> for T. Toolchain-sensitive: passed CI's rustc but
failed a clean build on a newer local toolchain (1.95.0). Annotating
Ok::<_, ErrorData>(...) removes the ambiguity outright.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 789095e2-0e82-4d0f-8954-2adf335684be

📥 Commits

Reviewing files that changed from the base of the PR and between 93662a6 and 8e857bb.

📒 Files selected for processing (1)
  • src/mcp_server.rs

📝 Walkthrough

Walkthrough

The claim action’s database closure now explicitly annotates its Ok result with ErrorData, while preserving the existing tuple values and downstream worktree creation flow.

Changes

Claim action typing

Layer / File(s) Summary
Type the claim closure result
src/mcp_server.rs
The with_backend_db closure uses Ok::<_, ErrorData>(...) without changing its returned values or downstream behavior.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change in the PR.
Description check ✅ Passed The description covers Summary, Fix, and Testing; only the reviewer notes section is omitted.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/claim-arm-result-type-ambiguity

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit 2e018cd into master Jul 13, 2026
14 checks passed
@getappz
getappz deleted the fix/claim-arm-result-type-ambiguity branch July 13, 2026 22:52
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.

1 participant