close
Skip to content

fix(dev-fleet): actionable error when no trusted git resolves (#2530) - #2553

Merged
iamwhatever merged 1 commit into
mainfrom
fix/devfleet-unresolved-tool-message-2530
Aug 10, 2026
Merged

fix(dev-fleet): actionable error when no trusted git resolves (#2530)#2553
iamwhatever merged 1 commit into
mainfrom
fix/devfleet-unresolved-tool-message-2530

Conversation

@bolichen97

Copy link
Copy Markdown
Collaborator

Summary

When Dev Fleet's trusted-binary resolver cannot find a git it is willing to run, the failure surfaced as a repository problem: git worktree discovery failed in <repo>: no trusted executable for 'git' in <PATH> — blaming a healthy checkout, echoing the whole trusted PATH into the UI as unactionable noise, and never naming KIROCREW_DEVFLEET_BIN_GIT, the operator override that is the actual remedy (already read at _trusted_bin).

Changes

  • _UNRESOLVED_TOOL_PREFIX — module constant giving the unresolved-tool failure an identity callers can branch on (startswith) instead of re-matching prose. _run_cmd uses it when synthesizing the stderr; the text itself is unchanged, so no existing consumer breaks.
  • _bin_override_var(name) — single source of truth for the override env-var name, shared by _trusted_bin (reads it) and the remedy messages (advertise it). Derived from the tool name (KIROCREW_DEVFLEET_BIN_{NAME}, dash→underscore), not hardcoded for git.
  • _discover_worktrees — checks the unresolved-tool case BEFORE the .git probe and the generic wrapper; raises a message that names the tool, states the checkout is not the problem, and gives the override remedy in the same voice as the missing-checkout branch. The trusted-PATH detail moves to a logger.warning line.
  • /api/sync (_sync_start_locked) — same remedy-first message at the git_bin is None branch; consistent with discovery.
  • Preserved: genuine git failures still surface _redact(raw)[:_GIT_ERR_MAX]; the sandbox-unavailable branch is unaffected (checked first, and unresolved-tool returns before the sandbox layer runs).

Tests

4 new tests, each verified to FAIL against unmodified code:

  • test_discover_worktrees_unresolved_git_blames_host_not_repo — message names git + KIROCREW_DEVFLEET_BIN_GIT, contains neither the trusted PATH, nor "worktree discovery failed", nor the repo path
  • test_discover_worktrees_real_git_error_not_misclassified — mid-string sentinel text still takes the genuine-git-error path
  • test_sync_unresolved_git_names_override_not_path/api/sync returns the same remedy-first message
  • test_bin_override_var_derivation — env-var derivation incl. dash mapping

Local gates: isort / flake8 / mypy clean; full pytest green in the dev_fleet area (host-env-only failures in unrelated modules).

Backend-only — no dashboard/API/i18n surface.

Closes #2530

@bolichen97
bolichen97 requested a review from a team as a code owner August 10, 2026 13:43
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Aug 10, 2026
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed feb58b5cb9d53704935ba03016507388f82a5b8e — this comment is updated in place on each push.

Review details

This is a small, well-contained refactor. The logic is coherent: the _UNRESOLVED_TOOL_PREFIX sentinel is placed on synthesized stderr in _run_cmd, matched via startswith in discovery, and the .git probe is correctly bypassed. The _bin_override_var derivation matches the reader in _trusted_bin. Existing consumers relying on the full stderr text still work because the prefix text is unchanged. Error-shape ({"ok": False, "error": ...}) matches the sibling npm branch.

No semantic defects survive falsification.

No findings.

[OPUS-REVIEWED] feb58b5

Verdict parsed from the review's SHA-scoped output markers for commit feb58b5cb9d53704935ba03016507388f82a5b8e.

False positive or not applicable? A repository writer can comment:
/ai-review override fable feb58b5cb9d53704935ba03016507388f82a5b8e: <one-sentence reason>

Comment thread src/kiro_crew/apps/builtins/dev_fleet/server.py Fixed
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Advisory design-level review of feb58b5cb9d53704935ba03016507388f82a5b8e — updated in place on each push; does not block merge.

Design-Verdict: PASS

Targeted reclassification at the right seam, with the sentinel-collision case tested; proportionate to the reported harm.

Suggestions

  • Other _run_cmd callers that surface stderr verbatim (e.g. the raw-error passthrough at server.py:3562 and run/pod command paths) still show the old no trusted executable … in <PATH> text; synthesizing the remedy-first message inside _run_cmd itself (logging the PATH there) would fix every surface at once and shrink the per-caller startswith branching — worth a follow-up if this failure recurs outside discovery/sync.

[DESIGN-REVIEWED] feb58b5

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of feb58b5cb9d53704935ba03016507388f82a5b8e and found no blocking issues.

This comment is updated in place on each push.

Review details

FINDING -- src/kiro_crew/apps/builtins/dev_fleet/server.py:3031 -- No trusted git makes the initial _git() return None, so "_unresolved_tool_message(\"git\")" is unreachable and /api/sync returns the generic error -> Fix: move the trusted-git check before the initial _git() call.
[GPT-REVIEWED] feb58b5

False positive or not applicable? A repository writer can comment:
/ai-review override gpt feb58b5cb9d53704935ba03016507388f82a5b8e: <one-sentence reason>

When _trusted_bin('git') resolves nothing, worktree discovery and /api/sync
used to blame the checkout ('git worktree discovery failed in <repo>: no
trusted executable...') and echo the whole trusted PATH into the UI, while
never naming KIROCREW_DEVFLEET_BIN_GIT — the operator override that is the
actual remedy.

- _UNRESOLVED_TOOL_PREFIX gives the failure an identity callers can branch
  on instead of re-matching prose; _run_cmd uses it when synthesizing the
  unresolved-tool stderr.
- _bin_override_var() is the single source of truth for the override env
  var name, shared by _trusted_bin (reads it) and the remedy messages
  (advertise it) — derived from the tool name, not hardcoded for git.
- _discover_worktrees checks the unresolved-tool case BEFORE the .git probe
  and raises a message that names the tool, states the checkout is not the
  problem, and gives the override remedy; the trusted-PATH detail moves to
  the log line.
- /api/sync's git_bin-None branch returns the same remedy-first message.
- Genuine git failures still surface git's own redacted, bounded message;
  a companion test proves mid-string sentinel text is not misclassified.

Closes #2530
@bolichen97
bolichen97 force-pushed the fix/devfleet-unresolved-tool-message-2530 branch from 72d1426 to feb58b5 Compare August 10, 2026 13:55
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Aug 10, 2026
@iamwhatever
iamwhatever merged commit 1005727 into main Aug 10, 2026
52 checks passed
@iamwhatever
iamwhatever deleted the fix/devfleet-unresolved-tool-message-2530 branch August 10, 2026 15:34
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Aug 10, 2026
encomjp pushed a commit to encomjp/kirocrew-customapi that referenced this pull request Aug 22, 2026
…tdev#2530) (kirodotdev#2553)

When _trusted_bin('git') resolves nothing, worktree discovery and /api/sync
used to blame the checkout ('git worktree discovery failed in <repo>: no
trusted executable...') and echo the whole trusted PATH into the UI, while
never naming KIROCREW_DEVFLEET_BIN_GIT — the operator override that is the
actual remedy.

- _UNRESOLVED_TOOL_PREFIX gives the failure an identity callers can branch
  on instead of re-matching prose; _run_cmd uses it when synthesizing the
  unresolved-tool stderr.
- _bin_override_var() is the single source of truth for the override env
  var name, shared by _trusted_bin (reads it) and the remedy messages
  (advertise it) — derived from the tool name, not hardcoded for git.
- _discover_worktrees checks the unresolved-tool case BEFORE the .git probe
  and raises a message that names the tool, states the checkout is not the
  problem, and gives the override remedy; the trusted-PATH detail moves to
  the log line.
- /api/sync's git_bin-None branch returns the same remedy-first message.
- Genuine git failures still surface git's own redacted, bounded message;
  a companion test proves mid-string sentinel text is not misclassified.

Closes kirodotdev#2530
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.

Dev Fleet blames the repo when it cannot resolve a trusted git

3 participants