• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dcdpr / jp / 18002699183

25 Sep 2025 09:11AM UTC coverage: 43.653% (-0.007%) from 43.66%
18002699183

push

github

web-flow
chore(tools): Add `git` and `web` tools and simplified file modification (#247)

This commit introduces two new tool categories and improves the existing
file system tools. The `git_commit` tool enables committing staged
changes directly from conversations, while `web_fetch` allows retrieving
web page contents. The file modification interface has been simplified
from complex change objects to simpler string replacement, to increase
success rate for LLMs.

The `fs_modify_file` tool now accepts `string_to_replace` and
`new_string` parameters instead of structured change objects, making it
more accessible. It includes fuzzy matching to handle whitespace
variations and provides better error messages.

Additional improvements include better empty result handling in
`fs_list_files` (showing "No files found" instead of empty arrays),
enhanced `cargo_check` output formatting, and more accurate git status
messaging.

Signed-off-by: Jean Mertz <git@jeanmertz.com>

79 of 176 new or added lines in 13 files covered. (44.89%)

2 existing lines in 2 files now uncovered.

5430 of 12439 relevant lines covered (43.65%)

6.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/.config/jp/tools/src/git/commit.rs
1
use std::{path::PathBuf, process::Command};
2

3
use crate::Error;
4

NEW
5
pub(crate) async fn git_commit(
×
NEW
6
    root: PathBuf,
×
NEW
7
    message: String,
×
NEW
8
) -> std::result::Result<String, Error> {
×
NEW
9
    let output = Command::new("git")
×
NEW
10
        .args(["commit", "--quiet", "--signoff", "--message", &message])
×
NEW
11
        .current_dir(root)
×
NEW
12
        .output()?;
×
13

NEW
14
    let error = str::from_utf8(&output.stderr).unwrap_or_default();
×
NEW
15
    if error.contains("fatal: not a git repository") {
×
NEW
16
        return Err("Not a git repository.".into());
×
NEW
17
    }
×
18

NEW
19
    if !output.status.success() {
×
NEW
20
        return Err(format!(
×
NEW
21
            "Git command failed ({}): {}",
×
NEW
22
            output.status.code().unwrap_or_default(),
×
NEW
23
            error,
×
NEW
24
        )
×
NEW
25
        .into());
×
NEW
26
    }
×
27

NEW
28
    let out = String::from_utf8(output.stdout).unwrap_or_default();
×
29

NEW
30
    Ok(indoc::formatdoc! {"
×
NEW
31
        Commit successful:
×
NEW
32

×
NEW
33
        ```
×
NEW
34
        {out}
×
NEW
35
        ```
×
NEW
36
    "})
×
NEW
37
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc