Skip to content

Commit 7a8e705

Browse files
[docs]: rm incorrect example about parameterized agent workflow (#1371)
great catch from @loic-carbonne # why - currently it is not possible to rerun a cached agent run with a different prompt - therefore, this docs example is misleading # what changed - removed misleading example <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removed the incorrect docs example that suggested cached agent workflows can be reused with different inputs. This aligns the deterministic agent page with current behavior where each instruction generates a new cache key, so runs cannot be rerun with a different prompt. <sup>Written for commit 4908805. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> Co-authored-by: Loïc Carbonne <loic.carbonne.mail@gmail.com>
1 parent 0e24d23 commit 7a8e705

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

packages/docs/v3/best-practices/deterministic-agent.mdx

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -301,44 +301,7 @@ const stagehand = new Stagehand({
301301
```
302302

303303
## Advanced Patterns
304-
305-
### Parameterized Agent Workflows
306-
307-
Use variables to make cached workflows reusable with different inputs:
308-
309-
```typescript
310-
async function executeLogin(username: string, password: string) {
311-
const stagehand = new Stagehand({
312-
env: "BROWSERBASE",
313-
cacheDir: "cache/login"
314-
});
315-
316-
await stagehand.init();
317-
const page = stagehand.context.pages()[0];
318-
319-
await page.goto("https://example.com/login");
320-
321-
const agent = stagehand.agent({
322-
model: "anthropic/claude-sonnet-4-20250514"
323-
});
324-
325-
// Variables work with caching
326-
const result = await agent.execute({
327-
instruction: `Fill in username with "${username}" and password with "${password}", then click submit`,
328-
maxSteps: 5
329-
});
330-
331-
await stagehand.close();
332-
return result.success;
333-
}
334-
335-
// First user: Caches the workflow
336-
await executeLogin("user1@example.com", "password123");
337-
338-
// Second user: Reuses cached workflow structure
339-
await executeLogin("user2@example.com", "differentpass");
340-
```
341-
304+
342305
### Fallback to Fresh Exploration
343306

344307
Combine caching with fallback for resilience:

0 commit comments

Comments
 (0)