Previously, `parseToolCall()` was using `computeAutoApproval()`, which was a somewhat parallel implementation of `canAutoApprove()` in order to get `SafeCommandReason` metadata for presenting information to the user. The only function that was using `SafeCommandReason` was `useMessageGrouping()`, but it turns out that function was unused, so this PR removes `computeAutoApproval()` and all code related to it. More importantly, I believe this fixes https://github.com/openai/codex/issues/87 because `computeAutoApproval()` was calling `parse()` from `shell-quote` without wrapping it in a try-catch. This PR updates `canAutoApprove()` to use a tighter try-catch block that is specific to `parse()` and returns an appropriate `SafetyAssessment` in the event of an error, based on the `ApprovalPolicy`. Signed-off-by: Michael Bolin <mbolin@openai.com>
10 lines
255 B
TypeScript
10 lines
255 B
TypeScript
import type { ResponseItem } from "openai/resources/responses/responses.mjs";
|
|
|
|
/**
|
|
* Represents a grouped sequence of response items (e.g., function call batches).
|
|
*/
|
|
export type GroupedResponseItem = {
|
|
label: string;
|
|
items: Array<ResponseItem>;
|
|
};
|