Skip to content

Commit f728cab

Browse files
committed
fix(preview): preserve timeout recovery within context budget
1 parent ff91e8f commit f728cab

4 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎apps/server/src/preview/ServerBrowser.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ it.live("preview_open reports its navigation timeout instead of the request budg
504504
timeoutMs: 15_000,
505505
});
506506
expect(error.message).toBe(
507-
"Preview automation open exceeded the browser's operation deadline. The browser responded; inspect preview_status.tabs for a newly created tab and use its tabId before retrying.",
507+
"Preview automation open exceeded the browser's operation deadline. The browser responded; check preview_status.tabs for the opened or reused tab and use its tabId before retrying.",
508508
);
509509
}),
510510
).pipe(Effect.provide(layer)),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"claudeSystemAppendBytes": 5153,
3-
"codexAdditionalContextBytes": 6883,
3+
"codexAdditionalContextBytes": 6876,
44
"mcpToolListJsonBytes": 47020
55
}

‎packages/contracts/src/previewAutomation.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ export class PreviewAutomationTimeoutError extends Schema.TaggedError<PreviewAut
771771
override get message(): string {
772772
if (this.remoteTag === "PreviewAutomationTimeoutError") {
773773
return this.operation === "open"
774-
? "Preview automation open exceeded the browser's operation deadline. The browser responded; inspect preview_status.tabs for a newly created tab and use its tabId before retrying."
774+
? "Preview automation open exceeded the browser's operation deadline. The browser responded; check preview_status.tabs for the opened or reused tab and use its tabId before retrying."
775775
: `Preview automation ${this.operation} exceeded the browser's operation deadline. The browser responded; check preview_status on the same tab before retrying.`;
776776
}
777777
const summary = `Preview automation ${this.operation} timed out after ${this.timeoutMs}ms.`;

‎packages/provider-core/src/server/orchestrationInstructions.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ export const T3_CODE_BROWSER_TOOL_INSTRUCTIONS = `
3333
3434
## T3 Code browser
3535
36-
When browser work was asked, \`preview_*\` is the browser you share with the user: \`preview_status\` first, then \`preview_open\` if no tab can be automated. Prefer snapshot locators over coordinates.
37-
38-
An operation timeout or missing locator does not mean the browser is unavailable. Correct actionable inputs and check \`preview_status\` on the same tab. If a snapshot times out while status works, use \`preview_evaluate\` for DOM inspection when you control the tab. After repeated failures, report the exact error and recovery checks.
39-
40-
Keep recovery inside T3. Preview failures do not authorize opening another browser or incognito window, activating apps, or changing the user's focus. Switch browsers only when the user authorizes it or invokes a skill or documented repository workflow that names one. If tools are absent or no host is available after \`preview_status\` and \`preview_open\`, report the missing prerequisite.
36+
\`preview_status\`, then \`preview_open\` if needed. Use snapshot locators. Timeout/missing locator: fix inputs, check same-tab status; snapshot timeout with status working: inspect DOM via \`preview_evaluate\` on your tab. Failures or missing tools/host: report error and checks. Stay in T3; preserve focus unless user or invoked workflow names another browser.
4137
`;
4238

4339
const T3_CODE_DEVICE_TOOLS = ["device_list", "device_open", "device_screenshot", "device_close"];

0 commit comments

Comments
 (0)