Skip to content

docAgentArgv

docAgentArgv(model, prompt, thinkingTokens?): object

Defined in: src/doc-agent-argv.ts:21

Build the argv for the PR-gated doc agent (issue #882, epic #875 Phase 3).

Structurally a sibling of import(”./reviewer-argv”).readonlyReviewerArgv: it reuses the exact hard-won spawn posture (subscription OAuth via —settings, NOT —bare; —safe-mode + enableAllProjectMcpServers to keep MCP both unloaded AND un-gated; disableAllHooks so an operator’s SessionStart skill-injection can’t thrash the unattended pane; —disable-slash-commands; —permission-mode dontAsk auto-denying anything off the allowlist). It is deliberately NOT —dangerously-skip-permissions: the agent reasons over recent source changes (untrusted history) and must not be able to run arbitrary commands or escape its disposable worktree.

The ONLY divergence from the read-only reviewer allowlist is bare Edit (the reviewer has bare Write only): the doc agent EDITS existing prose pages. It runs NO git mutation, NO gh, NO network, NO general Bash — the read-only git diff/log/show/status is for grounding only. All publishing (stage / commit / push / open-PR) is done by the trusted Shepherd server in DocAgentService.finalize(), never by the agent — so “never auto-commits to a published branch” is enforced by construction, not by prompt discipline. test/doc-agent-argv.test.ts asserts the absence of every publish/exec token.

string | null

string

number

object

argv: string[]

sessionId: string