Member Junction
    Preparing search index...

    Interface LoopAgentTypePromptParams

    Configuration parameters for Loop Agent Type.

    Controls prompt content (which sections are included), client tool availability, and content limits. Stored in AIAgent.AgentTypePromptParams as JSON.

    All boolean prompt-inclusion properties default to true (include section). Set to false to exclude a section from the prompt and save tokens.

    These parameters are configured at three levels with merge precedence:

    1. Schema defaults (from AIAgentType.PromptParamsSchema) - lowest priority
    2. Agent config (from AIAgent.AgentTypePromptParams) - medium priority
    3. Runtime override (from ExecuteAgentParams.data.__agentTypePromptParams) - highest priority
    // Agent configuration to disable unused features
    const agentConfig: LoopAgentTypePromptParams = {
    includeForEachDocs: false, // Agent never iterates collections
    includeWhileDocs: false, // Agent never polls/retries
    includeResponseFormDocs: false, // Agent never collects user input
    includeCommandDocs: false // Agent doesn't trigger UI actions
    };
    // Runtime override to enable a feature for a specific execution
    const result = await agent.Execute({
    agent: myAgent,
    conversationMessages: messages,
    data: {
    __agentTypePromptParams: {
    includeForEachDocs: true // Enable for this run only
    }
    }
    });
    // Minimal response type with granular control
    const minimalConfig: LoopAgentTypePromptParams = {
    includeResponseTypeDefinition: {
    payload: true, // Keep payload in type
    responseForms: false, // Exclude responseForm from type
    commands: false, // Exclude commands from type
    forEach: false, // Exclude ForEach from nextStep.type
    while: false // Exclude While from nextStep.type
    },
    includeForEachDocs: false,
    includeWhileDocs: false
    };
    interface LoopAgentTypePromptParams {
        clientToolResultMaxChars?: number;
        decisionDiscovery?: boolean;
        decisionPromptName?: string;
        decisionsEnabled?: boolean;
        decisionsMaxCallsPerTurn?: number;
        decisionsMaxItems?: number;
        decisionsMaxRequests?: number;
        enableTaskGraphs?: boolean;
        finishIfMode?: FinishIfMode;
        finishIfThreshold?: number;
        includeArtifactToolsDocs?: boolean;
        includeCommandDocs?: boolean;
        includeConversationToolsDocs?: boolean;
        includeDateTimeInPrompt?: boolean;
        includeDecisionsDocs?: boolean;
        includeFinishIfDocs?: boolean;
        includeForEachDocs?: boolean;
        includeMessageExpansionDocs?: boolean;
        includePayloadInPrompt?: boolean;
        includePipelineDocs?: boolean;
        includeResponseFormDocs?: boolean;
        includeResponseTypeDefinition?: ResponseTypeInclusionRules;
        includeScratchpadDocs?: boolean;
        includeVariableRefsDocs?: boolean;
        includeWhileDocs?: boolean;
        maxActionsInPrompt?: number;
        maxSubAgentsInPrompt?: number;
        payloadFeedbackCheck?: boolean;
        scratchpadMaxTasks?: number;
        specializationPlacement?: SpecializationPlacement;
        trailingStateMode?: TrailingStateMode;
    }
    Index

    Properties

    clientToolResultMaxChars?: number

    Character cap for one client tool result in the conversation. -1 (the default) or 0 keeps the whole result. A positive N keeps the first N characters and adds a note saying how much was cut. Compaction and expiration still apply either way.

    -1
    
    decisionDiscovery?: boolean

    Decision discovery (plan Task 3.1): suggest the agent to delegate to before the first prompt. When true, and the run answers its conversation's opening request (its messages hold one user message) without

    an agent, one decision call runs once per run, in parallel with the rest of pre-execution. It asks which of the agents the user may run (the Find Candidate Agents set, minus this agent, and only those the host's ALL_AVAILABLE_AGENTS allows when it sends one) should handle the request, and whether the request needs a specialist at all. When both answers are confident it adds a <suggested_agent> system message to the first prompt, so the agent can delegate in its first turn instead of calling Find Candidate Agents first. Otherwise, and on any error, timeout or cancellation, the prompt is unchanged. A follow-up turn is never asked about, so a suggestion never pulls the agent away from one it has already engaged, and fewer than three candidate agents ask nothing. Needs decisionsEnabled: true.

    false
    
    decisionPromptName?: string

    Name of the decision prompt used for evaluating decisions.

    'Default Decision'
    
    decisionsEnabled?: boolean

    The master switch for decision-model use by this agent. Unless it is true, the agent never asks a decision model on its own, whatever the settings below say:

    • inline decisions: no docs and no response field, and any request the model sends anyway is skipped, even with includeResponseTypeDefinition.decisions: true set explicitly;
    • finishIf: treated as finishIfMode: 'off', so no docs, no response field and no gate;
    • decisionDiscovery, payloadFeedbackCheck and catalog narrowing (maxActionsInPrompt, maxSubAgentsInPrompt) do not run, so the prompt describes the whole catalog;
    • the Memory Manager's note gate (enableDecisionGate) does not run.

    With it true, each of those settings works as documented, and each is still off by default. Explicit uses do not read it: a Flow agent's Decision step, a task graph's Decision step, the Run Decision action and the other callers of AgentDecisionService or AIDecisionRunner.

    false
    
    decisionsMaxCallsPerTurn?: number

    Maximum number of decision calls one agent turn's requests make in total, counting every forEachItemIn item. The budget is handed out in request order before any call is made. A forEachItemIn request it cuts short asks its first items and reports the rest in skippedCount. A request it leaves no calls for is not run, and gets a failed result saying why. 0 turns decision calls off: every request gets a failed result that says so, and does not invite the agent to ask again.

    MAX_DECISION_CALLS_PER_TURN (100)
    
    decisionsMaxItems?: number

    Maximum number of items to process when forEachItemIn is used. Items beyond this limit are truncated. decisionsMaxCallsPerTurn can cut a request shorter.

    100
    
    decisionsMaxRequests?: number

    Maximum number of decision requests answered from one agent turn. Requests beyond this limit are not run; each gets a failed result saying why.

    MAX_DECISION_REQUESTS_PER_TURN (8)
    
    enableTaskGraphs?: boolean

    Allow this agent to emit durable task graphs (nextStep.type === 'Tasks').

    Defaults to false, unlike every other flag here, and is enforced rather than advisory. The other flags only shape the prompt: turning one off saves tokens, and an agent that ignores the omission and emits the feature anyway still works. This one is a capability gate. A task graph creates durable Task rows that outlive the run, execute on a server-side dispatcher under the submitting user, and can spawn further agent runs — so an agent acquiring that reach through prompt drift rather than through deliberate configuration is a real problem, not a token-budget one. LoopAgentType therefore rejects a 'Tasks' step from a disabled agent with a corrective, on top of omitting the type from the prompt.

    Rollout is per-agent (D3): the launch opt-ins are Sage, Query Builder, and the Research Agent + its sub-agents, declared in their AgentTypePromptParams metadata.

    false
    
    finishIfMode?: FinishIfMode

    Whether this agent writes finishIf gates, and whether they act. See FinishIfMode.

    Defaults to 'off': gates are opt-in per agent. A replay of recorded action rounds (plan Task 4.6) found that a gate at the 0.9 threshold would have ended 22% of the rounds where the agent went on to act, and neither a stricter threshold nor calibration fixed that. Use 'shadow' to measure an agent's own gates on real traffic before turning them 'on'. Needs decisionsEnabled: true: without it the mode is treated as 'off'.

    'off'
    
    finishIfThreshold?: number

    Probability threshold (0.0 to 1.0) required for each finishIf question to pass. If all questions evaluate to a probability >= this threshold, the agent completes immediately.

    0.9
    
    includeArtifactToolsDocs?: boolean

    Include artifact tools documentation and artifact manifest in the prompt. Artifact tools allow agents to explore input artifacts on demand. Only emitted when artifacts are present in the run. Disable for agents that never work with artifacts.

    true
    
    includeCommandDocs?: boolean

    Include actionable/automatic commands documentation. Actionable commands create clickable buttons (e.g., 'Open Record'), automatic commands trigger UI updates (e.g., refresh cache, show notification). Disable for agents that don't need to provide navigation or trigger UI actions.

    true
    
    includeConversationToolsDocs?: boolean

    Include conversation-history retrieval tool documentation in the prompt (the _CONVERSATION_TOOLS block). Only emitted when the run has a conversationId — these tools page exact pre-summary messages back in by their persisted Sequence handles. Disable for agents that should never dig into conversation history.

    true
    
    includeDateTimeInPrompt?: boolean

    Include current date, time, and day of week in the prompt. Provides the LLM with accurate temporal context so it doesn't hallucinate dates or claim it doesn't know the current time. Disable for agents where temporal context is irrelevant.

    true
    
    includeDecisionsDocs?: boolean

    Teach the model to request inline decisions: the decisions docs, and the field in the response type. Opt-in: anything but true leaves both out. They add about 1,200 tokens to every turn, and on the Prompt Eval corpus no model used them (typed-decision plan, Task 4.7). Needs decisionsEnabled: true.

    false
    
    includeFinishIfDocs?: boolean

    Include conditional completion (finishIf) documentation in the prompt. Takes effect only when finishIfMode is 'shadow' or 'on'; with 'off' the documentation is always omitted. Set false to keep the documentation out even then.

    true
    
    includeForEachDocs?: boolean

    Include ForEach operation documentation and examples. ForEach enables efficient batch processing of collections (e.g., processing all items in an array with a single LLM decision). Disable for agents that never need to iterate over collections.

    true
    
    includeMessageExpansionDocs?: boolean

    Include message expansion documentation. Message expansion allows agents to request full content from previously compacted messages. Disable for agents that don't use message compaction or don't need to access compacted content.

    true
    
    includePayloadInPrompt?: boolean

    Include the current payload state in the prompt. The payload is the agent's working memory that persists across iterations. Disable for agents that don't use the payload pattern or work purely from conversation context. Can save significant tokens for agents with large payloads.

    true
    
    includePipelineDocs?: boolean

    Include tool-pipeline documentation in the prompt (the _PIPELINE_TOOLS block). Only emitted when at least one pipeline source — an Action or artifact tool — is available. Disable for agents that should never compose pipelines.

    true
    
    includeResponseFormDocs?: boolean

    Include response form documentation for collecting user input. Response forms allow agents to request specific information from users via text fields, dropdowns, buttons, etc. Disable for agents that only output results and never need user input.

    true
    
    includeResponseTypeDefinition?: ResponseTypeInclusionRules

    Control response type definition inclusion in the prompt.

    • undefined or object with all defaults: Include full type definition
    • Object with granular rules: Include specific sections based on rules
      • Sections auto-align with their corresponding docs flags unless explicitly set
      • e.g., if includeForEachDocs=false and forEach not set, forEach type is excluded
    { payload: true, responseForms: true, commands: true, forEach: true, while: true }
    
    includeScratchpadDocs?: boolean

    Include scratchpad documentation and current scratchpad state in the prompt. The scratchpad is private working memory for notes and task tracking. Disable for agents that don't need internal task management or reasoning notes.

    true
    
    includeVariableRefsDocs?: boolean

    Include variable references documentation (payload., item., etc). These explain how to reference data in action parameters and loop contexts. Disable if agent has custom examples showing variable usage patterns.

    true
    
    includeWhileDocs?: boolean

    Include While operation documentation and examples. While loops enable polling, retrying, and conditional iteration (e.g., waiting for a job to complete). Disable for agents that never need polling or conditional loops.

    true
    
    maxActionsInPrompt?: number

    Catalog narrowing for actions and skills (plan Task 3.7). -1 or 0 = include all (default: narrowing is off) N = when the agent has more than N actions (or skills), describe the N most useful for the run's opening request, judged once per run by one decision call, plus any action with MinExecutionsPerRun set and Find Candidate Actions / Find Candidate Agents. Each narrowed list starts with a line saying how many it hides and how to reach them: hidden skills are named, and hidden actions are found with Find Candidate Actions, so actions are narrowed only when the agent has that action (skills still are). Narrowing only hides: every permitted action can still be called, actionCount and skillCount still count them all, and a failed decision shows them all. Narrowing is prose-only: it shortens the described list, never the native tool set. With native tool calling, every action is still declared as a tool, since a call to an undeclared tool is refused and that mode has no Actions step to fall back on. Needs decisionsEnabled: true: without it the prompt describes every action and skill.

    -1
    
    maxSubAgentsInPrompt?: number

    Catalog narrowing for sub-agents (plan Task 3.7). -1 or 0 = include all (default: narrowing is off) N = when the agent has more than N sub-agents, describe the N most useful for the run's opening request, judged once per run by one decision call, plus any with MinExecutionsPerRun set. The list starts with a line naming the sub-agents it hides. Narrowing only hides: every permitted sub-agent can still be called by name, subAgentCount still counts them all, and a failed decision shows them all. Narrowing is prose-only: it shortens the described list, never the native tool set. With native tool calling under implicit control flow, every sub-agent is still declared as a delegate_to_ tool, since a call to an undeclared tool is refused. Needs decisionsEnabled: true: without it the prompt describes every sub-agent.

    -1
    
    payloadFeedbackCheck?: boolean

    Check the agent's own payload changes that the payload analyzer flags as needing feedback (large truncations, removed keys, type changes). Each flagged change becomes one Likelihood ("was this change intended?"), all asked in one decision call with the decisionPromptName prompt and recorded as a Payload change check Decision step. The changes judged unintended are listed on the agent's next turn, which asks it to confirm or restore them.

    A change is never reverted or blocked automatically: the agent decides. When the decision fails or takes longer than 30 seconds, every change is accepted, as it is when this is off. A step that ends the run (Success, Chat, or any step that terminates) is not checked, since no turn would read the result.

    Off by default: each check costs an extra decision call. Needs decisionsEnabled: true.

    false
    
    scratchpadMaxTasks?: number

    Maximum number of tasks allowed in the scratchpad task list. When exceeded, completed tasks are auto-pruned oldest first.

    50
    
    specializationPlacement?: SpecializationPlacement

    Where the child prompt goes: 'auto' relocates it into the trailing runtime-state message only when its template is volatile; 'systemPrompt' never; 'trailingMessage' always. See SpecializationPlacement.

    'auto'
    
    trailingStateMode?: TrailingStateMode

    How the trailing runtime-state message is carried across iterations: 'auto' appends for OpenAI and replaces otherwise; 'appendOnly' and 'replace' force one behaviour. See TrailingStateMode.

    'auto'