Repository navigation
Conversation
…e failed step @W-24949433@ Address pre-review round 1: add target and failedStep to PublishedAgentInfo, name the <target> in the recovery action, tolerate a failed bundle-meta cleanup, document that a missing publishedAgent is not proof nothing was committed, and test a rejecting POST.
…was skipped @W-24949433@
…-post-commit-error
nico-pappagianis
approved these changes
Nov 20, 2026
This was referenced Nov 21, 2026
nico-pappagianis
approved these changes
Nov 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Follow-up to #350 (W-23735101).
publishAgentJsoncommits the new BotVersion in its first step (the POST toai-agent/v1.1/authoring/agents[/<botId>/versions]). The steps after that can still throw:getBotVersion,retrieveAgentMetadata(agentRetrievalError) anddeployAuthoringBundle(authoringBundleDeploymentError). When one does,sf agent publish authoring-bundlefails, and the error has nobotIdorbotVersionId. Callers, including CI loops and coding agents, can't tell the version actually landed. They retry, and each retry creates another BotVersion.Changes:
publishAgentJson: wraps the post-commit steps in a try/catch and rethrows through a newtoPublishedAgentError. The rethrown error:data.publishedAgent = { developerName, botId, botVersionId, versionNumber?, target?, failedStep }, wherefailedStepisbotVersionLookup,retrieveorbundleDeploy;<target>(<agent>.<version>) the bundle-meta.xml needs for a manual deploy, and it only mentions the retrieve step when retrieve wasn't skipped;agent_publish_post_commit_failedtelemetry, both includingfailedStep.deployAuthoringBundle: the<target>cleanup in the bundle-meta now runs in afinally. It no longer stays in local source when the deploy poll or listener throws. A failed cleanup write is logged at debug level and doesn't replace the deploy error.PublishedAgentInfo. This is additive only. Its JSDoc notes that a missingdata.publishedAgentdoesn't prove nothing was committed, since a POST timeout can still follow a commit.Nothing changes on the success path. Error names are the same, and with
sf … --json,dataandactionsshow up in the output automatically. plugin-agent and vscode-agents don't key on these error names, actions or data, so the change is non-breaking for them. (vscode-agents shows only.message, so VS Code users won't see the don't-republish action. Surfacing it there is a small follow-up, to be filed separately.)Testing
yarn buildand lint are clean.test/agentPublisher.test.ts:data.publishedAgent, the don't-republish action and telemetry;getBotVersionfailure reports the BotVersion Id without aversionNumber;publishedAgentinto the error's existingdata;<target>is removed from the local bundle-meta even when the deploy poll throws;The recovery action also names the target and skips the retrieve clause under
skipRetrieve, both asserted in the existing cases. The cleanup-write failure path has no unit test, because the ESMwriteFileimport isn't practical to stub.yarn testfails only in link-check, on external 403/429 responses for README and CODE_OF_CONDUCT links. That's unrelated to this change.What issues does this PR fix or reference?
@W-24949433@ (child of W-23735101)
Replaces #398 (moved to a fork).