fix(core): preserve workspace cwd on CLI provider retries#918
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deploying agentv with
|
| Latest commit: |
aaa22a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://738094b2.agentv.pages.dev |
| Branch Preview URL: | https://fix-912-cli-provider-retry-c.agentv.pages.dev |
- Fix CliProvider.invokeBatch() to use per-request cwd override (request.cwd) instead of always using this.config.cwd. The first request's cwd takes priority, falling back to config.cwd. - Add test verifying orchestrator retry loop preserves workspace cwd across retry attempts via sharedWorkspacePath → request.cwd chain. - Add tests for invoke/invokeBatch cwd override vs config.cwd fallback. Closes #912 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address code review feedback: - Replace raw.cwd references with effectiveCwd in all 3 invokeBatch response objects (success, error, fallback) - Add batch cwd invariant comment - Add invokeBatch fallback test for undefined request.cwd Co-Authored-By: Claude Opus 4.6 <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.
Closes #912
Problem
When a CLI provider command fails and is retried, the
invokeBatch()method always usedthis.config.cwd(which defaults to the eval file directory), ignoring the per-requestrequest.cwdworkspace override passed by the orchestrator.Fix
CliProvider.invokeBatch(): Userequests[0]?.cwd ?? this.config.cwdso workspace path overrides are respected in batch mode, matching the behavior ofinvoke().sharedWorkspacePathasrequest.cwdacross retry attemptsinvoke()prefersrequest.cwdoverconfig.cwdinvoke()falls back toconfig.cwdwhenrequest.cwdis undefinedinvokeBatch()prefers first request'scwdoverconfig.cwdTest plan