You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
packages/loopover-engine/src/miner/agent-sdk-driver.ts is the Agent-SDK implementation of the CodingAgentDriver seam, the in-process sibling of cli-subprocess-driver.ts. Its run() method (line 152-168) builds the SDK session with only:
conststream=query({prompt: task.instructions,options: {cwd: task.workingDirectory,maxTurns: task.maxTurns,// Same edit-permission scope as the CLI-subprocess driver (#4266): `--permission-mode acceptEdits`// there, `acceptEdits` here — file edits run unattended inside the scoped worktree, nothing broader.permissionMode: "acceptEdits",hooks: options.hooks,},});
AgentSdkQueryOptions (line 29-34) structurally declares only cwd, maxTurns, permissionMode: "acceptEdits", and hooks — there is no allowedTools field at all, so nothing in this driver can ever pass one.
Its CLI-subprocess sibling had exactly this same gap and was fixed as #6840, whose fix is documented in detail at cli-subprocess-driver.ts:87-104:
--permission-mode acceptEdits alone (the CLI's own edit-permission scope, matching the label the Agent-SDK driver's permissionMode also uses, #4267) only auto-approves file EDIT tool calls -- it does NOT grant Read or Bash, so a real task (which needs both to explore the repo and run tests) got every one of those calls denied in a headless --print invocation with no TTY to resolve an interactive prompt, silently producing zero real work every time (#6840). --allowedTools Read Bash grants exactly the two additional tool classes the task actually needs...
The CLI driver's fix (defaultClaudeCliArgs, line 109) now passes --allowedTools Read Bash alongside --permission-mode acceptEdits. The Agent-SDK driver's own comment (agent-sdk-driver.ts:162-164) explicitly claims parity — "Same edit-permission scope as the CLI-subprocess driver" — but the actual Read/Bash allowlist half of that fix was never ported to this driver. The @anthropic-ai/claude-agent-sdk's permission-evaluation model does not implicitly grant Read/Bash from acceptEdits mode alone (this is the exact class of gap #6840 fixed for the CLI side); this package's own chat-grounding.ts (same miner/ directory) independently proves the SDK's real query() accepts an allowedTools option — it sets one (allowedTools: CHAT_GROUNDING_TOOL_NAMES) for its own, unrelated session.
If the SDK's acceptEdits mode has the same Read/Bash gap the CLI mode had, every live coding-agent attempt routed through createAgentSdkCodingAgentDriver silently produces zero real work (every Read/Bash tool call denied) while still returning a structured result message that looks like a completed, successful iteration — a wrong-but-plausible "success" with an empty diff, exactly #6840's failure mode, just on the sibling driver.
Requirements
Add an allowedTools field to AgentSdkQueryOptions (and to CreateAgentSdkDriverOptions if it needs to be caller-configurable, matching how hooks is already threaded through) so the SDK session can be given an explicit tool allowlist.
Update the stale "Same edit-permission scope as the CLI-subprocess driver" comment at agent-sdk-driver.ts:162-164 to accurately describe both the acceptEdits mode AND the allowedTools grant, matching the level of detail in the CLI driver's own comment.
Do not use a broader permission mode (e.g. bypassPermissions) to work around this — the CLI driver's own comment explicitly rejects that as "disabl[ing] edit-scope confirmation and any other safety rail the CLI has, not just the Read/Bash gap this task actually hits." Grant exactly Read/Bash, nothing broader.
Deliverables
allowedTools: ["Read", "Bash"] passed on the SDK session options in createAgentSdkCodingAgentDriver's run()
AgentSdkQueryOptions type updated to include the new field
Doc comment at the permissionMode/session-options call site corrected to describe the actual grant (mode + allowlist), not just the mode
Regression test using the existing injected-AgentSdkQueryFn test harness asserting the session options passed to query() include allowedTools containing Read and Bash
Test Coverage Requirements
This repo's Codecov patch gate is 99%+ hard (branch-counted) on every changed line/branch in src/**/packages/**. The regression test must assert the exact allowedTools value reaching query()'s options, not just that the driver "works" — this is a config-shape bug, so the test must inspect the constructed options object directly (same style as the existing driver-construction tests in test/unit/agent-sdk-driver.test.ts).
Expected Outcome
The Agent-SDK driver grants the coding agent Read and Bash tool access the same way the CLI-subprocess driver does post-#6840 — no more silent zero-work "successful" iterations from this driver caused by every exploration/test-running tool call being denied.
Links & Resources
packages/loopover-engine/src/miner/agent-sdk-driver.ts:29-34 (the options type missing the field), :152-168 (run(), the session construction), :162-164 (the stale parity comment). packages/loopover-engine/src/miner/cli-subprocess-driver.ts:87-109 (defaultClaudeCliArgs, the sibling's #6840 fix and its detailed doc comment). packages/loopover-engine/src/miner/chat-grounding.ts:265 (proof the SDK's query() accepts allowedTools).
Context
packages/loopover-engine/src/miner/agent-sdk-driver.tsis the Agent-SDK implementation of theCodingAgentDriverseam, the in-process sibling ofcli-subprocess-driver.ts. Itsrun()method (line 152-168) builds the SDK session with only:AgentSdkQueryOptions(line 29-34) structurally declares onlycwd,maxTurns,permissionMode: "acceptEdits", andhooks— there is noallowedToolsfield at all, so nothing in this driver can ever pass one.Its CLI-subprocess sibling had exactly this same gap and was fixed as #6840, whose fix is documented in detail at
cli-subprocess-driver.ts:87-104:The CLI driver's fix (
defaultClaudeCliArgs, line 109) now passes--allowedTools Read Bashalongside--permission-mode acceptEdits. The Agent-SDK driver's own comment (agent-sdk-driver.ts:162-164) explicitly claims parity — "Same edit-permission scope as the CLI-subprocess driver" — but the actual Read/Bash allowlist half of that fix was never ported to this driver. The@anthropic-ai/claude-agent-sdk's permission-evaluation model does not implicitly grantRead/BashfromacceptEditsmode alone (this is the exact class of gap #6840 fixed for the CLI side); this package's ownchat-grounding.ts(sameminer/directory) independently proves the SDK's realquery()accepts anallowedToolsoption — it sets one (allowedTools: CHAT_GROUNDING_TOOL_NAMES) for its own, unrelated session.If the SDK's
acceptEditsmode has the same Read/Bash gap the CLI mode had, every live coding-agent attempt routed throughcreateAgentSdkCodingAgentDriversilently produces zero real work (every Read/Bash tool call denied) while still returning a structuredresultmessage that looks like a completed, successful iteration — a wrong-but-plausible "success" with an empty diff, exactly #6840's failure mode, just on the sibling driver.Requirements
allowedToolsfield toAgentSdkQueryOptions(and toCreateAgentSdkDriverOptionsif it needs to be caller-configurable, matching howhooksis already threaded through) so the SDK session can be given an explicit tool allowlist.run()must passallowedTools: ["Read", "Bash"](or the SDK's equivalent tool-name spelling — verify against howchat-grounding.tsnames its ownCHAT_GROUNDING_TOOL_NAMESentries) alongsidepermissionMode: "acceptEdits", mirroring the CLI driver's--allowedTools Read Bashfix for claude-cli driver's --permission-mode acceptEdits denies every Read/Bash call, silently blocking all real work #6840.agent-sdk-driver.ts:162-164to accurately describe both theacceptEditsmode AND theallowedToolsgrant, matching the level of detail in the CLI driver's own comment.bypassPermissions) to work around this — the CLI driver's own comment explicitly rejects that as "disabl[ing] edit-scope confirmation and any other safety rail the CLI has, not just the Read/Bash gap this task actually hits." Grant exactlyRead/Bash, nothing broader.Deliverables
allowedTools: ["Read", "Bash"]passed on the SDK session options increateAgentSdkCodingAgentDriver'srun()AgentSdkQueryOptionstype updated to include the new fieldpermissionMode/session-options call site corrected to describe the actual grant (mode + allowlist), not just the modeAgentSdkQueryFntest harness asserting the session options passed toquery()includeallowedToolscontainingReadandBashTest Coverage Requirements
This repo's Codecov patch gate is 99%+ hard (branch-counted) on every changed line/branch in
src/**/packages/**. The regression test must assert the exactallowedToolsvalue reachingquery()'s options, not just that the driver "works" — this is a config-shape bug, so the test must inspect the constructed options object directly (same style as the existing driver-construction tests intest/unit/agent-sdk-driver.test.ts).Expected Outcome
The Agent-SDK driver grants the coding agent
ReadandBashtool access the same way the CLI-subprocess driver does post-#6840 — no more silent zero-work "successful" iterations from this driver caused by every exploration/test-running tool call being denied.Links & Resources
packages/loopover-engine/src/miner/agent-sdk-driver.ts:29-34(the options type missing the field),:152-168(run(), the session construction),:162-164(the stale parity comment).packages/loopover-engine/src/miner/cli-subprocess-driver.ts:87-109(defaultClaudeCliArgs, the sibling's #6840 fix and its detailed doc comment).packages/loopover-engine/src/miner/chat-grounding.ts:265(proof the SDK'squery()acceptsallowedTools).