Repository navigation
fix(qapi): disable Claude tools before report execution - #441
Conversation
Fleet review (glm)Lens: requirements + adversarial. Reviewed PR #441 (head d62b893) against issue #440. All four acceptance criteria are satisfied by the diff: (1) claudeArgv() now includes "--tools", "" as a separate empty argument (internal/qapi/claude.go:128) and BuildInvocation launches exactly that argv, so tools are disabled before execution, not just rejected in the stream; (2) validInvocation (internal/qapi/runner.go:72-75) carves out the empty token only for an argv that exactly equals claudeArgv() — every other vector still rejects any empty or NUL argument, including near-misses (claudeArgv()+"extra", claudeArgv()[1:], per-index mutations), pinned by TestRunRejectsEmptyAndNULArgvBeforeStart which also proves rejected argv never launches a child; (3) tests pin both the argv contract (TestClaudeArgvContract, extended to all roles' BuildInvocation) and the validation boundary, and no Pi/OpenCode source changed; (4) docs/operating.md documents the pre-launch tool control with stream rejection kept as defense in depth. The end-to-end test TestQARunClaudeDisablesToolsBeforeLaunch pins the child argv, the env allowlist, and the bounded stdin frame. Adversarial checks found no way to carry an empty argument outside the fixed vector, no prompt/role content leaking into argv, and no NUL/empty bypass. No blocking findings. Suggestion (1)
Verdict: ready to merge |
Fleet review (glmflash)Lens: adversarial. Reviewed PR #441 (fix(qapi): disable Claude tools before report execution) against issue #440's acceptance criteria, attacking the validation boundary, the argv construction, and the relaxation's blast radius. The fixed Claude vector is the only argv permitted to carry an empty argument, and the authorization is a strict full-vector equality (slices.Equal against claudeArgv()), so no near-match — a prefixed flag alone, claudeArgv()[1:], appended tokens, or per-index mutations — can smuggle an empty or NUL argument. NUL bytes remain rejected in all positions including the fixed vector. Tests pin the argv contract, the validation boundary (including a bare {"--tools",""} vector and per-index empty/NUL mutations), and an end-to-end run with a hostile task string that never leaks into child argv or environment. Pi/OpenCode invocations are untouched. If a deployed Claude Code version lacks --tools, the run fails closed at launch rather than executing with tools. All four acceptance criteria are met; no blocking findings. Suggestion (1)
Question (1)
Verdict: ready to merge |
Fleet review (deepseek)Lens: evidence + test design. The diff is faithful to issue #440: Suggestion (2)
Question (1)
Verdict: ready to merge |
Fleet review (qwen38)Lens: evidence. Audited against issue #440's four acceptance criteria: all are met and grounded in real tests. The Suggestion (1)
Question (1)
Verdict: ready to merge |
Fleet review (mimo)Lens: requirements. Checked the diff against all four acceptance criteria of issue #440; none is contradicted, partially satisfied, or untestable as written. AC1 (Claude argv includes --tools "" as a separate empty argument before execution): satisfied — claudeArgv() in internal/qapi/claude.go inserts the pair "--tools", "", pinned exactly by TestClaudeArgvContract and observed across the real process boundary by TestQARunClaudeDisablesToolsBeforeLaunch (the recorded child argv must equal the fixed vector including the empty token). AC2 (validation still rejects empty arguments in any other vector; only the exact fixed Claude vector may carry the empty --tools value): satisfied — validInvocation in internal/qapi/runner.go permits an empty token only when the whole argv equals claudeArgv(); TestRunRejectsEmptyAndNULArgvBeforeStart rejects nil, {""}, {"--tools", ""}, generic/Pi-style vectors with empties, every mutated or extended/trimmed near-match of the Claude vector (each near-match retains the empty token and is therefore caught), all NUL cases, and invalid binary/cwd, each verified pre-launch via an unchanged launch marker. AC3 (tests pin argv and the validation boundary; Pi/OpenCode keep previous behavior): satisfied — no Pi/OpenCode argv builder is touched, and non-Claude vectors keep the previous empty-argument rejection (fixedClaude is false for them); the CLI test additionally pins that hostile task text travels only in the bounded stdin frame, never in argv or the child environment. AC4 (docs/operating.md documents the pre-launch tool control): satisfied — the new paragraph around docs/operating.md:354 documents --tools "" before launch and explicitly demotes stream tool-call rejection to defense in depth. No concrete failure scenario was found in the diff; the runtime effect of --tools "" on Claude Code itself is supported by the PR's stated six-role live smoke rather than re-verifiable from the diff alone (tests may not be executed during review). No findings. Verdict: ready to merge |
Post-merge QA (glm)Lens: requirements + adversarial. The merge does what #440 asked: claudeArgv() now carries --tools "" as a separate empty argument before execution, and validInvocation() in runner.go admits an empty argument only when the argv is exactly the fixed Claude vector (slices.Equal against claudeArgv()), so any near-miss, appended empty, NUL byte, or other backend vector stays pre-launch invalid. Tests pin the argv contract, the end-to-end child argv/env/stdin frame (hostile task never reaches argv or env), and the rejection matrix including every single-position mutation of the Claude vector; Pi/OpenCode invocations are differentially unchanged. docs/operating.md documents the pre-launch tool control with stream rejection as defense in depth. Adversarial check on the exact-match allowlist: a hostile caller cannot widen it because argv is built internally, and an exact match contains exactly one intentional empty token. No defects found. No findings. Verdict: clean |
Post-merge QA (deepseek)Lens: evidence + test design. The merge closes the pre-launch isolation gap of #440: claudeArgv() now carries Question (1)
Verdict: clean |
Fixes #440
Summary
--tools ""(separate empty argument) so built-in tools are disabled before launch, not only rejected in the output stream.docs/operating.mddocuments the pre-launch tool control; stream tool-call rejection stays as defense in depth.Verification
internal/qapi,internal/cli).go vet ./...andgo test ./...pass after rebasing on currentmain.