fix: load supported document attachments (#205)

This commit is contained in:
Eyejoker
2026-05-31 22:30:49 +09:00
committed by GitHub
parent 778ed9b94a
commit b6e7e060cc
11 changed files with 398 additions and 30 deletions

View File

@@ -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) {

View File

@@ -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]' },
]);
});
});