feat: add History tab to resume prior agent sessions from disk @W-22434464@#205
Open
marcelinollano wants to merge 3 commits into
Open
feat: add History tab to resume prior agent sessions from disk @W-22434464@#205marcelinollano wants to merge 3 commits into
marcelinollano wants to merge 3 commits into
Conversation
Surfaces a new History tab in the agent webview that lists prior cached sessions read from .sfdx/agents/<key>/sessions/, the same on-disk format the sf CLI plugin uses. Clicking a row reattaches the agent via SDK resumeSession(sessionId), restores the transcript and traces, and hands control back to the Preview tab without restarting if the chosen session is already active. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <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.
What does this PR do?
Adds a new History tab to the Agentforce DX webview that lists prior cached agent sessions and lets you pick one back up where you left off.
.sfdx/agents/<storageKey>/sessions/, the same on-disk format used by thesfCLI plugin, so the list works regardless of which tool wrote the session.agentBase.resumeSession(sessionId)and switches to Preview.What issues does this PR fix or reference?
@W-22434464@ — [AFDX] [UX] Navigate history
Functionality Before
The webview only ever surfaced the most recent session. Switching agents or restarting wiped chat/tracer state with no way to revisit prior runs that were already on disk.
Functionality After
Testing Setup Notes
Tests
sessionHistoryService.test.ts(5 cases) covers the disk-read fallback chain.sessionManager.test.tswithresumeSessionhappy path, end-previous, error, and no-webview cases.webviewMessageHandlers.test.tswithlistSessions(success/empty/throw) andresumeSession(forward/short-circuit/missing sessionId).SessionHistory.test.tsxcovers placeholder, list rendering, empty state with start button, and click-to-resume.🤖 Generated with Claude Code