W-22203667: add preview session store functions to utils#269
Closed
andresrivas-sf wants to merge 2 commits intomainfrom
Closed
W-22203667: add preview session store functions to utils#269andresrivas-sf wants to merge 2 commits intomainfrom
andresrivas-sf wants to merge 2 commits intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
andresrivas-sf
added a commit
to salesforcecli/plugin-agent
that referenced
this pull request
Apr 27, 2026
The file:../agents dependency breaks CI since runners only clone this repo. Restore the full inline implementation and ^1.1.2 semver until forcedotcom/agents#269 merges and a new version is published, at which point previewSessionStore.ts can become the thin shim again. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
W-22203667 - Add createPreviewSessionCache, validatePreviewSession, removePreviewSessionCache, getCachedPreviewSessionIds, getCurrentPreviewSessionId, listCachedPreviewSessions to utils.ts so VS Code extension and CLI share the same storage layer - Introduce SessionType, PreviewSessionMeta, CachedPreviewSessionInfo, CachedPreviewSessionEntry types - Use atomic write (temp file + rename) for the index to avoid partial writes - Export all new functions and types from index.ts - Add tests covering create, validate, remove, list, ordering, fallback dir scan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3f400be to
ac831be
Compare
Contributor
Author
|
Superseded by #270 — rebased onto origin/main to exclude the unrelated SKILL.md commit from the diff. |
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
plugin-agentand into this library so the VS Code extension and the CLI share the same storage layer (per review feedback on W-22203667: add timestamp, session type, and index to agent preview sessions output salesforcecli/plugin-agent#400)createPreviewSessionCache,validatePreviewSession,removePreviewSessionCache,getCachedPreviewSessionIds,getCurrentPreviewSessionId,listCachedPreviewSessionstosrc/utils.tsSessionType,PreviewSessionMeta,CachedPreviewSessionInfo,CachedPreviewSessionEntrytypesrename) for the sessions index to reduce race conditions on concurrentstartcallssrc/index.tsTest plan
test/utils.test.tscovering create, validate, remove, list, index ordering, removal from index, and directory-scan fallbackyarn test:only)yarn lint)@W-22203667@
🤖 Generated with Claude Code