Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ export class WorkflowAgent {

private buildPrompt(prompt: string, options: AgentRunOptions<any>, structured: boolean): string {
const parts = [
// Unconditional subagent framing: every worker (schema or not) is told it is a
// subagent whose only meaningful output is its returned result, with no parent
// conversation or repo context it wasn't explicitly given.
"You are a subagent inside a deterministic workflow. The orchestrator does not see this conversation — only your final result is returned to it. Do the work with the tools provided, then return your findings concisely; do not ask the user questions, and do not assume any parent conversation or repository context you weren't given in this prompt.",
this.instructions,
options.instructions,
options.label ? `Task label: ${options.label}` : undefined,
Expand Down
4 changes: 2 additions & 2 deletions src/effort-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function createEffortState(): EffortState {
const HIGH_DIRECTIVE =
"Effort: HIGH. Be thorough — use a few parallel reviewers/perspectives and an adversarial verify pass (see verify()/judgePanel()); set a moderate tokenBudget and maxAgents on the workflow tool call.";
const ULTRA_DIRECTIVE =
"Effort: ULTRA. Be exhaustive — fan out widely (more reviewers/judges, deeper loopUntilDry rounds, a completenessCheck at the end), set a generous tokenBudget and a high maxAgents on the workflow tool call, and prefer the big tier for synthesis.";
"Effort: ULTRA. Be exhaustive — fan out widely (more reviewers/judges, deeper loopUntilDry rounds, a completenessCheck at the end), and prefer the big tier for synthesis. This can spend a lot of tokens quickly, so set explicit caps you're comfortable paying for (a generous but bounded tokenBudget and a high maxAgents) on the workflow tool call rather than leaving them unbounded.";

/** The extra directive appended to the forced-workflow prompt for an effort level. */
export function effortDirective(level: EffortLevel): string | undefined {
Expand Down Expand Up @@ -69,7 +69,7 @@ export function registerEffortCommand(pi: ExtensionAPI, state: EffortState): voi
// `/ultracode` turns it on, `/ultracode off` turns it off. Alias for /effort ultra.
pi.registerCommand("ultracode", {
description:
"Ultracode: standing maximal-effort mode — auto-arms an exhaustive workflow for substantive messages. /ultracode off to stop.",
"Ultracode: standing maximal-effort mode (this session only, never persisted) — auto-arms an exhaustive workflow for substantive messages. /ultracode off to stop.",
async handler(args: string, _ctx: ExtensionCommandContext) {
const arg = args.trim().toLowerCase();
const say = (content: string) => pi.sendMessage({ customType: "effort", content, display: true });
Expand Down
2 changes: 2 additions & 0 deletions src/workflow-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ export function createWorkflowTool(options: WorkflowToolOptions = {}): ToolDefin
"For workflow, use low concurrency and agentRetries for unstable provider/transport fan-out runs; retries apply only to recoverable agent failures and still require explicit null handling after exhaustion.",
"For workflow, failed agent(), parallel(), or pipeline() branches return null and log the failure unless the workflow is aborted. Check for nulls before synthesizing conclusions.",
"For workflow, include a final synthesis/assertion agent when combining multiple subagent results; return a compact JSON-serializable value with ok/verdict plus the important outputs.",
"For workflow, the default quality shape for fan-out work is finder -> verify -> merge: run one agent per angle or work-unit (in parallel), pass each candidate finding through verify() and drop the unconfirmed, then a single synthesis agent that de-duplicates, ranks by confidence/severity, and caps the output. If nothing survives verification, return an empty result and say so rather than padding.",
"For workflow, give each subagent a substantive, self-contained task: do not spawn an agent just to read one file or run one command, and do not use one agent only to check on another. Prefer fewer, higher-level agents over many trivial micro-tasks.",
"For workflow, if agent() needs machine-readable output, pass a plain JSON Schema via opts.schema; agent() will return the validated object. Use JSON Schema syntax, not TypeScript or TypeBox constructors.",
modelRoutingGuideline(),
agentTypeGuideline(),
Expand Down
Loading