mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-07-30 03:09:50 +08:00
3.3 KiB
3.3 KiB
Post-Conversion Enhancements Reference
Use this reference during orchestrator Step 5 after /agentforce-generate completes.
Scope
Apply per generated Agent Script artifact (.agent) independently.
Inputs
Required:
agentscript_file: path to one generated.agentfilemode(online|offline): the effective orchestrator run mode
Conditionally required:
org_alias: target org alias used to redeploy in Step 9. Required whenmode=online; omit whenmode=offline.
Required Workflow
- Read the full
.agentfile. - Enforce
start_agentrouter behavior:- ensure the subagent marked
start_agentcontains explicit instructions that- it is only a router and should route immediately to the correct downstream agent
- it never responds directly to the user
- if this instruction is missing, add it
- ensure the subagent marked
- Improve transition quality with meaningful
available whenconditions:- add or refine conditions between subagents wherever possible
- conditions should be meaningful and correct for transition intent
- conditions should reduce routing noise and improve next-step navigation in the final agent
- Validate action data flow integrity:
- ensure action inputs/outputs are correctly mapped through conversation variables or LLM inputs
- where needed, persist required LLM-derived values via
setVariables - ensure downstream actions can consume required values deterministically
- Enforce numeric action I/O typing:
- when an action input/output is numeric and flows between actions (e.g. rewards points
feeding a merchandise action), use the publish-safe form: an object field with
complex_data_type_name: lightning__numberType, not a barenumber, so numeric typing survives publish across all orgs.
- when an action input/output is numeric and flows between actions (e.g. rewards points
feeding a merchandise action), use the publish-safe form: an object field with
- Validate escalation mapping:
- ensure any escalation/transfer behavior (Einstein Bot
SystemMessageTransfer, or any "hand off to a live agent/human") is implemented via the built-in@utils.escalateutility. - confirm escalation is NOT modeled as a standalone/new action: there must be no
Transfer_To_Agent-style action and no action-inventory entry (includingNEEDS_STUB/NEEDS_CREATION) representing the transfer. - if the escalation is present in bot and missing in spec, or was authored as an action instead of
@utils.escalate, fix it: remove the erroneous action and invoke@utils.escalatein the appropriate escalation subagent (keeping any resolved transfer target as a variable/context, not an action signature).
- ensure any escalation/transfer behavior (Einstein Bot
- Preserve intended functionality and behavioral coverage.
- Write the optimized/enhanced content back to the same file path (in-place update).
- Validate the resulting file:
- remains readable and structurally coherent
- is a valid Agent Script
- If enhancements modified the Agent Script:
- when
mode=online, deploy/publish the updated Agent Script to the org again using the providedorg_alias - do not activate as part of this step
- when
mode=offline, skip deploy and keep the updated local file only
Output
- Enhanced Agent Script at the same input file location.
Capture Requirements
For each processed file, capture:
agentscript_file- status (
successorpartial) - short enhancement summary
agentscript_modified(true|false)- redeploy status (online mode only):
deployed,skipped, orfailed