fix: load supported document attachments (#205)
This commit is contained in:
@@ -2,7 +2,7 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {
|
||||
expandImagePromptReferences,
|
||||
expandPromptAttachmentReferences,
|
||||
extractImageTagPaths,
|
||||
imageTagCaption,
|
||||
missingImageTagCaption,
|
||||
@@ -23,7 +23,7 @@ export function parseAppServerInput(
|
||||
text: string,
|
||||
log: (message: string) => void = () => undefined,
|
||||
): AppServerInputItem[] {
|
||||
const expandedText = expandImagePromptReferences(text);
|
||||
const expandedText = expandPromptAttachmentReferences(text);
|
||||
const { imagePaths } = extractImageTagPaths(expandedText);
|
||||
const input: AppServerInputItem[] = [];
|
||||
const pushText = (value: string) => {
|
||||
@@ -59,8 +59,8 @@ export function parseAppServerInput(
|
||||
input.push({ type: 'localImage', path: part.path });
|
||||
log(`Adding image input: ${part.path}`);
|
||||
}
|
||||
} else if (text) {
|
||||
input.push({ type: 'text', text });
|
||||
} else if (expandedText) {
|
||||
input.push({ type: 'text', text: expandedText });
|
||||
}
|
||||
|
||||
if (input.length === 0) {
|
||||
|
||||
@@ -118,4 +118,12 @@ describe('codex app-server input', () => {
|
||||
{ type: 'localImage', path: imagePath },
|
||||
]);
|
||||
});
|
||||
|
||||
it('keeps supported document references visible for Codex when no structured document input exists', () => {
|
||||
const input = parseAppServerInput('증거\nMEDIA:/tmp/report.pdf');
|
||||
|
||||
expect(input).toEqual([
|
||||
{ type: 'text', text: '증거\n[File: report.pdf → /tmp/report.pdf]' },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user