feat: add --all flag to agent preview end (W-22203669)#406
Open
franciscoperezsammartino wants to merge 15 commits intomainfrom
Open
feat: add --all flag to agent preview end (W-22203669)#406franciscoperezsammartino wants to merge 15 commits intomainfrom
franciscoperezsammartino wants to merge 15 commits intomainfrom
Conversation
- Adds --all to end multiple preview sessions at once - When combined with --api-name or --authoring-bundle, ends only sessions for that specific agent; when used alone, ends all sessions in the project - Adds --no-prompt (-p) to skip the confirmation prompt shown by --all - Makes --target-org optional (no org needed for client-side session cleanup); raises a clear error when --api-name is used without --target-org - Restores inline previewSessionStore implementation (the @salesforce/agents shim was broken against the installed 1.1.1 version); adds getSessionDir and removeCacheById helpers needed by the --all code path - Adds 13 unit tests for the new end command behaviour Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add try/catch in endAll serial loop with structured PreviewEndPartialFailure error listing which sessions failed vs succeeded - Restore timestamp/sessionType columns on agent preview sessions (W-22203667 regression introduced by the shim revert in the previous commit) - Add three missing tests: --all+--api-name happy path, missing --target-org guard, and mid-loop failure with partial results assertions - Document --no-prompt only has effect when used with --all Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n union Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
jshackell-sfdc
left a comment
There was a problem hiding this comment.
see my small suggestions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…only Replace the bloated inline rewrite with the correct base (commit 57fb5f7, the last working inline implementation before the broken shim). Only the two helpers needed by --all are added on top: getSessionDir and removeCacheById. sessions.ts and start.ts are restored to their main state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
agentId was not in the original result type and is not needed by callers. Kept as an internal SessionTask type for routing within endAll. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use oclif dependsOn instead of a manual guard in run(). authoring-bundle does not need target-org since it works client-side only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The ScriptAgent/ProductionAgent branching was identical in the single-session path and the endAll loop. Extracted to a module-level function. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ped removeCache removeCache only needs getHistoryDir(), so the no-agent path in --all can pass a plain object instead of requiring a separate removeCacheById helper. Loosened removeCache/validatePreviewSession signatures to structural types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…force/agents to 1.2.0 The shim was inadvertently replaced with a full inline implementation. Restoring it to the re-export shim from main. Bumping agents to 1.2.0 which now exports the session store functions the shim references. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com>
Co-authored-by: Juliet Shackell <63259011+jshackell-sfdc@users.noreply.github.com>
Replaces manual inline object types with Pick<CommandFlags, ...> so the method signatures stay in sync with the flag definitions automatically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
--allflag toagent preview endto terminate multiple sessions at once--api-nameor--authoring-bundle: ends only sessions for that specific agent--no-prompt/-pflag to skip confirmation prompt (with--allonly)--target-orgoptional; guard throws when--api-nameis used without itPreviewEndPartialFailureerror listing succeeded/failed sessions on mid-loop failuretimestamp/sessionTypecolumns onagent preview sessions(W-22203667 regression from shim revert)Test plan
yarn test)agent preview end --allends all sessions and shows confirmation promptagent preview end --all --no-promptskips confirmationagent preview end --all --authoring-bundle <name>ends only sessions for that agentagent preview end --all --api-name <name> --target-org <org>ends only sessions for that agentagent preview end --all --api-name <name>(no org) throwsMissingTargetOrgForApiNameagent preview sessionsshows timestamp and sessionType columns🤖 Generated with Claude Code