code_outline_batch + code_symbols_batch (next server-side turn-collapse)#22
Merged
code_outline_batch + code_symbols_batch (next server-side turn-collapse)#22
Conversation
f391c70 to
e4d9e40
Compare
madeye
added a commit
that referenced
this pull request
Apr 20, 2026
Long-standing CI flake: same_path_same_socket and different_paths_different_sockets read XDG_RUNTIME_DIR via socket_path_for but didn't hold ENV_LOCK while doing it. Other tests in the module (socket_is_under_runtime_dir_when_set, socket_falls_back_to_tmp_when_runtime_dir_missing) flip the env under the lock — when those run concurrently, the lock-less tests see a flipped env mid-call and the two socket_path_for(p) results disagree. Surfaced again on PR #22's CI run today; the fix is small enough to fold into this PR rather than open a separate one.
Continues the M5 server-side turn-collapse line of work. Six
`code_symbols` calls landed in the v5 bench; cross-file refactors
will produce many more. Batching them into one MCP turn closes the
"loop over N files calling code_outline" pattern.
* New `code.outline_batch` and `code.symbols_batch` RPCs.
`requests: Vec<{path}>` -> `responses: Vec<{path, result?, error?}>`.
Per-request failures (missing path, unsupported language) don't
abort the batch — same contract as `fs_read_batch`.
* Daemon handlers refactored: each single-shot handler now thinks
in terms of `*_inner(daemon, ¶ms) -> Result<Result, RpcError>`
so the batch path can loop without re-parsing JSON or
duplicating the resolve_within / backend.* call sites.
* Bridge tool definitions for both new tools, kept short — no prose
nudges (the v3 prose-nudge experiment regressed wall-clock and
tokens; the v5 schema-only addition got picked up spontaneously).
* Integration test in `autospawn.rs` seeds two real .rs files and
one missing path, asserts symbol names land per-file and the
missing entry carries an `error` object.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e4d9e40 to
6e0f9c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continuation of the M5 wall-clock work. The v5 bench landed
`fs_read_batch` and `search_grep ?context` as model-independent
turn-collapsing tools; this PR adds the same shape for
`code_outline` and `code_symbols` so multi-file structural passes
become one round-trip.
What lands
`responses: Vec<{path, result?, error?}>`. Per-request errors
don't abort the batch.
through `_inner(daemon, ¶ms)` cores so the batch path
doesn't re-parse JSON or duplicate the `resolve_within` /
`backends.` call sites. Same shape we used for
`fs_read_inner` in PR M5 wall-clock regression: fs_read_batch + search_grep ?context (-51 turns, -51s) #21.
(the v3 prose-nudge regression result still applies; v5 v6
validates that the model picks up new schema fields without
imperative prose).
Why now
single sample but the access pattern is common in cross-file
refactors and multi-module code reviews — exactly the kind of
task the agent's likely to throw at the daemon.
shape, same error semantics, same test pattern.
Test plan
autospawn integration test seeds two real .rs files + one
missing path, asserts symbol names land per-file and the
missing entry carries an `error` object)
🤖 Generated with Claude Code