-
Notifications
You must be signed in to change notification settings - Fork 14.4k
feat: export session to file and import via flag #26514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
90eb3d2
feat: implement session export and import
cocosheng-g eca3bd3
fix: address PR feedback for session import and export
cocosheng-g 0e88678
fix: resolve TS compilation errors for session export
cocosheng-g af1438f
fix: refactor gemini.tsx based on PR review
cocosheng-g 21125e3
chore: fix lint errors in gemini.tsx and tests
cocosheng-g 030b9cc
chore: remove pr.md from the repository
cocosheng-g b8f4d0c
fix: resolve TS2322 in exportSessionCommand.test.ts
cocosheng-g d963248
chore: fix lint and build errors, stabilize tests
cocosheng-g 0b695e4
feat: make --session-file, --resume, and --session-id mutually exclusive
cocosheng-g f6ed220
test: add tests for session flag mutual exclusivity
cocosheng-g 4bba538
feat: add progress indicator for /export-session command
cocosheng-g 4ed15d7
feat: add import confirmation message to session history
cocosheng-g 20e2a78
feat: filter transient messages during session import
cocosheng-g a3e4fa9
feat: implement robust 'best effort' session import and add unit tests
cocosheng-g 40b1a3c
fix: resolve build errors in ExportSessionMessage.test.tsx
cocosheng-g c47f1f6
chore: fix test failure and resolve all remaining lint errors
cocosheng-g 4dac6b9
chore: fix last 4 ESLint errors
cocosheng-g 5489349
chore: resolve remaining lint and build issues
cocosheng-g f289d30
chore: apply prettier formatting
cocosheng-g a7b6458
fix: resolve Windows path issue in exportSessionCommand tests
cocosheng-g 5092115
fix: resolve remaining cross-platform path issues in tests
cocosheng-g f05b62d
test: fix missing path import in HistoryItemDisplay.test.tsx
cocosheng-g e698107
style: run prettier to fix formatting
cocosheng-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2025 Google LLC | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { describe, it, expect, vi, afterEach } from 'vitest'; | ||
| import { parseArguments } from './config.js'; | ||
| import { createTestMergedSettings } from './settings.js'; | ||
|
|
||
| describe('parseArguments mutual exclusivity', () => { | ||
| afterEach(() => { | ||
| vi.restoreAllMocks(); | ||
| }); | ||
|
|
||
| const combinations = [ | ||
| ['--resume', '--session-id', 'test-id'], | ||
| ['--resume', '--session-file', 'test.json'], | ||
| ['--session-id', 'test-id', '--session-file', 'test.json'], | ||
| ['--resume', '--session-id', 'test-id', '--session-file', 'test.json'], | ||
| ]; | ||
|
|
||
| combinations.forEach((args) => { | ||
| it(`should fail if ${args.filter((a) => a.startsWith('--')).join(' and ')} are provided`, async () => { | ||
| process.argv = ['node', 'script.js', ...args]; | ||
| const mockConsoleError = vi | ||
| .spyOn(console, 'error') | ||
| .mockImplementation(() => {}); | ||
| vi.spyOn(process, 'exit').mockImplementation(() => { | ||
| throw new Error('process.exit called'); | ||
| }); | ||
|
|
||
| await expect(parseArguments(createTestMergedSettings())).rejects.toThrow( | ||
| 'process.exit called', | ||
| ); | ||
|
|
||
| expect(mockConsoleError).toHaveBeenCalledWith( | ||
| expect.stringContaining( | ||
| 'The flags --resume, --session-id, and --session-file are mutually exclusive. Please provide only one.', | ||
| ), | ||
| ); | ||
| }); | ||
| }); | ||
| }); |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.