agent preview start --authoring-bundle crashes for AgentforceEmployeeAgent without default_agent_user (reading 'replace')
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript, node.js
調査の方向性
報告された391行目の @salesforce/agents/lib/agents/scriptAgent.js から始め、近くにある AgentforceEmployeeAgent と bypassUser の処理を読んでください。default_agent_user を省略した従業員用オーサリングバンドルで再現し、関連するプレビューテストを実行してください。このケースでプレビューの開始時にクラッシュしなくなり、他のエージェントタイプも引き続き動作すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
sf agent preview start --authoring-bundle <name> crashes for an Agent Script agent of type AgentforceEmployeeAgent that has no default_agent_user in its config block (employee agents run as the logged-in user, so this field is not set).
Steps to reproduce
- Agent Script authoring bundle with:
(noconfig: developer_name: "My_Employee_Agent" agent_type: "AgentforceEmployeeAgent"default_agent_user) sf agent validate authoring-bundle --api-name My_Employee_Agent→ successsf agent preview start --authoring-bundle My_Employee_Agent --use-live-actions --target-org <sandbox> --json
Expected result
A preview session starts (as it does for sf agent preview start --api-name My_Employee_Agent on the published, activated version — that works fine).
Actual result
PreviewStartFailed: Failed to start preview session: Cannot read properties of undefined (reading 'replace')
cause: TypeError: Cannot read properties of undefined (reading 'replace')
at ScriptAgent.startPreview (@salesforce/agents/lib/agents/scriptAgent.js:391:93)
Cause
@salesforce/agents/lib/agents/scriptAgent.js line 391:
const escapedDefaultAgentUser = this.agentJson.globalConfiguration.defaultAgentUser.replace(/'/g, "''");
defaultAgentUser is undefined for employee agents without default_agent_user. A guard such as (defaultAgentUser ?? '') — or skipping the user lookup when it is undefined, since bypassUser is forced to false for AgentforceEmployeeAgent a few lines later anyway — would fix it.
System information
@salesforce/cli/2.156.8 darwin-arm64 node-v24.22.1@salesforce/plugin-agent2.2.3,@salesforce/agents2.3.1- Also reproduced on
@salesforce/cli/2.154.4 - Target org: sandbox, Agentforce employee agent
- 主要言語
- 言語のデータがありません
- スター
- 575
- フォーク
- 80
- 平均マージ
- 11時間 37分
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
forcedotcom/cli のほかの issue
-
sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShape対応中かも @konkonrong-lgtm が 85 日前に担当しました。 オープンarea:afdx bug investigating owned by another team validated
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
forcedotcom/cli#3625 · コメント 4 件 ·
-
area:afdx bug owned by another team
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
forcedotcom/cli#3608 · コメント 2 件 ·
-
Profile convert to metadata format is O(n²) per tag in `mergeProfiles` (13.8.3+), blocks the event loop for minutes on large profiles対応中かも @sfdcmatt が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
forcedotcom/cli#3681 ·
-
bug validated
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
forcedotcom/cli#3679 · コメント 3 件 ·
-
announcement
難易度 1/5 1時間未満 初心者へのやさしさ 58/100
forcedotcom/cli#3675 · コメント 1 件 ·
forcedotcom/cli の issue をすべて見る
似ている issue
-
t/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
dotnet/maui#39950 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
processing/p5.sound.js#132 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
drizzle-team/drizzle-orm#6639 ·
メンテナーはふだん 4 日以内に返信