Skip to content

Stage - #8

Merged
devfire merged 7 commits into
mainfrom
stage
Jun 27, 2026
Merged

Stage#8
devfire merged 7 commits into
mainfrom
stage

Conversation

@devfire

@devfire devfire commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Fixes various issues from over eager LLM.

devfire and others added 7 commits June 20, 2026 14:20
…ed by grep and find

Introduces a WalkerConfig trait in common.rs with include_hidden(),
respect_gitignore(), and follow_symlinks() methods. Both GrepOptions and
FindOptions implement it, eliminating the duplicated WalkBuilder setup
in find.rs.
Eliminates lossy &str ↔ PathBuf round-tripping across tool boundaries.
The grep, find, and cat functions now accept &Path directly, avoiding
to_string_lossy() allocations in server.rs and preserving non-UTF-8
paths correctly.

- common::build_parallel_walker: &str → &Path
- grep::grep + internal helpers: &str → &Path
- find::find: &str → &Path
- cat::cat: &str → &Path
- server.rs: pass &PathBuf directly (auto-derefs to &Path)
- Remove now-unused testutil::path_str helper
…construction in server.rs

memories handler now matches the grep/find/cat pattern: spawn_blocking
-> map_err(join_error) -> match Ok(r) => r.into_call_tool_result().
Added ToolResponse::text() constructor for opaque-string tool outputs.
…with #[serde(default)]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Deduplicate default constants: args.rs const fns now delegate to the
  canonical DEFAULT_MAX_* constants in tools/mod.rs (single source of truth)
- OutputMode is now typed end-to-end: derives Deserialize/Default/JsonSchema,
  GrepArgs.output_mode is OutputMode instead of String, invalid values fail at
  deserialization rather than handler time; removes from_str_lossy and the
  default_output_mode fn
- into_call_tool_result no longer duplicates the content string in
  structured_content (content is already in Content::text; structured carries
  only metadata)
- cat.rs EOF-before-offset early return uses ToolResponse::text() instead of
  a hand-rolled 7-field struct literal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- server.rs memories handler: replace hand-rolled CallToolResult for the
  no-memory-dir case with tool_error(AppError::InvalidRequest(...)), matching
  every other error path in the same handler
- memory.rs: eliminate double-syscall on MEMORY.md index path — replace
  is_file() + read_to_string with a single read_to_string that matches on
  ErrorKind::NotFound to fall through to the directory listing
- args.rs default_max_bytes comment: moot — the // 5 MiB annotation lives on
  DEFAULT_MAX_BYTES in tools/mod.rs, which default_max_bytes() now delegates to

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@devfire devfire self-assigned this Jun 27, 2026
@devfire
devfire merged commit 1081f91 into main Jun 27, 2026
2 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