Skip to content

Commit f9ce51f

Browse files
fix(server): ACP retries a config option whose write failed for a reason other than refusal
Only an invalid-params (-32602) answer to session/set_config_option is the agent refusing the value; other errors now fail session configuration so the next turn resends the option instead of recording it as applied. Fixes #33117 AI-assisted; verified with the tests and tools listed above.
1 parent d3598d1 commit f9ce51f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎packages/provider-acp/src/server/adapter.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7391,11 +7391,13 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* (
73917391
yield* runtime.setConfigOption(selection.id, selection.value).pipe(
73927392
Effect.catchTags({
73937393
AcpRequestError: (error) =>
7394-
Effect.logWarning("ACP session rejected a configuration option value", {
7395-
optionId: selection.id,
7396-
value: selection.value,
7397-
detail: error.message,
7398-
}),
7394+
error.code === -32602
7395+
? Effect.logWarning("ACP session rejected a configuration option value", {
7396+
optionId: selection.id,
7397+
value: selection.value,
7398+
detail: error.message,
7399+
})
7400+
: Effect.fail(error),
73997401
}),
74007402
);
74017403
}

0 commit comments

Comments
 (0)