-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(agent): ignore empty working_dir placeholders #7343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1028,6 +1028,15 @@ assistant: Uses the ${ToolNames.AGENT} tool to launch the test-runner agent | |
| } | ||
| } | ||
| } | ||
| // Some models emit an empty placeholder for the unused optional field. | ||
| // With isolation selected, normalize it away before downstream routing. | ||
| if ( | ||
| (typeof params.working_dir === 'string' && | ||
| params.working_dir.trim().length === 0) || | ||
| params.working_dir === null | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The Failure scenario: A future refactor simplifies the condition to only the string-trim check, dropping the Consider adding a test: it('treats a null working_dir as unset', () => {
const params = {
...validParams,
working_dir: null as unknown as string,
};
expect(agentTool.validateToolParams(params)).toBeNull();
expect(params.working_dir).toBeUndefined();
});— qwen3.7-max via Qwen Code /review |
||
| ) { | ||
| params.working_dir = undefined; | ||
| } | ||
|
|
||
| if (params.isolation !== undefined) { | ||
| if (params.isolation !== 'worktree') { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] Comment says "With isolation selected" but the normalization block below has no
params.isolationcondition — it runs unconditionally for all callers. Two of the four new tests confirm this by exercising normalization withoutisolationset.Failure scenario: A future maintainer reads "With isolation selected" and assumes normalization should only fire when isolation is set. They add an
isolationguard, reintroducing #7315 for non-isolation callers where models emit emptyworking_dir.— qwen3.7-max via Qwen Code /review