Skip to content

feat(driver): --plugin-dir, extraArgs, and per-run env passthrough - #1

Merged
dortort merged 3 commits into
mainfrom
feat/plugin-dir-passthrough
Aug 2, 2026
Merged

feat(driver): --plugin-dir, extraArgs, and per-run env passthrough#1
dortort merged 3 commits into
mainfrom
feat/plugin-dir-passthrough

Conversation

@dortort

@dortort dortort commented Jul 31, 2026

Copy link
Copy Markdown
Owner

What

Two small additions to the Claude driver / runner so tests can exercise Claude Code plugins and point a run at scenario-scoped locations:

  1. --plugin-dir + extraArgs passthroughRunOptions/AgentRunExtra gain pluginDir (→ --plugin-dir) and a generic extraArgs; buildArgs emits them and is exported for unit testing.
  2. Per-run env passthroughagent.run(prompt, { env }) merges the given vars over the base env (so it augments, never clobbers, the LLM proxy's ANTHROPIC_BASE_URL).

Why

The first consumer is the @dortort/scheduler e2e suite: it loads the plugin via --plugin-dir and isolates the scheduler's global state per-scenario via an env var (CLAUDE_SCHEDULER_STATE_DIR) — all without touching $HOME or the shared process env.

Testing

  • pnpm typecheck ✅, pnpm -r build
  • pnpm test ✅ — 84 tests, incl. new buildArgs coverage and an AgentHandle env-merge test (per-run wins, base/proxy env preserved).
  • Verified live end-to-end via the scheduler consumer (8/8 scenarios green).

🤖 Generated with Claude Code

The Claude driver built a fixed argv with no way to load an additional
plugin directory, so agent CLIs under test could not exercise Claude Code
plugins. Add `pluginDir` (maps to `--plugin-dir`) and a generic `extraArgs`
passthrough to RunOptions/AgentRunExtra, thread them through buildArgs, and
export buildArgs to unit-test the argv assembly.

Constraint: RunOptions is the driver-agnostic seam; extraArgs keeps future
flag needs from reopening it.
Rejected: Hardcode --plugin-dir only | loses the generic escape hatch
Confidence: high
Scope-risk: narrow
Not-tested: live end-to-end plugin load (covered by the consumer repo)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

`agent.run(prompt, { env })` now merges the given vars OVER the base env
(so it augments, never clobbers, the LLM-proxy's ANTHROPIC_BASE_URL). Lets a
test point the agent's subprocess at scenario-scoped locations — e.g. a
plugin's state directory — without touching the shared process env or $HOME.

Constraint: base env carries ANTHROPIC_BASE_URL in live/record modes — must
be preserved, hence merge (per-run wins) rather than replace.
Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dortort dortort changed the title feat(claude): support --plugin-dir and extra CLI args in the driver feat(driver): --plugin-dir, extraArgs, and per-run env passthrough Jul 31, 2026
The `retries` config field existed but the runner never honored it. Live agent
runs vary in phrasing and path, so a bounded retry is the standard flake
tolerance (Playwright parity): a scenario passes if any attempt passes, and the
result records `attempts` when a retry occurred.

Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dortort dortort self-assigned this Aug 2, 2026
@dortort
dortort merged commit 5283832 into main Aug 2, 2026
1 check passed
@dortort
dortort deleted the feat/plugin-dir-passthrough branch August 2, 2026 05:43
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