git_show redacts the whole patch once per file header, on unbounded output
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 78/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- go
- Domaine
- performance, tooling
Piste de recherche
Start with internal/agent/tools/git.go at patchFile and the redaction loop, then trace how internal/gitx/gitx.go buffers Show output and how internal/agent/tools/tools.go limits the final result. Check existing tests around git_show and redaction first. Done means output is size limited, each file section is redacted once with cancellation checks, and a 1,000 file commit test completes within a bounded time.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
The git_show tool runs a full redaction pass over the entire git show output for every ---/+++ header in it, on output that is not bounded, to produce at most 24 KB. A commit that touches many files stalls the run.
Where
internal/agent/tools/git.go:122(patchFile)internal/agent/tools/git.go:155-167(loop ofredact.ApplyInover the whole output)internal/gitx/gitx.go:366,:549(Showoutput buffered without a limit)internal/agent/tools/tools.go:250-258(finishredacts again and cuts to 24,000 bytes)
Details
gitx.Show returns the whole git show --stat --patch <rev> output. The tool then loops over every header and calls redact.ApplyIn(file, out) on the entire output each time. A modified file has both headers, so the same name is applied twice. Each call is a full scan: a lower-cased copy of the text, every gated regular expression, the remembered-value search and a rebuilt string. The loop does not check the context. Cost is O(H x S) for H header lines and S patch bytes.
Impact
An investigator, reviewer, prover or fixer that calls git_show on a commit touching many files (an initial commit, a vendoring or formatting commit, a large merge) stalls. Estimate, not measured: 1,000 changed files with a 5 MB patch is about 2,000 passes over 5 MB, many minutes for one tool call. The wall-time cap is only checked between model calls, so it does not interrupt this. git_log lists such commits by default.
Steps to reproduce
- In a repository whose latest commit adds about 1,000 text files, run an agentic scan.
- Have the model call
git_showwith that commit's hash and nopath. - The tool call does not return for minutes while one core is busy in redaction.
Suggested fix
Bound the output first (read git show through a limit of a few MB, since only 24 KB is ever returned). Then redact each file's section once with its own name: split on diff --git boundaries and call ApplyIn(file, section) per section, which is O(S) in total. Check ctx.Err() between sections.
Acceptance criteria
-
git showoutput is read through a size limit - Each file section is redacted once, with its own file name
- The loop honors cancellation
- A test with a 1,000-file commit returns in bounded time
Getting started
- Relevant files: internal/agent/tools/git.go, internal/agent/tools/tools.go, internal/gitx/gitx.go
- How to run tests:
make test-short(Unix) or.\make.ps1 test-short(Windows PowerShell);make lintbefore you call it done - Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 50e92ec. Severity: medium. Effort: S. audit-key: performance|internal/agent/tools/git.go|gitShowTool
- Langage dominant
- Go
- Étoiles
- 0
- Forks
- 1
- Merge moyen
- 8 h 14 min
- PR mergées (30 j)
- 3
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de TMHSDigital/Spackle
-
ci good first issue severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
TMHSDigital/Spackle#206 ·
Les mainteneurs répondent en général sous 1 jour
-
ci severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
TMHSDigital/Spackle#205 ·
Les mainteneurs répondent en général sous 1 jour
-
bug good first issue severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
TMHSDigital/Spackle#199 ·
Les mainteneurs répondent en général sous 1 jour
-
bug good first issue severity: low
Difficulté 2/5 1-3 heures Accessibilité débutants 87/100
TMHSDigital/Spackle#195 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation good first issue severity: medium
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
TMHSDigital/Spackle#188 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de TMHSDigital/Spackle
Issues similaires
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedOuvertebug effort:s impact:med raised-by:worker risk:low to:worker
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
medici-finance/assay#8120 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
factory:subtask
Difficulté 1/5 Moins d'une heure Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
agent-substrate/substrate#4308 ·
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
celestiaorg/celestia-app#8877 ·
Les mainteneurs répondent en général sous 1 jour
-
sweep
Difficulté 1/5 Moins d'une heure Accessibilité débutants 84/100
bketelsen/truenas-mcp#112 ·
Les mainteneurs répondent en général sous 1 jour