fix: COD-152 preserve generated artifact filenames

This commit is contained in:
Saqeb Akhter
2026-07-10 20:58:47 -04:00
committed by Aamer Akhter
parent f8aa93969b
commit 978ca57343
3 changed files with 5 additions and 109 deletions
+1 -41
View File
@@ -1,9 +1,5 @@
import { describe, expect, it } from 'vitest';
import {
buildRemoteGeneratedArtifactFetchArgs,
isAllowedGeneratedArtifactPath,
} from '../src/generated-artifact-attachments.js';
import type { SessionRemote } from '../src/types/session.js';
import { isAllowedGeneratedArtifactPath } from '../src/generated-artifact-attachments.js';
describe('generated artifact attachments', () => {
it('allows workspace artifacts and known Codex generated image directories', () => {
@@ -16,40 +12,4 @@ describe('generated artifact attachments', () => {
isAllowedGeneratedArtifactPath('/Users/aamer/.codex-personal/generated_images/../../.ssh/id_rsa.png', '/repo')
).toBe(false);
});
it('builds remote fetch argv from the session SSH configuration', () => {
const remote: SessionRemote = {
hostId: 'mac-mini',
label: 'mac-mini',
host: '192.168.1.20',
username: 'aamer',
port: 2222,
remotePath: '/Users/aamer/projects/app',
identityFile: '~/.ssh/remote_ed25519',
socksProxy: '127.0.0.1:1080',
jumpHost: 'jump.example.com',
extraSshOptions: ['StrictHostKeyChecking=no'],
};
expect(
buildRemoteGeneratedArtifactFetchArgs(remote, "/Users/aamer/.codex-personal/generated_images/a'b.png")
).toEqual([
'-o',
'BatchMode=yes',
'-p',
'2222',
'-i',
expect.stringMatching(/remote_ed25519$/),
'-J',
'jump.example.com',
'-o',
'ProxyCommand=nc -X 5 -x 127.0.0.1:1080 %h %p',
'-o',
'StrictHostKeyChecking=no',
'-o',
'ConnectTimeout=10',
'aamer@192.168.1.20',
"cat -- '/Users/aamer/.codex-personal/generated_images/a'\\''b.png'",
]);
});
});