`agent preview` fails for published Employee Agents: `bypassUser: true` is hardcoded
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
So sánh src/agents/productionAgent.ts ở các dòng 355-362 với src/agents/scriptAgent.ts ở các dòng 481-493, bắt đầu bằng cách script path xác định bypassUser như thế nào. Xác minh với một Employee Agent đã được kích hoạt rằng sf agent preview tạo một session và trao đổi các message mà không gặp lỗi invalid-user.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
sf agent preview can never start a session with a published Employee Agent:
Error - Bad Request: Invalid user ID provided on start session:
productionAgent.ts hardcodes bypassUser: true:
Per the Agent API reference, true means "use the user associated with the agent" and is only for the client credentials flow; the default is false. Employee Agents have no agent user (BotDefinition.BotUserId is null by design), so the server resolves an empty user ID.
Same org, same agent, same JWT, varying only bypassUser:
| body | result |
|---|---|
bypassUser: true (what the CLI sends) |
400 Invalid user ID provided on start session: |
bypassUser: false |
200, session created, messages exchanged |
userId (explicit) |
400 Unrecognized field "userId" |
The Agent Script path in the same package already handles this:
The production (published agent) path is missing the equivalent.
Repro: deploy and activate any Employee Agent (reproduced with coral-cloud), then sf agent preview --api-name <agent>. The agent is listed as (Published), so discovery works — only the session start fails.
Suggested fix: derive bypassUser in productionAgent.ts instead of hardcoding it, mirroring scriptAgent.ts.
Workaround: none from the CLI (no flag or env var). Calling the Agent API directly with bypassUser: false works.
Env: @salesforce/cli 2.143.6, @salesforce/plugin-agent 1.44.4, @salesforce/agents 1.10.2, Node 24.18.0, macOS arm64, Agentforce Developer Edition (API v67.0)
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 571
- Fork
- 80
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của forcedotcom/cli
-
`sf agent preview` fails with `AgentApiNotFound` against staging (aws-stage1) orgs — `stage.api.salesforce.com` missing from endpoint fallbackCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:afdx owned by another team
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
forcedotcom/cli#3645 · 2 bình luận ·
-
sf agent mcp asset replace --assets null throws raw TypeError instead of InvalidShapeCó thể đã có người làm @konkonrong-lgtm đã nhận 64 ngày trước. Đang mởarea:afdx bug investigating owned by another team validated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
forcedotcom/cli#3625 · 4 bình luận ·
-
[BUG]: sf package version create always warns about org-capitalize-record-types, even when it's setĐang mởarea:packaging more information required owned by another team regression
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
forcedotcom/cli#3663 · 4 bình luận ·
-
[BUG]: NavigationMenu SourceMember name mismatch prevents source-tracked retrieve from completingĐang mởbug investigating validated
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
forcedotcom/cli#3660 · 3 bình luận ·
-
announcement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
forcedotcom/cli#3658 · 1 reaction ·
Tất cả issue của forcedotcom/cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 8 ngày
-
CLI Empathy needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
chromaui/chromatic-cli#1524 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type/automation type/performance
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
diagnose globalnet reports a failure for every exported headless ServiceCó thể đã có người làm @kurtyoon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
submariner-io/subctl#1948 ·
Maintainer thường phản hồi trong vòng 1 ngày