Skip to content

Commit 0aaf094

Browse files
committed
Add 'timeout' to ToolResultType in Node and Python
The agent runtime recently added 'timeout' as a fifth valid resultType. Update the type guard and type definitions to match.
1 parent caac425 commit 0aaf094

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

nodejs/src/session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ function isToolResultObject(value: unknown): value is ToolResultObject {
10701070
"failure",
10711071
"rejected",
10721072
"denied",
1073+
"timeout",
10731074
];
10741075

10751076
return allowedResultTypes.includes((value as ToolResultObject).resultType);

nodejs/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export interface CopilotClientOptions {
176176
/**
177177
* Configuration for creating a session
178178
*/
179-
export type ToolResultType = "success" | "failure" | "rejected" | "denied";
179+
export type ToolResultType = "success" | "failure" | "rejected" | "denied" | "timeout";
180180

181181
export type ToolBinaryResult = {
182182
data: string;

python/copilot/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from pydantic import BaseModel
1717

18-
ToolResultType = Literal["success", "failure", "rejected", "denied"]
18+
ToolResultType = Literal["success", "failure", "rejected", "denied", "timeout"]
1919

2020

2121
@dataclass

0 commit comments

Comments
 (0)