Skip to content

Add ACP runtime support#287

Open
andymac4182 wants to merge 1 commit intogetsentry:mainfrom
andymac4182:add-acp-runtime
Open

Add ACP runtime support#287
andymac4182 wants to merge 1 commit intogetsentry:mainfrom
andymac4182:add-acp-runtime

Conversation

@andymac4182
Copy link
Copy Markdown

Summary

  • add an Agent Client Protocol runtime backed by @agentclientprotocol/sdk
  • support custom ACP commands and registry-based agent resolution
  • thread ACP options through CLI, GitHub Action, schedule, extraction repair, synthesis, fix-quality, and JSON repair paths
  • document runtime = "acp" config and add coverage for ACP runtime/helper lanes

Verification

  • pnpm install --frozen-lockfile
  • pnpm lint
  • pnpm typecheck
  • pnpm build
  • pnpm test
  • pnpm -C packages/docs build
  • live ACP smoke with atlas alta agent run
  • positive-control Warden ACP scans for missing await, null property access, SQL injection, and an injected Alta null dereference

The guard has a second route now.

Comment thread src/sdk/runtimes/acp.ts
Comment thread src/sdk/runtimes/acp.ts
Comment thread src/sdk/runtimes/acp.ts Outdated
Comment thread src/sdk/runtimes/acp.ts Outdated
Comment thread src/sdk/runtimes/acp.ts
Comment thread src/config/schema.ts Outdated
Comment thread src/sdk/runtimes/acp.ts
Add an Agent Client Protocol runtime backed by @agentclientprotocol/sdk, including custom command and registry-based agent resolution. Thread ACP options through CLI, action, schedule, extraction repair, synthesis, fix-quality, and JSON repair paths so runtime=acp keeps model-backed execution on ACP. Document the new config and add coverage for runtime registration, config resolution, structured helper calls, and usage aggregation.

Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Comment thread src/sdk/runtimes/acp.ts
Comment on lines +128 to +136
throw new Error(`ACP registry agent ${registryId} has no distribution metadata`);
}

const npx = (distribution as Record<string, unknown>)['npx'];
if (npx && typeof npx === 'object') {
const npxConfig = npx as Record<string, unknown>;
const packageName = npxConfig['package'];
const args = npxConfig['args'];
if (typeof packageName !== 'string') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Calls to runAuxiliary() for deduplication and fix-evaluation are missing providerOptions, breaking ACP runtime support unless the WARDEN_ACP_COMMAND environment variable is set.
Severity: HIGH

Suggested Fix

Thread the providerOptions through to the runAuxiliary() calls in dedup.ts and judge.ts. This will ensure that the ACP configuration from warden.toml is correctly resolved and used during deduplication and fix-evaluation, aligning their behavior with other runtime paths.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sdk/runtimes/acp.ts#L128-L136

Potential issue: When the ACP runtime is configured (e.g., `runtime = "acp"`), auxiliary
workflows for deduplication (`dedup.ts`) and fix-evaluation (`judge.ts`) fail to pass
the necessary `providerOptions` to the `runAuxiliary()` function. This causes the ACP
runtime to fall back to requiring the `WARDEN_ACP_COMMAND` environment variable. If this
variable is not set, these operations will fail, ignoring any ACP configuration
specified in `warden.toml`. This breaks ACP support for these critical paths unless a
specific environment variable is manually configured.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1f4c264. Configure here.

Comment thread src/sdk/runtimes/acp.ts
durationMs: Date.now() - startedAt,
},
stderr: stderrChunks.join('').trim() || undefined,
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACP prompt stopReason is silently ignored

Medium Severity

The ACP runSkill always returns status: 'success' regardless of promptResult.stopReason. If the ACP agent stops due to a turn limit, budget constraint, or other non-success reason, the result is still marked as 'success'. This causes downstream analysis to attempt findings extraction on potentially incomplete output, misclassifying what would be a turn_limit or other failure as an extraction failure instead.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1f4c264. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant