Skip to content

Commit fee2ec7

Browse files
committed
fix(humanize2): reset extraArgs section when list ends for sibling fields
When extraArgs: [] switched section to "agents.extraArgs", subsequent sibling fields (model, reasoningEffort, permissionMode, sandbox) under the same agent were silently ignored because section was never reverted. Now reset section back to "agents" when a non-list-item line is encountered at indent >= 4.
1 parent 557a19c commit fee2ec7

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

src/config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ function parseSimpleYaml(
193193
continue;
194194
}
195195

196+
// extraArgs list is done — reset section so sibling fields (model,
197+
// permissionMode, sandbox) under the same agent are not silently ignored
198+
if (section === "agents.extraArgs" && indent >= 4 && currentAgent !== undefined && !trimmed.startsWith("- ")) {
199+
section = "agents";
200+
}
201+
196202
const separatorIndex = trimmed.indexOf(":");
197203
if (separatorIndex < 0) {
198204
continue;

tests/config.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,33 @@ describe("humanize2 user config", () => {
129129
});
130130
});
131131

132+
it("loads sibling fields after empty extraArgs under the same agent", async () => {
133+
const home = await tempDirectory();
134+
const configPath = join(home, "sibling-after-extraargs-config.yaml");
135+
136+
const contents = [
137+
"version: 1",
138+
"cacheDir: /tmp/humanize2-cache",
139+
"defaultRunTimeoutMs: 12345",
140+
"defaultTheme: dark",
141+
"agents:",
142+
" codex:",
143+
" extraArgs: []",
144+
" model: gpt-5.5",
145+
" reasoningEffort: xhigh",
146+
""
147+
].join("\n");
148+
await writeFile(configPath, contents, "utf8");
149+
150+
const config = await loadHumanizeConfig({ HUMANIZE2_CONFIG: configPath }, home);
151+
152+
expect(config.agentDefaults.codex).toMatchObject({
153+
model: "gpt-5.5",
154+
reasoningEffort: "xhigh",
155+
extraArgs: []
156+
});
157+
});
158+
132159
it("loads workflow retry and script allowlist settings from the user config", async () => {
133160
const home = await tempDirectory();
134161
const configPath = join(home, "workflow-config.yaml");

0 commit comments

Comments
 (0)