Files
orca/src/shared/antigravity-transcript-reference.test.ts
T
Neil 055871ade6 Continue Antigravity IDE and 2.0 history in new CLI conversations (#24692)
* feat(antigravity): bridge IDE history into new CLI conversations

* fix(antigravity): preserve fresh-launch model and environment for IDE references

* fix(antigravity): forward IDE history opt-in through desktop IPC

* fix(antigravity): rebuild remote IDE reference startup on its host

* fix(antigravity): register IDE continuation action labels

* fix(antigravity): confine IDE references and bound metadata reads

* fix(antigravity): localize IDE continuation badges

* Preserve scanner service cache assertions and refresh Antigravity opening metadata

* Preserve Antigravity opening joins and target folder runtime authority
2026-10-02 23:01:12 -07:00

89 lines
3.2 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { buildAiVaultResumeCommand } from './ai-vault-resume-command'
import { tokenizeCommandLine } from './agent-command-line-entrypoint'
import { antigravityTranscriptReferencePrompt } from './antigravity-session-origin'
import { normalizeAiVaultResumeFilePath } from './ai-vault-resume-path'
describe('Antigravity transcript reference launch', () => {
it.each(['antigravity-ide', 'antigravity'])(
'starts a new conversation for %s and preserves the explicit transcript argument',
(origin) => {
const path = `/home/example/.gemini/${origin}/brain/same-id/.system_generated/logs/transcript_full.jsonl`
const command = buildAiVaultResumeCommand({
agent: 'antigravity',
sessionId: 'same-id',
cwd: null,
platform: 'linux',
resumeFilePath: path
})
expect(tokenizeCommandLine(command)).toEqual([
'agy',
'--prompt-interactive',
antigravityTranscriptReferencePrompt(path)
])
expect(command).not.toContain('--conversation')
}
)
it('quotes hostile path text as one prompt argument', () => {
const path = `/tmp/a'$(touch forbidden)/.gemini/antigravity-ide/brain/id/.system_generated/logs/transcript.jsonl`
const command = buildAiVaultResumeCommand({
agent: 'antigravity',
sessionId: 'id',
cwd: null,
platform: 'linux',
resumeFilePath: path,
shell: 'posix'
})
expect(tokenizeCommandLine(command)).toEqual([
'agy',
'--prompt-interactive',
antigravityTranscriptReferencePrompt(path)
])
})
it('converts the selected WSL transcript into its owning Linux path', () => {
const path =
'\\\\wsl.localhost\\Ubuntu\\home\\example\\.gemini\\antigravity-ide\\brain\\id\\.system_generated\\logs\\transcript_full.jsonl'
const normalized = normalizeAiVaultResumeFilePath(path, 'linux')
const command = buildAiVaultResumeCommand({
agent: 'antigravity',
sessionId: 'id',
cwd: null,
platform: 'linux',
resumeFilePath: path
})
expect(tokenizeCommandLine(command)).toEqual([
'agy',
'--prompt-interactive',
antigravityTranscriptReferencePrompt(normalized!)
])
expect(command).not.toContain('wsl.localhost')
})
it.each(['cmd', 'powershell', 'posix'] as const)(
'uses the actual Windows %s shell and preserves CLI resume behavior',
(shell) => {
const path =
'C:\\User data\\.gemini\\antigravity-ide\\brain\\id\\.system_generated\\logs\\transcript_full.jsonl'
const command = buildAiVaultResumeCommand({
agent: 'antigravity',
sessionId: 'id',
cwd: null,
platform: 'win32',
resumeFilePath: path,
shell
})
expect(command).toContain('--prompt-interactive')
expect(command).not.toContain('--conversation')
const cli = buildAiVaultResumeCommand({
agent: 'antigravity',
sessionId: 'id',
cwd: null,
platform: 'win32',
resumeFilePath: path.replace('antigravity-ide', 'antigravity-cli'),
shell
})
expect(cli).toContain('--conversation')
expect(cli).not.toContain('--prompt-interactive')
}
)
})