Agents still need shell fallbacks to finish code investigation and review #555
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
#521 Tool discovery and replies cost extra calls, while review and navigation still have gaps
h-dv/code-index
#531 Resolved references can name unrelated methods, global names and function-local types
h-dv/code-index
#553 detect_root: a parent's .code-index.toml captures nested git worktrees/clones — agent worktree sessions silently answer from the wrong tree
h-dv/code-index
#556 Fallback-rate metric: measure shell-on-indexed-code per agent session + agent task benchmark (zero-fallback, do first)
h-dv/code-index
#557 Reply diet: semantics once per session, provenance scoped to the answer, grep-parity line text (zero-fallback)
h-dv/code-index
#558 Before/after view of a change: include_hunks on changed_symbols/review_diff, read_code rev= (zero-fallback)
h-dv/code-index
Reference
h-dv/code-index#555
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope (consolidated 2026-11-12)
An agent should be able to investigate indexed code and review a change without switching to shell source inspection. Wrong answers, unavailable workflows, reply cost and lifecycle delays can each force that switch. This ticket owns the goal and its measurements; implementation belongs to the linked canonical tickets. Every remaining fallback must have a recorded tool call, cost and filed gap.
Priority: High · Risk: wrong answer · Size: L
Merged into this ticket: #556 (Fallback metric and task benchmark)
Done
worktree_git_file_beats_outer_configincrates/indexer/src/project.rsanddaemon_survives_spawning_client_group_signalincrates/mcp-server/tests/mcp_smoke.rs.twenty_clients_attach_with_every_read_connection_held,crates/daemon/tests/handshake_saturation_e2e.rs, andfailed_commit_rolls_back_and_the_connection_can_commit_durably,crates/indexer/tests/owned_transaction.rs.crates/indexer/tests/fallback_rate.rsuses production coverage and separates foreign/non-code/ambiguous calls; its git-log control is at line 643 (e5467bfb/be13b777).crates/mcp-server/tests/tool_ux_e3_e2e.rsandmcp_smoke.rs; their remaining workflow acceptance is in #521.Remaining
Fallback measurement
Workflow benchmark
Linked delivery and trust
Acceptance
Suggested order
Original report
Epic: zero fallback. No agent should want to switch back from code-index to the shell
Goal: an agent working on code reaches for code-index first and never needs
grep/rg/sed/cat/git showon indexed code. Where it still does, that fallback is a measured, filed gap, not a habit.Why now: on 2026-11-09, five implementation sessions (Claude lead + Codex workers) dogfooded code-index on this repo and logged every friction (
/tmp/claude-1000/dogfood-triage.md, summarised in #521 comments). Even the lead, who required code-index from every worker, fell back to the shell for diff review and corpus reads. Asked why, the answers were product gaps, not preferences.Why agents switch back (four causes, all observed 2026-11-09)
symbol_not_found/path_not_indexed/neverduring reconcile (#546); stdflushbound into another test crate (#531)semanticsstrings,evidence_gapsandanswer_provenancefor every linked tree (roughly 1 KB fixed per reply with 6 trees, observed); ~15k-token tools/list (#521);grep -ngives line+text in one call,search_textonly withline_text=truequery --root5–60 sPlan (order matters)
integration-1109), #554 (in progress), #531, #546's "not ready ≠ absent" item.Acceptance for the epic
On the agent task benchmark (sub-issue 1), the fallback rate on indexed code is ≤ 5% of code lookups, and every remaining fallback class has a filed issue. Tokens per completed task are ≤ the shell baseline.
Rule for every agent working in this repo
Use code-index first for anything about code. When you fall back to the shell, log the exact call, why, and what code-index should have done, and link it here or in #521. A fallback without a log entry is the only wrong move.
Tracking (filed 2026-11-09)
integration-1109)read_code rev=Baseline measured (#556 part 1, details there): lead session 30.6% fallback rate on indexed code, top shapes
sed -n/grep -n/git show/git diff. Workers on the wrong tree (#553): up to 66.7%. Workers after the--rootfix: 0–4.2%. So trust/routing and the reviewer workflow (#558, #559) are the levers. #553, #554 and #512 B are now fixed onintegration-1109.code-index queryCLI drops content items with response_format=text #561Dogfood from the C# recorded-base regression investigation in
codex-base(integration snapshote142099484f0). Full per-call findings below; corpus fallbacks reproduce known ad-hoc-root gap #559.D1 Setup provenance does not name the root
e142099484and sibling_worktrees 3, no path; tool description names the correct codex-base rootD2 Read refused during reconcile
D3 Corpus source outside roots (#559)
D4 Short-term search is not searched
D5 + Exact regression path located cheaply
D6 Corpus bind audit requires ad-hoc reads (#559)
D7 Corpus containing types outside roots (#559)
D8 Guessed metadata paths cost extra calls
D9 Struct/impl name ambiguous in impact
Epic: zero fallback — no agent should want to switch back from code-index to the shellto Agents still need shell fallbacks to finish code investigation and review