You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace extension capping with timeout.extended/windingDown events (#522) (#524)
Instead of capping extensions to an external hard timeout (wrong model),
emit events that let the parent dynamically extend its own deadline:
- `timeout.extended`: emitted when observer grants extension, includes
grantedMs so parent can adjust its Promise.race/deadline
- `timeout.windingDown`: emitted when observer declines, so parent
knows agent is producing final answer
Remove externalHardTimeout option — the parent should wait for the child,
not cap it. The parent listens to events and stays in sync.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
/** Max ms per extension request for negotiated timeout (default: 600000 = 10 min). Env var: NEGOTIATED_TIMEOUT_MAX_PER_REQUEST */
118
118
negotiatedTimeoutMaxPerRequest?: number;
119
-
/** External hard timeout ceiling in ms (e.g., visor's Promise.race timeout). When set, the observer caps extensions so granted time never exceeds this ceiling. Env var: EXTERNAL_HARD_TIMEOUT */
120
-
externalHardTimeout?: number|null;
119
+
}
120
+
121
+
/**
122
+
* Emitted when the negotiated timeout observer grants a time extension.
123
+
* Parent processes should listen to this event and extend their own deadlines accordingly.
124
+
*/
125
+
exportinterfaceTimeoutExtendedEvent{
126
+
/** Duration of the granted extension in milliseconds */
127
+
grantedMs: number;
128
+
/** Reason the observer granted the extension */
129
+
reason: string;
130
+
/** Number of extensions used so far */
131
+
extensionsUsed: number;
132
+
/** Number of extensions remaining */
133
+
extensionsRemaining: number;
134
+
/** Total extra time granted across all extensions in ms */
135
+
totalExtraTimeMs: number;
136
+
/** Remaining budget for future extensions in ms */
137
+
budgetRemainingMs: number;
138
+
}
139
+
140
+
/**
141
+
* Emitted when the negotiated timeout observer declines an extension and begins wind-down.
142
+
* After this event, the agent will produce its final answer and no more extensions will be granted.
143
+
*/
144
+
exportinterfaceTimeoutWindingDownEvent{
145
+
/** Reason the observer declined the extension */
146
+
reason: string;
147
+
/** Number of extensions used before declining */
148
+
extensionsUsed: number;
149
+
/** Total extra time granted across all extensions in ms */
0 commit comments