diff --git a/docs/content/cli.mdx b/docs/content/cli.mdx index 44ead81..e45154c 100644 --- a/docs/content/cli.mdx +++ b/docs/content/cli.mdx @@ -134,8 +134,7 @@ your user permissions, and approval stays with you. Pull requests, remote branches, and exact local ranges use `snapshot-only` access because their target may not match the live checkout. The agent gets the temporary review input and must use only that input; it must not run commands -or read other files. Diffsplain prints one warning when a selected agent uses -this mode because of a target mismatch. +or read other files. Pass `--no-checkout-access` to use `snapshot-only` access for any target. This option affects agent notes only. It does not change the diff or the page. diff --git a/scripts/generate-summaries.mjs b/scripts/generate-summaries.mjs index 3d81244..06b0e13 100644 --- a/scripts/generate-summaries.mjs +++ b/scripts/generate-summaries.mjs @@ -89,7 +89,6 @@ const booleanFlags = new Set([ '--support-record', '--worktree', '--no-checkout-access', - '--access-warning-emitted', '--provider-read-only-warning-emitted', ]); @@ -348,15 +347,6 @@ try { emitFailedSupportRecord(2); process.exit(2); } -if ( - accessMode.mode === 'snapshot-only' && - accessMode.reason === 'target-mismatch' && - !rawArgs.includes('--access-warning-emitted') -) { - console.log( - 'Warning: This target does not map to the live checkout. Agent notes will use the supplied snapshot only.', - ); -} const readOnlyWarning = agentReadOnlyWarning(selectedAgent, accessMode); if ( readOnlyWarning && diff --git a/scripts/present.mjs b/scripts/present.mjs index 8caa2e2..bfed5fa 100755 --- a/scripts/present.mjs +++ b/scripts/present.mjs @@ -273,15 +273,6 @@ if (agentEnabled) { performance.now() - selectionStarted, ); agentArgs.push('--agent', selectedAgent); - if ( - accessMode.mode === 'snapshot-only' && - accessMode.reason === 'target-mismatch' - ) { - console.log( - 'Warning: This target does not map to the live checkout. Agent notes will use the supplied snapshot only.', - ); - agentArgs.push('--access-warning-emitted'); - } const readOnlyWarning = agentReadOnlyWarning(selectedAgent, accessMode); if (readOnlyWarning) { console.log(readOnlyWarning); diff --git a/tests/generate-summaries.test.mjs b/tests/generate-summaries.test.mjs index 7789c05..9649f7f 100644 --- a/tests/generate-summaries.test.mjs +++ b/tests/generate-summaries.test.mjs @@ -1866,13 +1866,11 @@ test("keeps disabled checkout access in the temporary snapshot context", async ( } }); -test("warns once and keeps a mismatched range in the snapshot context", async () => { +test("keeps a mismatched range in the snapshot context without warning", async () => { const repo = await makeRepo(); const directory = await mkdtemp(join(tmpdir(), "diffsplain-agent-access-")); const summaries = join(repo, "notes.json"); const output = join(repo, "diff-data.json"); - const warning = "Warning: This target does not map to the live checkout. Agent notes will use the supplied snapshot only."; - try { const codex = await accessRecordingCodex(directory, repo); const result = run( @@ -1893,7 +1891,7 @@ test("warns once and keeps a mismatched range in the snapshot context", async () ); assert.equal(result.status, 0, result.stderr); - assert.equal(result.stdout.split(warning).length - 1, 1); + assert.doesNotMatch(result.stdout, /does not map to the live checkout/); const calls = await recordedCalls(codex.calls); assert.ok(calls.length >= 2); for (const call of calls) { diff --git a/tests/present-agent.test.mjs b/tests/present-agent.test.mjs index 5e986a9..f9a1263 100644 --- a/tests/present-agent.test.mjs +++ b/tests/present-agent.test.mjs @@ -390,7 +390,7 @@ test("starts the note agent after the watch snapshot and stops cleanly", async ( } }); -test("warns once and passes snapshot-only access to a mismatched range", async () => { +test("passes snapshot-only access to a mismatched range without warning", async () => { const root = await mkdtemp(join(tmpdir(), "diffsplain-present-access-")); const repo = join(root, "repo"); const bin = join(root, "bin"); @@ -481,8 +481,7 @@ test("warns once and passes snapshot-only access to a mismatched range", async ( return value.notes?.complete ? value : undefined; }); - const warning = "Warning: This target does not map to the live checkout. Agent notes will use the supplied snapshot only."; - assert.equal(outputText().split(warning).length - 1, 1); + assert.doesNotMatch(outputText(), /does not map to the live checkout/); assert.equal(snapshot.notes.accessMode, "snapshot-only"); const agentCalls = (await readFile(calls, "utf8")) .trim()