Loading...
Loading...
Compare original and translation side by side
sf agent preview.agentsf agent preview.agentpython3python/tmp/$env:TEMP\%TEMP%\jqpython -c "import json,sys; ..."python3python/tmp/$env:TEMP\%TEMP%\jqpython -c "import json,sys; ...".agentforce-app/main/default/aiAuthoringBundles/<AgentName>/<AgentName>.agent.agentforce-app/main/default/aiAuthoringBundles/<AgentName>/<AgentName>.agentMasterLabelDeveloperNamesf data query --json \
--query "SELECT Id, MasterLabel, DeveloperName FROM GenAiPlannerDefinition WHERE MasterLabel LIKE '%<user-provided-name>%' OR DeveloperName LIKE '%<user-provided-name>%'" \
-o <org>MasterLabelfindSessionsDeveloperName--api-namesf agent preview/activate/publishDeveloperName_vNAGENT_MASTER_LABELfindSessions()AGENT_API_NAMEDeveloperName_vNsf agentPLANNER_IDMasterLabelDeveloperNamesf data query --json \
--query "SELECT Id, MasterLabel, DeveloperName FROM GenAiPlannerDefinition WHERE MasterLabel LIKE '%<user-provided-name>%' OR DeveloperName LIKE '%<user-provided-name>%'" \
-o <org>MasterLabelfindSessionsDeveloperNamesf agent preview/activate/publish--api-name_vNDeveloperNameAGENT_MASTER_LABELfindSessions()AGENT_API_NAME_vNDeveloperNamesf agentPLANNER_IDfind <project-root>/force-app/main/default/aiAuthoringBundles -name "*.agent" 2>/dev/nullAGENT_API_NAMEsf project retrieve start --json --metadata "AiAuthoringBundle:<AGENT_API_NAME>" -o <org>Known bug:creates a double-nested path:sf project retrieve start. Fix it immediately after retrieve:force-app/main/default/main/default/aiAuthoringBundles/...
if [ -d "force-app/main/default/main/default/aiAuthoringBundles" ]; then
mkdir -p force-app/main/default/aiAuthoringBundles
cp -r force-app/main/default/main/default/aiAuthoringBundles/* \
force-app/main/default/aiAuthoringBundles/
rm -rf force-app/main/default/main
fi.agentsystem:instructions:config:developer_name:start_agentsubagentreasoning: instructions:instructions:AGENT_FILEfind <project-root>/force-app/main/default/aiAuthoringBundles -name "*.agent" 2>/dev/nullAGENT_API_NAMEsf project retrieve start --json --metadata "AiAuthoringBundle:<AGENT_API_NAME>" -o <org>已知问题:会创建双重嵌套路径:sf project retrieve start。获取后立即修复:force-app/main/default/main/default/aiAuthoringBundles/...
if [ -d "force-app/main/default/main/default/aiAuthoringBundles" ]; then
mkdir -p force-app/main/default/aiAuthoringBundles
cp -r force-app/main/default/main/default/aiAuthoringBundles/* \
force-app/main/default/aiAuthoringBundles/
rm -rf force-app/main/default/main
fi.agentinstructions:system:developer_name:config:reasoning: instructions:start_agentsubagentinstructions:AGENT_FILEsf api request rest "/services/data/v63.0/ssot/data-spaces" -o <org>sf api request rest--json{
"dataSpaces": [
{
"id": "0vhKh000000g3DjIAI",
"label": "default",
"name": "default",
"status": "Active",
"description": "Your org's default data space."
}
],
"totalSize": 1
}nameAgentforceOptimizeService'default'status: "Active"<name>nameDATA_SPACEsf api request rest "/services/data/v63.0/ssot/data-spaces" -o <org>sf api request rest--json{
"dataSpaces": [
{
"id": "0vhKh000000g3DjIAI",
"label": "default",
"name": "default",
"status": "Active",
"description": "Your org's default data space."
}
],
"totalSize": 1
}nameAgentforceOptimizeService'default'status: "Active"<name>nameDATA_SPACEsf apex run -o <org> -f /dev/stdin << 'APEX'
ConnectApi.CdpQueryInput qi = new ConnectApi.CdpQueryInput();
qi.sql = 'SELECT ssot__Id__c FROM "ssot__AiAgentSession__dlm" LIMIT 1';
try {
ConnectApi.CdpQueryOutputV2 out = ConnectApi.CdpQuery.queryAnsiSqlV2(qi, '<DATA_SPACE>');
System.debug('STDM_CHECK:OK rows=' + (out.data != null ? out.data.size() : 0));
} catch (Exception e) {
System.debug('STDM_CHECK:FAIL ' + e.getMessage());
}
APEXSTDM_CHECK:FAILSTDM (Session Trace Data Model) is not available in this org. To enable: Setup -> Data Cloud -> Data Streams and verify "Agentforce Activity" is active. Proceeding with fallback: test suites + local traces.
STDM_CHECK:OKsf apex run -o <org> -f /dev/stdin << 'APEX'
ConnectApi.CdpQueryInput qi = new ConnectApi.CdpQueryInput();
qi.sql = 'SELECT ssot__Id__c FROM "ssot__AiAgentSession__dlm" LIMIT 1';
try {
ConnectApi.CdpQueryOutputV2 out = ConnectApi.CdpQuery.queryAnsiSqlV2(qi, '<DATA_SPACE>');
System.debug('STDM_CHECK:OK rows=' + (out.data != null ? out.data.size() : 0));
} catch (Exception e) {
System.debug('STDM_CHECK:FAIL ' + e.getMessage());
}
APEXSTDM_CHECK:FAIL此组织中未启用STDM(会话追踪数据模型)。启用方法:设置 -> Data Cloud -> 数据流,确认"Agentforce Activity"已激活。将使用备选方案继续:测试套件 + 本地追踪。
STDM_CHECK:OKsf agent preview --authoring-bundle| Data source | When to use | Pros | Cons |
|---|---|---|---|
| STDM (Phase 1) | Historical production analysis | Real user data, volume | Requires Data Cloud, 15-min lag |
| Test suites + local traces (Phase 1-ALT) | Dev iteration, orgs without STDM | Instant, full LLM prompt, variable state | Preview only, no real user data |
sf agent preview --authoring-bundle| 数据源 | 使用场景 | 优势 | 劣势 |
|---|---|---|---|
| STDM(阶段1) | 历史生产环境分析 | 真实用户数据,数据量大 | 需要Data Cloud,存在15分钟延迟 |
| 测试套件 + 本地追踪(阶段1-备选方案) | 开发迭代、无STDM的组织 | 即时性,完整LLM提示,变量状态可见 | 仅预览环境,无真实用户数据 |
sf agent test list --json -o <org>
sf agent test run --json --api-name <TestSuiteName> --wait 10 --result-format json -o <org> | tee /tmp/test_run.json
JOB_ID=$(python3 -c "import json; print(json.load(open('/tmp/test_run.json'))['result']['runId'])")
sf agent test results --json --job-id "$JOB_ID" --result-format json -o <org>sf agent test list --json -o <org>
sf agent test run --json --api-name <TestSuiteName> --wait 10 --result-format json -o <org> | tee /tmp/test_run.json
JOB_ID=$(python3 -c "import json; print(json.load(open('/tmp/test_run.json'))['result']['runId'])")
sf agent test results --json --job-id "$JOB_ID" --result-format json -o <org>description:description:--authoring-bundle--authoring-bundlesf agent preview start --json --authoring-bundle <BundleName> -o <org> | tee /tmp/preview_start.json
SESSION_ID=$(python3 -c "import json; print(json.load(open('/tmp/preview_start.json'))['result']['sessionId'])")
sf agent preview send --json --session-id "$SESSION_ID" --authoring-bundle <BundleName> \
--utterance "$UTT" -o <org> | tee /tmp/preview_response.json
sf agent preview end --json --session-id "$SESSION_ID" --authoring-bundle <BundleName> -o <org>.sfdx/agents/{BundleName}/sessions/{sessionId}/traces/{planId}.jsonsf agent preview start --json --authoring-bundle <BundleName> -o <org> | tee /tmp/preview_start.json
SESSION_ID=$(python3 -c "import json; print(json.load(open('/tmp/preview_start.json'))['result']['sessionId'])")
sf agent preview send --json --session-id "$SESSION_ID" --authoring-bundle <BundleName> \
--utterance "$UTT" -o <org> | tee /tmp/preview_response.json
sf agent preview end --json --session-id "$SESSION_ID" --authoring-bundle <BundleName> -o <org>.sfdx/agents/{BundleName}/sessions/{sessionId}/traces/{planId}.json| Issue type | Trace command |
|---|---|
| Subagent misroute | |
| Action not called | |
| LOW adherence | |
| Variable capture fail | |
| Vague instructions | |
--authoring-bundle.topic"DefaultTopic"NodeEntryStateStep.data.agent_namestart_agentSMALL_TALKstart_agent| 问题类型 | 追踪命令 |
|---|---|
| Subagent路由错误 | |
| 未调用操作 | |
| 低合规性 | |
| 变量捕获失败 | |
| 指令模糊 | |
--authoring-bundle.topic"DefaultTopic"NodeEntryStateStep.data.agent_namestart_agentstart_agentreferences/issue-classification.mdreferences/issue-classification.mdFull STDM query details, Apex service deployment, and response parsing: seereferences/stdm-queries.md
STDM查询详情、Apex服务部署和响应解析:请查看references/stdm-queries.md
AgentforceOptimizeServicesf data query --json --query "SELECT Id, Name FROM ApexClass WHERE Name = 'AgentforceOptimizeService'" -o <org>references/stdm-queries.mdAgentforceOptimizeServicesf data query --json --query "SELECT Id, Name FROM ApexClass WHERE Name = 'AgentforceOptimizeService'" -o <org>references/stdm-queries.mdfindSessions()DEBUG|STDM_RESULT:findSessionsfindSessions()DEBUG|STDM_RESULT:findSessionsgetMultipleConversationDetails()getMultipleConversationDetails()getLlmStepDetails()getLlmStepDetails()getAggregatedMetrics()getAggregatedMetrics()getMomentInsights()getMomentInsights()runObservabilityQuery()runObservabilityQuery()ConversationDataConversationDataFull issue pattern table and classification categories: seereferences/issue-classification.md
完整的问题模式表和分类类别:请查看references/issue-classification.md
.agentFull structural analysis checks, cross-reference procedures, and publish drift detection: seereferences/issue-classification.md
.agent.agent完整的结构分析检查、交叉引用流程和发布漂移检测:请查看references/issue-classification.md
.agentFull preview procedures, trace diagnosis commands, and classification criteria: seereferences/reproduce-reference.md
sf agent preview--authoring-bundle| Verdict | Criteria |
|---|---|
| Same failure in 3/3 runs |
| Failure in 1-2 of 3 runs |
| Passes in 3/3 runs |
[CONFIRMED][INTERMITTENT]sf agent preview start --json --authoring-bundle <Name> -o <org>
sf agent preview send --json --session-id "$SID" --utterance "<text>" --authoring-bundle <Name> -o <org>
sf agent preview end --json --session-id "$SID" --authoring-bundle <Name> -o <org>.sfdx/agents/{Name}/sessions/{sessionId}/traces/{planId}.json完整的预览流程、追踪诊断命令和分类标准:请查看references/reproduce-reference.md
sf agent preview--authoring-bundle| 结论 | 判定标准 |
|---|---|
| 3次运行均出现相同故障 |
| 1-2次运行出现故障 |
| 3次运行均通过 |
[CONFIRMED][INTERMITTENT]sf agent preview start --json --authoring-bundle <Name> -o <org>
sf agent preview send --json --session-id "$SID" --utterance "<text>" --authoring-bundle <Name> -o <org>
sf agent preview end --json --session-id "$SID" --authoring-bundle <Name> -o <org>.sfdx/agents/{Name}/sessions/{sessionId}/traces/{planId}.jsonFull procedures for pre-flight checks, fix mapping, instruction principles, regression prevention, deployment chain, verification, safety re-verification, and test case creation: seereferences/improve-reference.md
完整的预检流程、修复映射、指令原则、回归预防、部署链、验证、安全重验证和测试用例创建:请查看references/improve-reference.md
.agentsystem:.agentsystem:.agent.agentundefinedundefined
If publish fails, use deploy + activate fallback (note: incomplete -- does not propagate `reasoning: actions:` to live metadata).
若发布失败,则使用部署+激活的备选方案(注意:该方案不完整 -- 不会将`reasoning: actions:`同步到实时元数据)。Section 15 of /agentforce-generate.agent.agent/agentforce-generatesf agent test createsf agent test create| Reference | Contents |
|---|---|
| STDM query procedures, Apex service deployment, response parsing |
| Issue pattern table, root cause categories, structural analysis checks |
| Phase 2 preview procedures, trace diagnosis, classification criteria |
| Phase 3 editing, deployment chain, verification, safety, test cases |
| DMO field schemas, data hierarchy, quality notes, agent name resolution |
| 参考文件 | 内容 |
|---|---|
| STDM查询流程、Apex服务部署、响应解析 |
| 问题模式表、根因类别、结构分析检查 |
| 阶段2预览流程、追踪诊断、分类标准 |
| 阶段3编辑、部署链、验证、安全、测试用例 |
| DMO字段 schema、数据层级、质量说明、Agent名称解析 |