Skip to content

code_outline_batch + code_symbols_batch (next server-side turn-collapse)#22

Merged
madeye merged 2 commits intomainfrom
feat/code-batch-tools
Apr 20, 2026
Merged

code_outline_batch + code_symbols_batch (next server-side turn-collapse)#22
madeye merged 2 commits intomainfrom
feat/code-batch-tools

Conversation

@madeye
Copy link
Copy Markdown
Owner

@madeye madeye commented Apr 20, 2026

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

  • `code.outline_batch` RPC — `requests: Vec<{path}>` →
    `responses: Vec<{path, result?, error?}>`. Per-request errors
    don't abort the batch.
  • `code.symbols_batch` RPC — same shape over `code.symbols`.
  • Handler refactor — `code_outline` / `code_symbols` now go
    through `_inner(daemon, &params)` 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.
  • Bridge tool definitions — short, schema-only descriptions
    (the v3 prose-nudge regression result still applies; v5 v6
    validates that the model picks up new schema fields without
    imperative prose).

Why now

  • Six `code_symbols` calls in the v5 bench. Small target this
    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.
  • The `fs_read_batch` template generalises cleanly. Same return
    shape, same error semantics, same test pattern.

Test plan

  • `cargo fmt --all -- --check`
  • `cargo clippy --workspace --all-targets -- -D warnings`
  • `cargo test --workspace --all-targets` (102 passing —
    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

@madeye madeye force-pushed the feat/code-batch-tools branch from f391c70 to e4d9e40 Compare April 20, 2026 10:24
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.
madeye and others added 2 commits April 20, 2026 18:29
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, &params) -> 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>
@madeye madeye force-pushed the feat/code-batch-tools branch from e4d9e40 to 6e0f9c7 Compare April 20, 2026 10:30
@madeye madeye merged commit cdfca17 into main Apr 20, 2026
1 check passed
@madeye madeye deleted the feat/code-batch-tools branch April 20, 2026 10:37
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