feat(driver): --plugin-dir, extraArgs, and per-run env passthrough - #1
Merged
Conversation
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>
|
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two small additions to the Claude driver / runner so tests can exercise Claude Code plugins and point a run at scenario-scoped locations:
--plugin-dir+extraArgspassthrough —RunOptions/AgentRunExtragainpluginDir(→--plugin-dir) and a genericextraArgs;buildArgsemits them and is exported for unit testing.envpassthrough —agent.run(prompt, { env })merges the given vars over the base env (so it augments, never clobbers, the LLM proxy'sANTHROPIC_BASE_URL).Why
The first consumer is the
@dortort/schedulere2e suite: it loads the plugin via--plugin-dirand isolates the scheduler's global state per-scenario via an env var (CLAUDE_SCHEDULER_STATE_DIR) — all without touching$HOMEor the shared process env.Testing
pnpm typecheck✅,pnpm -r build✅pnpm test✅ — 84 tests, incl. newbuildArgscoverage and anAgentHandleenv-merge test (per-run wins, base/proxy env preserved).🤖 Generated with Claude Code