Skip to content

fix(read): a 404 on a file read lists the nearest existing directory - #35

Merged
mabry1985 merged 1 commit into
mainfrom
fix/missing-path-lists-nearest-dir
Sep 28, 2026
Merged

mabry1985 merged 1 commit into
mainfrom
fix/missing-path-lists-nearest-dir

Conversation

@mabry1985

Copy link
Copy Markdown
Member

Why

Langfuse showed a lot of ERROR tool spans on the QA reviewer (Vera). On protoAgent#3771, 26 of her 120 github_read_file / github_read_pr_file calls failed on paths that don't exist, such as apps/web/src/goals/GoalCreateDialog.tsx, settings/ThemeQuickDialog.tsx and design.css. The real file was settings/ThemeQuickButton.tsx.

Every miss returned the same message: repo '…' not found or not accessible, or the path/ref/number doesn't exist in it. To a model, that reads as an access problem. So the lane guessed another sibling path, one call and one ERROR span at a time.

Fix

When a file read gets a 404, read_tools._missing_path_hint probes up to 4 parent directories at the same ref. Each probe is a GET, per #29.

  • A parent exists: the error says the repo and ref are fine and the PATH is wrong, then lists that directory (up to 60 entries, dir/ suffixed). The model can pick the right file in one step.
  • No probed parent exists: the repo or ref is what's wrong, and the existing classified 404 is returned unchanged.
  • Non-404 failures (auth, rate limit) skip the probe entirely.

github_read_pr_file still fails loudly and never falls back to the default branch. The hint only improves the error text.

Verification

  • 5 new tests, and the full suite passes (319). ruff check and ruff format --check are clean.
  • Live against protoLabsAI/protoAgent through real gh:
    • ThemeQuickDialog.tsx on #3771 lists apps/web/src/settings (which contains ThemeQuickButton.tsx).
    • A valid read on #3773 is unchanged.
    • A bad ref returns the old classified error.

Rollout

Vera picks this up on her next image bump, which moves GITHUB_PLUGIN_REF in qaEngineer. Desktop agents get it through a plugin update.

🤖 Generated with Claude Code

A bare 404 from github_read_file / github_read_pr_file said "repo not found or
not accessible, or the path/ref/number doesn't exist". To a model, that reads as
an access problem. The QA panel then guessed sibling paths one call at a time:
on protoAgent#3771, 26 of its 120 reads were invented filenames.

On a 404, probe up to 4 parent directories at the same ref. If one exists, say
the repo and ref are fine and only the path is wrong, and list that directory
(capped at 60 entries). If none exists, the repo or ref is the problem, so the
classified error stands. A non-404 failure skips the probe.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

QA panel review — PASS

code-review-structural · head 6992b1dd2efa · formal

The panel's brief could not be read from this round's report (no delimited brief block). The findings below are unaffected.

No findings — the review came back clean.

findings JSON (machine-readable)
[]

@protoreview protoreview Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Promoting the PASS verdict for head 6992b1dd2efa: all checks terminal-green, zero unresolved review threads. (approve-on-green)

@mabry1985
mabry1985 merged commit b0ec4a0 into main Sep 28, 2026
3 checks passed
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