Repository navigation
fix(dreamer): forward task fallbackModels & timeout, increase subagent maxSteps and verify batch size #783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -592,13 +592,6 @@ function createPiDreamerClient( | |
|
|
||
| const userMessage = extractUserMessage(args); | ||
| const systemPrompt = extractSystemPrompt(args); | ||
| // Per-task model override (Dreamer v2): the SHARED executor | ||
| // (promptSyncWithValidatedOutputRetry) owns fallback iteration — it | ||
| // rewrites body.model to each candidate (per-task model, then the | ||
| // per-task fallback chain) and calls this facade once per attempt. So | ||
| // we use body.model as the current attempt's model and pass | ||
| // fallbackModels: undefined; passing the dreamer-level chain here would | ||
| // double-iterate and override a task's own (possibly empty) chain. | ||
| const perTaskModel = extractBodyModel(args); | ||
| const requestedAgent = extractBodyAgent(args) ?? "magic-context-dreamer"; | ||
| const accountingTask = accountingTaskFromTitle(dreamSession.title); | ||
|
|
@@ -628,10 +621,7 @@ function createPiDreamerClient( | |
| userMessage, | ||
| model: perTaskModel, | ||
| fallbackModels: undefined, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting Update it to expect |
||
| // The executor enforces the per-task timeout via its abort signal; | ||
| // give the subprocess a generous ceiling so the signal is the | ||
| // authority (not a second, conflicting wall-clock here). | ||
| timeoutMs: 30 * 60 * 1000, | ||
| timeoutMs: (taskConfig?.timeoutMinutes ?? 30) * 60 * 1000, | ||
| cwd: dreamSession.directory, | ||
| signal: args.signal | ||
| ? AbortSignal.any([args.signal, controller.signal]) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,9 +126,9 @@ export function buildHiddenAgentRegistrations(args: { | |
| // Documentation proposals may inspect source files but cannot mutate them. | ||
| // Keep this list synchronized with DREAMER_DOCS_ALLOWED_TOOLS and locked against overrides. | ||
| allowedTools: ["read", "grep", "glob", "aft_outline", "aft_zoom", "aft_search"], | ||
| // Documentation investigation reads the repository tree in a bounded loop, | ||
| // unlike whole-memory-pool tasks with a 150-step limit. | ||
| maxSteps: 60, | ||
| // Documentation investigations can span many files in larger repositories. | ||
| // Keep the read-only proposal loop bounded while allowing it to finish. | ||
| maxSteps: 400, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: This raises Prompt for AI agents |
||
| overrides: args.dreamerOverrides, | ||
| // Lock so a user override can't add the memory surface back. | ||
| lockPermissions: true, | ||
|
|
@@ -203,10 +203,9 @@ export function buildHiddenAgentRegistrations(args: { | |
| // ctx_search (these tasks check against local code, not cross-session | ||
| // recall). | ||
| allowedTools: ["read", "grep", "glob", "aft_outline", "aft_zoom", "aft_search"], | ||
| // Bounded read-only-lookup budget (mirrors the primer investigator) — | ||
| // NOT the dreamer's 150. A map/verify batch is a targeted file-lookup | ||
| // pass, and this bounds the per-batch cost of an unsupervised run. | ||
| maxSteps: 60, | ||
| // A map/verify batch can require many file lookups across larger repositories. | ||
| // Keep the investigation bounded while allowing complex batches to finish. | ||
| maxSteps: 400, | ||
|
|
||
| overrides: args.dreamerOverrides, | ||
| // A user dreamer `permission`/`tools` override must never re-grant the | ||
| // denied write/bash/ctx_memory surface to this unsupervised agent. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: This change leaves the existing Dreamer forwarding test expecting the old nested fallback array, so the focused Pi Dreamer test now fails on both runner calls. Update that test to assert that the outer retry owns the fallback chain and the runner receives no nested fallbacks, while retaining its failure-path coverage.
Prompt for AI agents