Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ai): respect model vision capabilities and normalize image uploads (#7842)

Wolf Mermelstein165f71e47e5f
diff --git a/apps/web/src/features/agents-view/components/ChatComposer.test.tsx b/apps/web/src/features/agents-view/components/ChatComposer.test.tsx
index b7046dfc5a..a0589a0077 100644
--- a/apps/web/src/features/agents-view/components/ChatComposer.test.tsx
+++ b/apps/web/src/features/agents-view/components/ChatComposer.test.tsx
@@ -16,6 +16,18 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
import { RepositoryPicker } from '../views/RepositoryPicker';
import { ChatComposer, ChatSessionInput } from './ChatComposer';
+vi.mock('@service-connection/websocket', () => ({
+ ws: { addEventListener: vi.fn(), send: vi.fn() },
+ state: () => 'closed',
+ createConnectionBlockWebsocketEffect: vi.fn(),
+ createConnectionWebsocketEffect: vi.fn(),
+}));
+
+vi.mock('@service-storage/websocket', () => ({
+ storageWS: { reconnectIfDisconnected: vi.fn() },
+ createWebSocketJob: vi.fn(),
+}));
+
vi.mock('@core/agent-fold/client', () => ({
preloadAgentFold: vi.fn(async () => {}),
}));
@@ -666,3 +678,49 @@ it.each(['Repository', 'Branch'])(
expect(screen.getByTestId('editor')).toBe(input);
}
);
+
+it('blocks existing images on text-only models and preserves the draft until switching back', () => {
+ const send = vi.fn();
+ const [supportsImages, setSupportsImages] = createSignal(false);
+ const attachment: InputAttachmentData = {
+ id: 'image',
+ name: 'test.png',
+ kind: 'image',
+ };
+ render(() => (
+ <ChatSessionInput
+ onSend={send}
+ supportsImages={supportsImages()}
+ attachments={[attachment]}
+ />
+ ));
+ type('Describe this');
+ expect(screen.getByRole('status').textContent).toContain(
+ 'does not support images'
+ );
+ expect(
+ screen.getByRole('button', { name: 'Send' }).hasAttribute('disabled')
+ ).toBe(true);
+ editor.enter?.(undefined, 'Describe this');
+ expect(send).not.toHaveBeenCalled();
+ expect(editor.clear).not.toHaveBeenCalled();
+ setSupportsImages(true);
+ fireEvent.click(screen.getByRole('button', { name: 'Send' }));
+ expect(send).toHaveBeenCalledWith('Describe this', [attachment]);
+});
+
+it('refuses pasted images for text-only models but still accepts documents', () => {
+ const attach = vi.fn();
+ render(() => (
+ <ChatSessionInput
+ onSend={vi.fn()}
+ onAttachFiles={attach}
+ supportsImages={false}
+ />
+ ));
+ const document = new File(['hello'], 'note.txt', { type: 'text/plain' });
+ // Missing browser MIME types still use the image extension.
+ const image = new File(['image'], 'picture.PNG');
+ editor.paste?.([image, document], []);
+ expect(attach).toHaveBeenCalledWith([document]);
+});
diff --git a/apps/web/src/features/agents-view/components/ChatComposer.tsx b/apps/web/src/features/agents-view/components/ChatComposer.tsx
index c3e63b2729..1a567c3701 100644
--- a/apps/web/src/features/agents-view/components/ChatComposer.tsx
+++ b/apps/web/src/features/agents-view/components/ChatComposer.tsx
@@ -8,11 +8,13 @@ import { createComposerDictation } from '@app/features/dictation/composer-dictat
import { InputProvider } from '@channel/Input/context';
import { Input } from '@channel/Input/Input';
import type { InputAttachmentData, InputCommands } from '@channel/Input/types';
+import { getAttachmentKindFromFile } from '@channel/Input/utils/file-helpers';
import { useMacroMentionLinkResolver } from '@components/app/split-layout/split-router/mention-links';
import { preloadAgentFold } from '@core/agent-fold/client';
import { buildConfig } from '@core/component/LexicalMarkdown/builder/MarkdownConfigBuilder';
import { MarkdownShell } from '@core/component/LexicalMarkdown/builder/MarkdownShell';
import { createComposerLayout } from '@core/component/LexicalMarkdown/utils/create-composer-layout';
+import { toast } from '@core/component/Toast/Toast';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { useTouchOutsideToDismissKeyboard } from '@core/mobile/useTouchOutsideToDismissKeyboard';
import { handleFileFolderDrop } from '@core/util/upload';
@@ -29,6 +31,7 @@ import {
onMount,
Show,
} from 'solid-js';
+import { IMAGE_INPUT_WARNING } from '../../block-agent/state/image-input';
import { createChatComposerTip } from '../primitives/chat-composer-tip';
/** Shared input that starts on one line and grows with the draft. */
@@ -41,6 +44,7 @@ export function ChatComposer(props: {
draft: string;
onDraftChange: (draft: string) => void;
blockedReason?: string;
+ supportsImages?: boolean | null;
selector: JSX.Element;
onSend: (prompt: string, attachments: InputAttachmentData[]) => void;
session?: AgentInputProps;
@@ -59,9 +63,18 @@ export function ChatComposer(props: {
const hasContent = () => !!props.draft.trim() || attachments().length > 0;
const hasPendingAttachments = () =>
attachments().some((file) => file.pending);
+ const hasUnsupportedImages = () =>
+ props.supportsImages === false &&
+ attachments().some((file) => file.kind === 'image');
const canAttach = () => !!props.onAttachFiles && !disabled();
const attachFiles = (files: File[]) => {
- if (canAttach() && files.length > 0) props.onAttachFiles?.(files);
+ if (!canAttach() || files.length === 0) return;
+ const accepted =
+ props.supportsImages === false
+ ? files.filter((file) => getAttachmentKindFromFile(file) !== 'image')
+ : files;
+ if (accepted.length !== files.length) toast.failure(IMAGE_INPUT_WARNING);
+ if (accepted.length) props.onAttachFiles?.(accepted);
};
const [isDraggedOver, setIsDraggedOver] = createSignal(false);
const inputCommands: InputCommands = {
@@ -182,6 +195,7 @@ export function ChatComposer(props: {
if (
(!prompt && attachments().length === 0) ||
hasPendingAttachments() ||
+ hasUnsupportedImages() ||
dictation.active() ||
disabled()
)
@@ -342,6 +356,7 @@ export function ChatComposer(props: {
disabled={
!hasContent() ||
hasPendingAttachments() ||
+ hasUnsupportedImages() ||
disabled()
}
onClick={() => send()}
@@ -379,6 +394,11 @@ export function ChatComposer(props: {
</Input.DropZone>
<DictationPanel dictation={dictation} />
</ComposerSurface>
+ <Show when={props.supportsImages === false}>
+ <p role="status" class="px-3 py-1 text-xs text-ink-muted">
+ {IMAGE_INPUT_WARNING}
+ </p>
+ </Show>
<DictationFeedback dictation={dictation} />
<Show when={props.drawer}>
<div
@@ -419,6 +439,7 @@ export function ChatSessionInput(props: AgentInputProps) {
selector={props.modelControl}
onSend={props.onSend}
session={props}
+ supportsImages={props.supportsImages}
attachments={props.attachments}
onAttachFiles={props.onAttachFiles}
onRemoveAttachment={props.onRemoveAttachment}
diff --git a/apps/web/src/features/agents-view/views/NewChatPage.tsx b/apps/web/src/features/agents-view/views/NewChatPage.tsx
index 3ec7f821a9..9cd38c2f16 100644
--- a/apps/web/src/features/agents-view/views/NewChatPage.tsx
+++ b/apps/web/src/features/agents-view/views/NewChatPage.tsx
@@ -359,6 +359,11 @@ export function NewChatPage(props: {
drawerOpen={coding()}
placeholder={coding() ? 'Describe what you want to build' : undefined}
onSend={send}
+ supportsImages={
+ selectedCatalog
+ .models()
+ .find((model) => model.id === composerModelOverride())?.supportsImages
+ }
attachments={attachmentTracker().attachments()}
onAttachFiles={attachFiles}
onRemoveAttachment={(attachment) =>
diff --git a/apps/web/src/features/block-agent/component/AgentComposer.tsx b/apps/web/src/features/block-agent/component/AgentComposer.tsx
index 476fa2eba2..aa861853bf 100644
--- a/apps/web/src/features/block-agent/component/AgentComposer.tsx
+++ b/apps/web/src/features/block-agent/component/AgentComposer.tsx
@@ -343,6 +343,11 @@ export function AgentComposer(props: {
onSendNext={() => {
if (!readOnly()) sendNext();
}}
+ supportsImages={
+ metadata()?.supportedModels.find(
+ (model) => model.id === metadata()?.model
+ )?.supportsImages
+ }
attachments={attachmentTracker.attachments()}
onAttachFiles={attachFiles}
onRemoveAttachment={(attachment) =>
diff --git a/apps/web/src/features/block-agent/component/prompt-action.ts b/apps/web/src/features/block-agent/component/prompt-action.ts
index 79f46b85c5..211ed07157 100644
--- a/apps/web/src/features/block-agent/component/prompt-action.ts
+++ b/apps/web/src/features/block-agent/component/prompt-action.ts
@@ -7,7 +7,7 @@
*/
import type { InputAttachmentData } from '@channel/Input';
-import { staticFileIdEndpoint } from '@core/constant/servers';
+import { staticFileReferenceEndpoint } from '@core/constant/servers';
import type {
AgentPromptAction,
PromptAttachment,
@@ -19,7 +19,7 @@ import type {
*/
function promptAttachmentOf(attachment: InputAttachmentData): PromptAttachment {
return {
- uri: staticFileIdEndpoint(attachment.id),
+ uri: staticFileReferenceEndpoint(attachment.id),
name: attachment.name,
...(attachment.mimeType ? { mimeType: attachment.mimeType } : {}),
...(attachment.size !== undefined ? { size: attachment.size } : {}),
diff --git a/apps/web/src/features/block-agent/state/image-input.ts b/apps/web/src/features/block-agent/state/image-input.ts
new file mode 100644
index 0000000000..5b5cc1051e
--- /dev/null
+++ b/apps/web/src/features/block-agent/state/image-input.ts
@@ -0,0 +1,3 @@
+/** Shared copy for model capability warnings in agent composers. */
+export const IMAGE_INPUT_WARNING =
+ 'This model does not support images. Choose a vision model to attach images.';
diff --git a/apps/web/src/features/block-agent/ui/AgentInput.test.tsx b/apps/web/src/features/block-agent/ui/AgentInput.test.tsx
index df2fb4f0da..8592ed9c88 100644
--- a/apps/web/src/features/block-agent/ui/AgentInput.test.tsx
+++ b/apps/web/src/features/block-agent/ui/AgentInput.test.tsx
@@ -17,6 +17,18 @@ import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { AGENT_INPUT_TEXT_AREA_ID, AgentInput } from './AgentInput';
+vi.mock('@service-connection/websocket', () => ({
+ ws: { addEventListener: vi.fn(), send: vi.fn() },
+ state: () => 'closed',
+ createConnectionBlockWebsocketEffect: vi.fn(),
+ createConnectionWebsocketEffect: vi.fn(),
+}));
+
+vi.mock('@service-storage/websocket', () => ({
+ storageWS: { reconnectIfDisconnected: vi.fn() },
+ createWebSocketJob: vi.fn(),
+}));
+
vi.mock('@core/agent-fold/client', () => ({
preloadAgentFold: vi.fn(async () => {}),
}));
@@ -404,3 +416,20 @@ it('expands for a short quote and collapses when replaced with a paragraph', ()
);
expect(layout?.getAttribute('data-composer-compact')).toBe('true');
});
+
+it('keeps an attached image and text unsent while the selected model is text-only', () => {
+ const send = vi.fn();
+ render(() => (
+ <AgentInput
+ onSend={send}
+ supportsImages={false}
+ attachments={[{ id: 'image', name: 'test.png', kind: 'image' }]}
+ />
+ ));
+ expect(screen.getByRole('status').textContent).toContain(
+ 'does not support images'
+ );
+ editor.enter?.();
+ expect(send).not.toHaveBeenCalled();
+ expect(editor.clear).not.toHaveBeenCalled();
+});
diff --git a/apps/web/src/features/block-agent/ui/AgentInput.tsx b/apps/web/src/features/block-agent/ui/AgentInput.tsx
index 187925f14b..777402c074 100644
--- a/apps/web/src/features/block-agent/ui/AgentInput.tsx
+++ b/apps/web/src/features/block-agent/ui/AgentInput.tsx
@@ -1,4 +1,7 @@
+import { getAttachmentKindFromFile } from '@channel/Input/utils/file-helpers';
+import { toast } from '@core/component/Toast/Toast';
import { createResizeObserver } from '@solid-primitives/resize-observer';
+import { IMAGE_INPUT_WARNING } from '../state/image-input';
/**
* The agent block's composer: the chat input's look and its markdown editing
* surface (`MarkdownShell` over a lean `EditorConfigBuilder`), including `@`
@@ -50,6 +53,8 @@ export const AGENT_INPUT_TEXT_AREA_ID = 'agent-input-text-area';
export type QuoteInsert = (text: string) => void;
export interface AgentInputProps {
+ /** Image capability of the selected model; unknown runtimes omit it. */
+ supportsImages?: boolean | null;
placeholder?: string;
/** Context to seed in the composer without sending it. */
initialInput?: string;
@@ -156,7 +161,12 @@ export function AgentInput(props: AgentInputProps) {
attachments().some((attachment) => attachment.pending);
const attachFiles = (files: File[]) => {
if (!canAttach() || files.length === 0) return;
- props.onAttachFiles?.(files);
+ const accepted =
+ props.supportsImages === false
+ ? files.filter((file) => getAttachmentKindFromFile(file) !== 'image')
+ : files;
+ if (accepted.length !== files.length) toast.failure(IMAGE_INPUT_WARNING);
+ if (accepted.length) props.onAttachFiles?.(accepted);
};
// Sending while busy is allowed — the service queues prompts behind the
@@ -165,6 +175,10 @@ export function AgentInput(props: AgentInputProps) {
const canSend = () =>
(markdown().trim().length > 0 || attachments().length > 0) &&
!hasPendingAttachments() &&
+ !(
+ props.supportsImages === false &&
+ attachments().some((file) => file.kind === 'image')
+ ) &&
!props.disabled &&
!props.readOnly &&
!dictation.active();
@@ -330,6 +344,11 @@ export function AgentInput(props: AgentInputProps) {
classList={{ 'opacity-50': props.readOnly }}
>
{/* Desktop: the model pill sits above the box, as it always has. */}
+ <Show when={props.supportsImages === false}>
+ <p role="status" class="px-3 py-1 text-xs text-ink-muted">
+ {IMAGE_INPUT_WARNING}
+ </p>
+ </Show>
<Show when={!isTouchDevice() && props.modelControl}>
<div class="flex items-center px-0.5">{props.modelControl}</div>
</Show>
diff --git a/apps/web/src/lib/core/constant/servers.test.ts b/apps/web/src/lib/core/constant/servers.test.ts
index 91d4965421..1a71a1988e 100644
--- a/apps/web/src/lib/core/constant/servers.test.ts
+++ b/apps/web/src/lib/core/constant/servers.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, it } from 'vitest';
+import { afterEach, describe, expect, it, vi } from 'vitest';
import { staticFileSizedUrl } from './servers';
describe('staticFileSizedUrl', () => {
@@ -15,3 +15,39 @@ describe('staticFileSizedUrl', () => {
).toBe('https://static.macro.com/file/avatar-id?size=320');
});
});
+
+afterEach(() => {
+ vi.unstubAllEnvs();
+ vi.unstubAllGlobals();
+ vi.resetModules();
+});
+
+it('keeps browser image URLs proxied but gives the agent a fetchable hosted URL', async () => {
+ vi.stubEnv('MODE', 'development');
+ vi.stubEnv('VITE_DEV_PROXY', 'true');
+ vi.stubEnv('VITE_LOCAL_SERVERS', '');
+ vi.stubGlobal('location', { origin: 'https://localhost:3003' });
+ vi.resetModules();
+ const { staticFileIdEndpoint, staticFileReferenceEndpoint } = await import(
+ './servers'
+ );
+ expect(staticFileIdEndpoint('test-image')).toBe(
+ 'https://localhost:3003/__macro_dev/static/file/test-image'
+ );
+ expect(staticFileReferenceEndpoint('test-image')).toBe(
+ 'https://static-file-service-dev.macro.com/file/test-image'
+ );
+});
+
+it('preserves local-stack image references for the local attachment resolver', async () => {
+ vi.stubEnv('MODE', 'development');
+ vi.stubEnv('VITE_DEV_PROXY', 'true');
+ vi.stubEnv('VITE_LOCAL_SERVERS', 'ALL');
+ vi.stubEnv('VITE_LOCAL_BACKEND_ORIGIN', 'https://localhost:27709');
+ vi.stubGlobal('location', new URL('https://localhost:3003'));
+ vi.resetModules();
+ const { staticFileReferenceEndpoint } = await import('./servers');
+ expect(staticFileReferenceEndpoint('test-image')).toBe(
+ 'https://localhost:27709/static-file/file/test-image'
+ );
+});
diff --git a/apps/web/src/lib/core/constant/servers.ts b/apps/web/src/lib/core/constant/servers.ts
index 1979b967da..28f1b1968b 100644
--- a/apps/web/src/lib/core/constant/servers.ts
+++ b/apps/web/src/lib/core/constant/servers.ts
@@ -232,6 +232,14 @@ export function staticFileIdEndpoint(id: string): string {
return `${SERVER_HOSTS['static-file']}/file/${id}`;
}
+/** A static-file reference consumed by a backend, outside the browser proxy. */
+export function staticFileReferenceEndpoint(id: string): string {
+ const host = SERVER_HOSTS['static-file'];
+ const remote = directServerHostRemote['static-file'];
+ const referenceHost = host === developmentProxyUrl(remote) ? remote : host;
+ return `${referenceHost}/file/${id}`;
+}
+
type StaticFileSize = 'small' | 'medium';
const staticFileSizes: Record<StaticFileSize, number> = {
diff --git a/apps/web/src/lib/service-clients/service-agent-fold/generated/types.ts b/apps/web/src/lib/service-clients/service-agent-fold/generated/types.ts
index 8817afcb17..56ac9e5920 100644
--- a/apps/web/src/lib/service-clients/service-agent-fold/generated/types.ts
+++ b/apps/web/src/lib/service-clients/service-agent-fold/generated/types.ts
@@ -456,7 +456,9 @@ export type FailureNoticeKind =
* The person's own account with the provider has no budget left for
* this work; the fix is on the provider's billing page.
*/
- 'provider_usage_limit';
+ | 'provider_usage_limit'
+ /** The selected model cannot read image attachments in this conversation. */
+ | 'unsupported_image_input';
/** A file modification a tool reported. */
export type FileDiff = {
@@ -714,6 +716,8 @@ export type ModelOption = {
name: string;
/** Descriptive copy - pricing, context size, and the like. */
description: string | null;
+ /** Image input support, absent when the runtime does not advertise it. */
+ supportsImages?: boolean | null;
/**
* The heading the runtime listed this model under, when it grouped its
* options (ACP's `SessionConfigSelectGroup.name`). `None` for a runtime
diff --git a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/agentModelDto.ts b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/agentModelDto.ts
index 9058d5fe5b..6669fee4b4 100644
--- a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/agentModelDto.ts
+++ b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/agentModelDto.ts
@@ -6,6 +6,7 @@
*/
import type { AgentModelDtoDescription } from './agentModelDtoDescription';
import type { AgentModelDtoGroup } from './agentModelDtoGroup';
+import type { AgentModelDtoSupportsImages } from './agentModelDtoSupportsImages';
/**
* One model picker option.
@@ -19,4 +20,6 @@ export interface AgentModelDto {
id: string;
/** Display name. */
name: string;
+ /** Image input support, absent when the runtime does not advertise it. */
+ supportsImages?: AgentModelDtoSupportsImages;
}
diff --git a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/agentModelDtoSupportsImages.ts b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/agentModelDtoSupportsImages.ts
new file mode 100644
index 0000000000..062288698b
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/agentModelDtoSupportsImages.ts
@@ -0,0 +1,11 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * agent_harness_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * Image input support, absent when the runtime does not advertise it.
+ */
+export type AgentModelDtoSupportsImages = boolean | null;
diff --git a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/index.ts
index e9d99616be..f857e2ca47 100644
--- a/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/index.ts
+++ b/apps/web/src/lib/service-clients/service-agent-harness/generated/schemas/index.ts
@@ -42,6 +42,7 @@ export * from './agentConfigSelectOptionDtoGroup';
export * from './agentModelDto';
export * from './agentModelDtoDescription';
export * from './agentModelDtoGroup';
+export * from './agentModelDtoSupportsImages';
export * from './agentModelsStatusDto';
export * from './agentPermissionAction';
export * from './agentPromptAction';
diff --git a/apps/web/src/lib/service-clients/service-agent-harness/openapi.json b/apps/web/src/lib/service-clients/service-agent-harness/openapi.json
index 452b92b16e..929013f7dc 100644
--- a/apps/web/src/lib/service-clients/service-agent-harness/openapi.json
+++ b/apps/web/src/lib/service-clients/service-agent-harness/openapi.json
@@ -2503,6 +2503,10 @@
"name": {
"type": "string",
"description": "Display name."
+ },
+ "supportsImages": {
+ "type": ["boolean", "null"],
+ "description": "Image input support, absent when the runtime does not advertise it."
}
}
},
diff --git a/crates/agent/src/test/test_convert.rs b/crates/agent/src/test/test_convert.rs
index c13dc2f334..2c94321bc3 100644
--- a/crates/agent/src/test/test_convert.rs
+++ b/crates/agent/src/test/test_convert.rs
@@ -638,3 +638,20 @@ mod merge_consecutive_parts_tests {
assert!(merge_consecutive_parts(vec![]).is_empty());
}
}
+
+#[test]
+fn normalized_uploaded_image_has_the_mime_type_required_by_gemini() {
+ let image = ImageData::try_from_bytes(ONE_BY_ONE_PNG.to_vec()).unwrap();
+ let message = user_msg_with_attachment("describe", vec![AttachmentPart::Image(image)]);
+ let rig_message = to_rig_messages(&[message]).remove(0);
+ let content =
+ rig_core::providers::gemini::completion::gemini_api_types::Content::try_from(rig_message)
+ .expect("normalized uploads must convert for Gemini");
+ let wire = serde_json::to_value(content).unwrap();
+ assert_eq!(wire["parts"][1]["inlineData"]["mimeType"], "image/webp");
+ assert!(
+ wire["parts"][1]["inlineData"]["data"]
+ .as_str()
+ .is_some_and(|data| !data.is_empty())
+ );
+}
diff --git a/crates/agent_harness/src/inbound/model_load.rs b/crates/agent_harness/src/inbound/model_load.rs
index 7f90277400..faff0ead93 100644
--- a/crates/agent_harness/src/inbound/model_load.rs
+++ b/crates/agent_harness/src/inbound/model_load.rs
@@ -74,6 +74,9 @@ pub struct AgentModelDto {
pub name: String,
/// Optional provider description.
pub description: Option<String>,
+ /// Image input support, absent when the runtime does not advertise it.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub supports_images: Option<bool>,
/// Optional group heading supplied by the provider.
pub group: Option<String>,
}
@@ -116,6 +119,7 @@ impl From<AgentModels> for LoadAgentModelsResponse {
name: model.name,
description: model.description,
group: model.group,
+ supports_images: model.supports_images,
})
.collect(),
}
diff --git a/crates/agent_harness/src/inbound/model_load/test.rs b/crates/agent_harness/src/inbound/model_load/test.rs
index 77efd93816..7c0b5e9eb8 100644
--- a/crates/agent_harness/src/inbound/model_load/test.rs
+++ b/crates/agent_harness/src/inbound/model_load/test.rs
@@ -50,6 +50,7 @@ async fn successful_response_serializes_available_catalog() {
models: vec![agent_fold::domain::model::ModelOption {
id: "fast".to_owned(),
name: "Fast".to_owned(),
+ supports_images: None,
description: None,
group: None,
}],
diff --git a/crates/agent_inmem/src/domain/agent.rs b/crates/agent_inmem/src/domain/agent.rs
index 6d4f71407f..9a17c3fdb6 100644
--- a/crates/agent_inmem/src/domain/agent.rs
+++ b/crates/agent_inmem/src/domain/agent.rs
@@ -34,6 +34,7 @@ use agent_client_protocol::{
Agent, Channel as AcpChannel, Client, ConnectionTo, Error as AcpError,
};
use agent_runtime_protocol::domain::action::MODEL_CONFIG_ID;
+use agent_runtime_protocol::domain::turn::{FailureNotice, FailureNoticeKind};
use agent_session::domain::model::AgentSessionId;
use ai_billing::domain::AiAdmissionService;
use ai_tools::user_tool_review::{
@@ -889,6 +890,25 @@ async fn run_turn(
if !access.allows(&model) {
return Err(model_access_error(ModelAccessError::Forbidden));
}
+ // Check the full history as well: changing models must not send earlier
+ // images to a text-only provider or silently discard what the user attached.
+ if super::models::supports_images(&model) == Some(false)
+ && messages.iter().any(|message| {
+ message
+ .attachments
+ .as_ref()
+ .is_some_and(super::session::contains_images)
+ })
+ {
+ let notice = FailureNotice {
+ kind: FailureNoticeKind::UnsupportedImageInput,
+ title: format!("{} does not support images", super::models::display_name(&model)),
+ body: "Choose a vision model to continue this conversation, or start a conversation without images.".to_owned(),
+ link: None,
+ };
+ return Err(AcpError::new(-32602, notice.title.clone())
+ .data(serde_json::to_value(notice).expect("failure notice is serializable")));
+ }
let awaiting = Arc::new(AwaitingUser::default());
let requester = user_input_requester(state, connection, acp_session_id.clone(), &awaiting);
let mut parts = state.engine.run_turn(TurnRequest {
diff --git a/crates/agent_inmem/src/domain/agent/test.rs b/crates/agent_inmem/src/domain/agent/test.rs
index f8fd717c83..895b3b174f 100644
--- a/crates/agent_inmem/src/domain/agent/test.rs
+++ b/crates/agent_inmem/src/domain/agent/test.rs
@@ -2023,6 +2023,60 @@ async fn downgrade_and_permission_failure_cannot_run_a_paid_model() {
}
}
+#[tokio::test]
+async fn text_only_model_rejects_new_and_historical_images_without_running_the_engine() {
+ let engine = Arc::new(ScriptedEngine::new(vec![StreamPart::Content("red".into())]));
+ with_admission(
+ Arc::clone(&engine),
+ Arc::new(DisabledAiAdmissionService),
+ async |connection, session, state| {
+ let image_prompt = || {
+ PromptRequest::new(
+ session.clone(),
+ vec![ContentBlock::ResourceLink(
+ ResourceLink::new(
+ "red.png",
+ "https://static.example/file/11111111-1111-4111-8111-111111111111",
+ )
+ .mime_type("image/png".to_owned()),
+ )],
+ )
+ };
+ state.set_model("fireworks/glm-5p3".to_owned());
+ let error = connection
+ .send_request(image_prompt())
+ .block_task()
+ .await
+ .expect_err("a text-only model must reject images");
+ assert!(format!("{error:?}").contains("does not support images"));
+ assert!(format!("{error:?}").contains("unsupported_image_input"));
+ assert!(engine.requests().is_empty());
+
+ // A rejected image must not enter history or poison a text-only turn.
+ connection
+ .send_request(text_prompt(&session, "hello"))
+ .block_task()
+ .await
+ .expect("text-only turns still work");
+ state.set_model("fireworks/kimi-k3".to_owned());
+ connection
+ .send_request(image_prompt())
+ .block_task()
+ .await
+ .expect("vision model accepts the original image");
+ state.set_model("fireworks/glm-5p3".to_owned());
+ let error = connection
+ .send_request(text_prompt(&session, "what color was it?"))
+ .block_task()
+ .await
+ .expect_err("historical images need vision too");
+ assert!(format!("{error:?}").contains("does not support images"));
+ assert_eq!(engine.requests().len(), 2);
+ },
+ )
+ .await;
+}
+
#[tokio::test]
async fn changing_speed_applies_to_next_turn_and_rejects_unsupported_models() {
struct SpeedEngine(ScriptedEngine);
diff --git a/crates/agent_inmem/src/domain/model_options.rs b/crates/agent_inmem/src/domain/model_options.rs
index 89c1c4c0a2..ef13e37275 100644
--- a/crates/agent_inmem/src/domain/model_options.rs
+++ b/crates/agent_inmem/src/domain/model_options.rs
@@ -22,6 +22,16 @@ pub fn session_config_options(
SessionConfigValueId::new((*model).to_owned()),
super::models::display_name(model),
)
+ .meta(super::models::supports_images(model).map(|supported| {
+ serde_json::Map::from_iter([(
+ "macro.supportsImages".to_owned(),
+ serde_json::Value::Bool(supported),
+ )])
+ }))
+ .description(
+ (super::models::supports_images(model) == Some(false))
+ .then(|| "Text only — image attachments are not supported".to_owned()),
+ )
})
.collect();
let mut config = vec![
diff --git a/crates/agent_inmem/src/domain/model_options/test.rs b/crates/agent_inmem/src/domain/model_options/test.rs
index ee2f71869a..e79df4c988 100644
--- a/crates/agent_inmem/src/domain/model_options/test.rs
+++ b/crates/agent_inmem/src/domain/model_options/test.rs
@@ -22,6 +22,34 @@ fn routed_options_use_house_names() {
);
}
+#[test]
+fn model_image_capability_survives_acp_projection() {
+ let options = model_config_options(
+ "fireworks/glm-5p3",
+ &[
+ "fireworks/glm-5p3",
+ "fireworks/kimi-k3",
+ "cerebras/gpt-oss-120b",
+ "custom/model",
+ ],
+ );
+ let models = model_selection(&options).unwrap().options;
+ assert_eq!(
+ models
+ .iter()
+ .map(|model| model.supports_images)
+ .collect::<Vec<_>>(),
+ vec![Some(false), Some(true), Some(false), None]
+ );
+ assert!(
+ models[0]
+ .description
+ .as_deref()
+ .unwrap()
+ .contains("Text only")
+ );
+}
+
#[test]
fn speed_is_advertised_only_for_supported_models_with_current_value() {
use agent::{ModelSpeed, ReasoningEffort};
diff --git a/crates/agent_inmem/src/domain/models.rs b/crates/agent_inmem/src/domain/models.rs
index decc815c42..c4b2b760a4 100644
--- a/crates/agent_inmem/src/domain/models.rs
+++ b/crates/agent_inmem/src/domain/models.rs
@@ -55,5 +55,32 @@ pub fn advertised_models() -> &'static [&'static str] {
.as_slice()
}
+/// Image input support for the models in Macro's catalog.
+///
+/// This is model-specific, not provider-specific. Sources (2026-10-08):
+/// https://fireworks.ai/models (Vision versus LLM classification) and
+/// https://huggingface.co/openai/gpt-oss-120b
+/// Verified with image requests as well: Fireworks' list-models metadata
+/// incorrectly marks MiniMax M3 as text-only, but it reads image colors and text.
+/// Unknown models remain unknown rather than being advertised as text-only.
+#[must_use]
+pub fn supports_images(id: &str) -> Option<bool> {
+ if CHAT_MODELS.contains(&id) {
+ return Some(true);
+ }
+ match id {
+ "fireworks/kimi-k3"
+ | "fireworks/muse-glimmer-30b"
+ | "fireworks/glm-5p3-flash"
+ | "fireworks/qwen3p8-max"
+ | "fireworks/minimax-m3" => Some(true),
+ "fireworks/deepseek-v4-pro-0813"
+ | "fireworks/glm-5p3"
+ | "fireworks/nemotron-lightning-3p5-30b-a3b"
+ | "cerebras/gpt-oss-120b" => Some(false),
+ _ => None,
+ }
+}
+
#[cfg(test)]
mod test;
diff --git a/crates/agent_inmem/src/domain/models/test.rs b/crates/agent_inmem/src/domain/models/test.rs
index b0aea8fe2d..c98c7992d9 100644
--- a/crates/agent_inmem/src/domain/models/test.rs
+++ b/crates/agent_inmem/src/domain/models/test.rs
@@ -59,3 +59,13 @@ fn routed_models_use_known_providers() {
);
}
}
+
+#[test]
+fn every_advertised_model_has_an_explicit_image_capability() {
+ for model in advertised_models() {
+ assert!(
+ super::supports_images(model).is_some(),
+ "missing capability: {model}"
+ );
+ }
+}
diff --git a/crates/agent_inmem/src/domain/session.rs b/crates/agent_inmem/src/domain/session.rs
index ed1c35951f..123e926ec8 100644
--- a/crates/agent_inmem/src/domain/session.rs
+++ b/crates/agent_inmem/src/domain/session.rs
@@ -264,3 +264,19 @@ pub fn messages_for_turn(history: &[HistoryEntry], prompt: &UserPrompt) -> Vec<C
.chain(std::iter::once(prompt.to_chat_message()))
.collect()
}
+
+/// Whether resolved attachments contain images, including nested attachments.
+pub(super) fn contains_images(attachments: &Attachments<'_>) -> bool {
+ fn content_has_images(content: &AttachmentContent<'_>) -> bool {
+ content.content.iter().any(|part| match part {
+ AttachmentPart::Image(_) => true,
+ AttachmentPart::Child(child) => child.as_ref().as_ref().is_ok_and(content_has_images),
+ _ => false,
+ })
+ }
+ attachments
+ .parts()
+ .iter()
+ .filter_map(|part| part.as_ref().ok())
+ .any(content_has_images)
+}
diff --git a/crates/agent_inmem/src/outbound/local_attachments.rs b/crates/agent_inmem/src/outbound/local_attachments.rs
index 01d3adff71..9354b8b55c 100644
--- a/crates/agent_inmem/src/outbound/local_attachments.rs
+++ b/crates/agent_inmem/src/outbound/local_attachments.rs
@@ -1,6 +1,6 @@
-//! Materialize local static-file images before invoking a remote model.
+//! Normalize Macro static-file images before invoking a remote model.
//!
-//! Browser-facing local URLs cannot be fetched by model providers. This
+//! Normalized inline images carry a MIME type and work even with private URLs. This
//! adapter resolves only the configured static-file route through its owning
//! attachment service; other URLs retain their ordinary provider behavior.
@@ -23,22 +23,22 @@ use crate::domain::engine::{TurnEngine, TurnRequest};
#[cfg(test)]
mod test;
-/// A local deployment's turn engine, with private static-file images inlined.
+/// A turn engine with Macro static-file images normalized and inlined.
///
/// The composition root supplies the browser-facing base URL and an attachment
/// service that can read the files internally. Resolution covers the whole
/// conversation, including prompts replayed after a process restart.
-pub struct LocalAttachmentTurnEngine<S> {
+pub struct StaticFileAttachmentTurnEngine<S> {
inner: Arc<dyn TurnEngine>,
- resolver: Arc<LocalImageResolver<S>>,
+ resolver: Arc<StaticFileImageResolver<S>>,
}
-impl<S> LocalAttachmentTurnEngine<S> {
+impl<S> StaticFileAttachmentTurnEngine<S> {
/// Wrap `inner`, resolving images under `{public_base_url}/file/{uuid}`.
///
/// The base must be an HTTP(S) URL without credentials, query or fragment.
- /// Configure this wrapper only where that origin is private to the local
- /// stack. Production URLs should continue directly to the model provider.
+ /// Only this configured origin is resolved; arbitrary external URLs are
+ /// never fetched by this adapter.
pub fn new(
inner: Arc<dyn TurnEngine>,
mut public_base_url: Url,
@@ -51,7 +51,7 @@ impl<S> LocalAttachmentTurnEngine<S> {
&& public_base_url.password().is_none()
&& public_base_url.query().is_none()
&& public_base_url.fragment().is_none(),
- "local static-file base must be an HTTP(S) URL without credentials, query or fragment"
+ "static-file base must be an HTTP(S) URL without credentials, query or fragment"
);
public_base_url.set_path(&format!(
"{}/file/",
@@ -59,7 +59,7 @@ impl<S> LocalAttachmentTurnEngine<S> {
));
Ok(Self {
inner,
- resolver: Arc::new(LocalImageResolver {
+ resolver: Arc::new(StaticFileImageResolver {
file_base_url: public_base_url,
service,
}),
@@ -67,7 +67,7 @@ impl<S> LocalAttachmentTurnEngine<S> {
}
}
-impl<S: AttachmentService> TurnEngine for LocalAttachmentTurnEngine<S> {
+impl<S: AttachmentService> TurnEngine for StaticFileAttachmentTurnEngine<S> {
fn supported_models(&self) -> &[&str] {
self.inner.supported_models()
}
@@ -112,12 +112,12 @@ impl<S: AttachmentService> TurnEngine for LocalAttachmentTurnEngine<S> {
}
}
-struct LocalImageResolver<S> {
+struct StaticFileImageResolver<S> {
file_base_url: Url,
service: S,
}
-impl<S> LocalImageResolver<S> {
+impl<S> StaticFileImageResolver<S> {
/// Accept only canonical file identifiers beneath the configured route.
/// Comparing the original URL also rejects paths normalized by parsing,
/// such as literal or encoded traversal and backslash separators.
@@ -138,7 +138,7 @@ impl<S> LocalImageResolver<S> {
}
}
-impl<S: AttachmentService> LocalImageResolver<S> {
+impl<S: AttachmentService> StaticFileImageResolver<S> {
async fn resolve_request(&self, request: &mut TurnRequest) -> anyhow::Result<()> {
for message in &mut request.messages {
let Some(attachments) = message.attachments.take() else {
@@ -184,7 +184,7 @@ impl<S: AttachmentService> LocalImageResolver<S> {
async fn resolve_image(&self, owner: &Owner, file_id: Uuid) -> anyhow::Result<ImageData> {
let user = owner.as_user().ok_or_else(|| {
- anyhow::anyhow!("local image attachments require a user session owner")
+ anyhow::anyhow!("static-file image attachments require a user session owner")
})?;
let entity = EntityType::StaticFile.with_entity_string(file_id.to_string());
let entities = [&entity];
@@ -198,22 +198,25 @@ impl<S: AttachmentService> LocalImageResolver<S> {
let mut contents = resolved.into_parts().into_inner();
anyhow::ensure!(
contents.len() == 1,
- "local image resolution returned multiple files"
+ "static-file image resolution returned multiple files"
);
let content = contents
.pop()
.expect("one resolved file")
.map_err(|error| {
- anyhow::anyhow!("could not read local image attachment: {}", error.error)
+ anyhow::anyhow!(
+ "could not read static-file image attachment: {}",
+ error.error
+ )
})?;
let mut parts = content.content.into_inner();
anyhow::ensure!(
parts.len() == 1,
- "local image resolution returned multiple parts"
+ "static-file image resolution returned multiple parts"
);
match parts.pop().expect("one resolved part") {
AttachmentPart::Image(image @ ImageData::Base64(_)) => Ok(image),
- _ => anyhow::bail!("local image resolution did not return inline image content"),
+ _ => anyhow::bail!("static-file image resolution did not return inline image content"),
}
}
}
diff --git a/crates/agent_inmem/src/outbound/local_attachments/test.rs b/crates/agent_inmem/src/outbound/local_attachments/test.rs
index 6b71e0dcdc..3ba52c295e 100644
--- a/crates/agent_inmem/src/outbound/local_attachments/test.rs
+++ b/crates/agent_inmem/src/outbound/local_attachments/test.rs
@@ -105,13 +105,13 @@ impl TurnEngine for Engine {
fn engine(
outcome: Outcome,
) -> (
- LocalAttachmentTurnEngine<Service>,
+ StaticFileAttachmentTurnEngine<Service>,
Arc<Engine>,
Arc<ServiceState>,
) {
let inner = Arc::new(Engine::default());
let state = Arc::new(ServiceState::default());
- let engine = LocalAttachmentTurnEngine::new(
+ let engine = StaticFileAttachmentTurnEngine::new(
inner.clone(),
Url::parse(BASE).expect("base URL"),
Service {
@@ -351,7 +351,7 @@ impl TurnEngine for CooperativeEngine {
#[tokio::test]
async fn a_running_engine_drains_its_final_tool_response_after_cancellation() {
let started = Arc::new(Notify::new());
- let engine = LocalAttachmentTurnEngine::new(
+ let engine = StaticFileAttachmentTurnEngine::new(
Arc::new(CooperativeEngine {
started: Arc::clone(&started),
}),
diff --git a/crates/agent_runtime_protocol/src/domain/turn.rs b/crates/agent_runtime_protocol/src/domain/turn.rs
index 3e877677fa..9985a6a24c 100644
--- a/crates/agent_runtime_protocol/src/domain/turn.rs
+++ b/crates/agent_runtime_protocol/src/domain/turn.rs
@@ -44,6 +44,8 @@ pub enum FailureNoticeKind {
/// The person's own account with the provider has no budget left for
/// this work; the fix is on the provider's billing page.
ProviderUsageLimit,
+ /// The selected model cannot read image attachments in this conversation.
+ UnsupportedImageInput,
}
/// An external page where the person can act on a [`FailureNotice`].
diff --git a/crates/cursor_cloud_agents/src/domain/error.rs b/crates/cursor_cloud_agents/src/domain/error.rs
index 46bc32770f..6e026a0298 100644
--- a/crates/cursor_cloud_agents/src/domain/error.rs
+++ b/crates/cursor_cloud_agents/src/domain/error.rs
@@ -57,7 +57,7 @@ pub struct PromptRefusal {
/// One plain sentence or two, no report decorations.
pub message: String,
/// The refusal as a rendered notice, when there is more to say than a line.
- pub notice: Option<FailureNotice>,
+ pub notice: Option<Box<FailureNotice>>,
}
impl PromptRefusal {
@@ -127,7 +127,7 @@ impl UsageLimitExceeded {
let notice = self.notice();
PromptRefusal {
message: format!("{} {}", notice.title, notice.body),
- notice: Some(notice),
+ notice: Some(Box::new(notice)),
}
}
}
diff --git a/crates/folds/agent_fold/src/domain/model/metadata.rs b/crates/folds/agent_fold/src/domain/model/metadata.rs
index 00042e37ac..3915eeff0e 100644
--- a/crates/folds/agent_fold/src/domain/model/metadata.rs
+++ b/crates/folds/agent_fold/src/domain/model/metadata.rs
@@ -140,6 +140,9 @@ pub struct ModelOption {
pub name: String,
/// Descriptive copy - pricing, context size, and the like.
pub description: Option<String>,
+ /// Image input support, absent when the runtime does not advertise it.
+ #[specta(optional)]
+ pub supports_images: Option<bool>,
/// The heading the runtime listed this model under, when it grouped its
/// options (ACP's `SessionConfigSelectGroup.name`). `None` for a runtime
/// that offered a flat list; the flattened order still follows the
diff --git a/crates/folds/agent_fold/src/domain/model_selection.rs b/crates/folds/agent_fold/src/domain/model_selection.rs
index cb44e653d6..a053560bf3 100644
--- a/crates/folds/agent_fold/src/domain/model_selection.rs
+++ b/crates/folds/agent_fold/src/domain/model_selection.rs
@@ -69,6 +69,11 @@ fn project_option(
id: option.value.to_string(),
name: option.name.clone(),
description: option.description.clone(),
+ supports_images: option
+ .meta
+ .as_ref()
+ .and_then(|meta| meta.get("macro.supportsImages"))
+ .and_then(serde_json::Value::as_bool),
group: group.map(str::to_owned),
}
}
diff --git a/crates/folds/agent_fold/src/domain/model_selection/test.rs b/crates/folds/agent_fold/src/domain/model_selection/test.rs
index c5a759cf7e..1109146add 100644
--- a/crates/folds/agent_fold/src/domain/model_selection/test.rs
+++ b/crates/folds/agent_fold/src/domain/model_selection/test.rs
@@ -33,12 +33,14 @@ fn projects_ungrouped_models_and_ignores_other_config() {
ModelOption {
id: "opus".to_owned(),
name: "Opus".to_owned(),
+ supports_images: None,
description: Some("Largest model".to_owned()),
group: None,
},
ModelOption {
id: "sonnet".to_owned(),
name: "Sonnet".to_owned(),
+ supports_images: None,
description: None,
group: None,
},
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@command_invocation.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@command_invocation.jsonl.snap
index aa7acb9ad4..148b8aa77f 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@command_invocation.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@command_invocation.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/command_invocation.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/command_invocation.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Use the default model (currently Opus 5 (1M context)) · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks · $10/$50 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks · $2/$10 per Mtok · promo through Aug 31",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers · $1/$5 per Mtok",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@elicitation_claude_single_select.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@elicitation_claude_single_select.jsonl.snap
index ec442990a5..475fde629f 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@elicitation_claude_single_select.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@elicitation_claude_single_select.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/elicitation_claude_single_select.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/elicitation_claude_single_select.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@long_multi_resume.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@long_multi_resume.jsonl.snap
index 838ffbc9b1..80283d8fe1 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@long_multi_resume.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@long_multi_resume.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/long_multi_resume.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/long_multi_resume.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Use the default model (currently Opus 5 (1M context)) · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks · $10/$50 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks · $2/$10 per Mtok · promo through Aug 31",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers · $1/$5 per Mtok",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@plan_todo.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@plan_todo.jsonl.snap
index eac9f941e7..3e1507f6f1 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@plan_todo.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@plan_todo.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/plan_todo.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/plan_todo.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Use the default model (currently Opus 5 (1M context)) · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks · $10/$50 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks · $2/$10 per Mtok · promo through Aug 31",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers · $1/$5 per Mtok",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_multi_turn.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_multi_turn.jsonl.snap
index 18d4ae8295..3461a526a0 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_multi_turn.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_multi_turn.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/real_multi_turn.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/real_multi_turn.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_single_turn.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_single_turn.jsonl.snap
index 09530a1d09..710e3b07d3 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_single_turn.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@real_single_turn.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/real_single_turn.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/real_single_turn.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_and_continued.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_and_continued.jsonl.snap
index 168d8442e7..a36fff7242 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_and_continued.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_and_continued.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/resumed_and_continued.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/resumed_and_continued.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_no_prompt.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_no_prompt.jsonl.snap
index b845903f9d..0d92b7e90a 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_no_prompt.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@resumed_no_prompt.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/resumed_no_prompt.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/resumed_no_prompt.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_claude_code.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_claude_code.jsonl.snap
index ef78307bc2..f10a9c9d86 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_claude_code.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_claude_code.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/subagent_claude_code.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/subagent_claude_code.jsonl
---
SessionMetadata {
harness: ClaudeCode,
@@ -16,6 +15,7 @@ SessionMetadata {
description: Some(
"Use the default model (currently Opus 5 (1M context)) · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -24,6 +24,7 @@ SessionMetadata {
description: Some(
"Opus 5 with 1M context · Best for everyday, complex tasks · $5/$25 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -32,6 +33,7 @@ SessionMetadata {
description: Some(
"Fable 5 · Most capable for your hardest and longest-running tasks · $10/$50 per Mtok",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -40,6 +42,7 @@ SessionMetadata {
description: Some(
"Sonnet 5 · Efficient for routine tasks · $2/$10 per Mtok · promo through Aug 31",
),
+ supports_images: None,
group: None,
},
ModelOption {
@@ -48,6 +51,7 @@ SessionMetadata {
description: Some(
"Haiku 4.5 · Fastest for quick answers · $1/$5 per Mtok",
),
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_cursor.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_cursor.jsonl.snap
index 3f362e216d..86bb1bfe0d 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_cursor.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_cursor.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/subagent_cursor.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/subagent_cursor.jsonl
---
SessionMetadata {
harness: Cursor,
@@ -14,228 +13,266 @@ SessionMetadata {
id: "auto-smart",
name: "Auto",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "default",
name: "Auto",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "grok-4.6",
name: "Cursor Grok 4.6",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "composer-2.5",
name: "Composer 2.5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-opus-5",
name: "Claude Opus 5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-opus-4-8",
name: "Claude Opus 4.8",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.6-sol",
name: "GPT-5.6 Sol",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.5",
name: "GPT-5.5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-fable-5-1",
name: "Claude Fable 5.1",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-fable-5",
name: "Claude Fable 5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "grok-4.5",
name: "Cursor Grok 4.5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gemini-3.8-flash",
name: "Gemini 3.8 Flash",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gemini-3.7-flash",
name: "Gemini 3.7 Flash",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.6-terra",
name: "GPT-5.6 Terra",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-sonnet-5",
name: "Claude Sonnet 5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-sonnet-4-6",
name: "Claude Sonnet 4.6",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.3-codex",
name: "Codex 5.3",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-opus-4-7",
name: "Claude Opus 4.7",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.4",
name: "GPT-5.4",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-opus-4-6",
name: "Claude Opus 4.6",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-opus-4-5",
name: "Claude Opus 4.5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.2",
name: "GPT-5.2",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.6-luna",
name: "GPT-5.6 Luna",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gemini-3.6-flash",
name: "Gemini 3.6 Flash",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gemini-3.1-pro",
name: "Gemini 3.1 Pro",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.4-mini",
name: "GPT-5.4 Mini",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.4-nano",
name: "GPT-5.4 Nano",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-haiku-4-5",
name: "Claude Haiku 4.5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-sonnet-4-5",
name: "Claude Sonnet 4.5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5.1",
name: "GPT-5.1",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gemini-3-flash",
name: "Gemini 3 Flash",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gemini-3.5-flash",
name: "Gemini 3.5 Flash",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "claude-sonnet-4",
name: "Claude Sonnet 4",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gpt-5-mini",
name: "GPT-5 Mini",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "gemini-2.5-flash",
name: "Gemini 2.5 Flash",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "kimi-k3",
name: "Kimi K3",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "kimi-k2.7-code",
name: "Kimi K2.7 Code",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "glm-5.2",
name: "GLM 5.2",
description: None,
+ supports_images: None,
group: None,
},
],
diff --git a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_opencode.jsonl.snap b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_opencode.jsonl.snap
index f400605f50..1bd4d25ae4 100644
--- a/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_opencode.jsonl.snap
+++ b/crates/folds/agent_fold/src/domain/test/snapshots/agent_fold__domain__test__real_recordings__real_fixtures_derive_their_pinned_metadata@subagent_opencode.jsonl.snap
@@ -1,8 +1,7 @@
---
-source: crates/agent_fold/src/domain/test/real_recordings.rs
-assertion_line: 256
+source: crates/folds/agent_fold/src/domain/test/real_recordings.rs
expression: machine.metadata()
-input_file: crates/agent_fold/fixtures/real/subagent_opencode.jsonl
+input_file: crates/folds/agent_fold/fixtures/real/subagent_opencode.jsonl
---
SessionMetadata {
harness: OpenCode,
@@ -14,24 +13,28 @@ SessionMetadata {
id: "openai/gpt-5.4",
name: "OpenAI/GPT-5.4",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "openai/gpt-5.5",
name: "OpenAI/GPT-5.5",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "openai/gpt-5.6-terra",
name: "OpenAI/GPT-5.6 Terra",
description: None,
+ supports_images: None,
group: None,
},
ModelOption {
id: "openai/gpt-5.6-terra-fast",
name: "OpenAI/GPT-5.6 Terra Fast",
description: None,
+ supports_images: None,
group: None,
},
],
diff --git a/docs/AGENT_GUIDE/ai-chat.md b/docs/AGENT_GUIDE/ai-chat.md
index b1dd2f3c2d..4c9fdbcd23 100644
--- a/docs/AGENT_GUIDE/ai-chat.md
+++ b/docs/AGENT_GUIDE/ai-chat.md
@@ -1561,6 +1561,22 @@ settings and confirms a fresh proposal. Identical retries reuse the saved link.
Old pending booking review requests can be dismissed so the agent can resume with
conversational confirmation.
+## Image attachments and model selection
+
+Attach images using the plus button, paste, or drop. Image-capable models receive
+uploaded images as normalized inline content, including attachments from earlier
+turns. Test an image-only prompt and a text-plus-image prompt, then follow up
+without reattaching the image.
+
+Text-only model choices show a description and a composer warning. Pasted,
+dropped, and picked images should be refused before upload; document attachments
+and text should still work. If an image is already attached when switching to a
+text-only model, keep the draft and image chip but disable Send until the image
+is removed or a vision model is selected. Switching an existing image conversation
+to a text-only model is rejected by the backend when sending, with guidance to
+choose a vision model or start a conversation without images.
+
+
## Accelerated model speed
The lightning button beside the model selector enables Ultrafast for GPT-6 Astra
diff --git a/packages/sdk/generated/agent-harness/types.gen.ts b/packages/sdk/generated/agent-harness/types.gen.ts
index d7a01493f1..4eeaf4c7f0 100644
--- a/packages/sdk/generated/agent-harness/types.gen.ts
+++ b/packages/sdk/generated/agent-harness/types.gen.ts
@@ -128,6 +128,10 @@ export type AgentModelDto = {
* Display name.
*/
name: string;
+ /**
+ * Image input support, absent when the runtime does not advertise it.
+ */
+ supportsImages?: boolean | null;
};
/**
diff --git a/packages/sdk/specs/agent-harness.json b/packages/sdk/specs/agent-harness.json
index 452b92b16e..929013f7dc 100644
--- a/packages/sdk/specs/agent-harness.json
+++ b/packages/sdk/specs/agent-harness.json
@@ -2503,6 +2503,10 @@
"name": {
"type": "string",
"description": "Display name."
+ },
+ "supportsImages": {
+ "type": ["boolean", "null"],
+ "description": "Image input support, absent when the runtime does not advertise it."
}
}
},
diff --git a/services/agent_harness_service/src/main.rs b/services/agent_harness_service/src/main.rs
index 5379bcf72f..de8f99c25d 100644
--- a/services/agent_harness_service/src/main.rs
+++ b/services/agent_harness_service/src/main.rs
@@ -83,7 +83,7 @@ use agent_harness::outbound::tool_approvals::{
use agent_inmem::domain::engine::TurnEngine;
use agent_inmem::outbound::acp_mcp::AcpMcpConnector;
use agent_inmem::outbound::egress_mcp::EgressMcpClient;
-use agent_inmem::outbound::local_attachments::LocalAttachmentTurnEngine;
+use agent_inmem::outbound::local_attachments::StaticFileAttachmentTurnEngine;
use agent_inmem::outbound::log_frames::LogFrameSource;
use agent_inmem::outbound::manager::InMemAgentManager;
use agent_inmem::outbound::tool_catalog::McpToolCatalog;
@@ -554,29 +554,26 @@ async fn run() -> anyhow::Result<()> {
),
)),
);
- // A model provider cannot fetch images from a private local-stack hostname.
- // Resolve its static-file links through the existing attachment service,
- // including links replayed from earlier turns, before calling the model.
- let inmem_model_engine: Arc<dyn TurnEngine> = if let (Environment::Local, Some(local_aws)) =
- (&config.environment, macro_aws_config::LocalAwsUrl::new())
- {
- let public_base = url::Url::parse(config::StaticFileServiceUrl::new()?.as_ref())?;
- let cdn_base = format!(
+ // Normalize uploaded images before any provider sees them. In addition to
+ // making local URLs reachable, this supplies the MIME type Gemini requires
+ // and decodes formats that providers cannot consume directly.
+ let public_base = url::Url::parse(config::StaticFileServiceUrl::new()?.as_ref())?;
+ let cdn_base = match (&config.environment, macro_aws_config::LocalAwsUrl::new()) {
+ (Environment::Local, Some(local_aws)) => format!(
"{}/{}",
local_aws.as_ref().trim_end_matches('/'),
config::StaticStorageBucket::new()?.as_ref(),
- );
- let attachments = static_file::inbound::attachment::StaticFileAttachmentService::new(
- Arc::new(static_file::outbound::CdnStaticFileRepo::new(cdn_base)),
- );
- Arc::new(LocalAttachmentTurnEngine::new(
- inmem_model_engine,
- public_base,
- attachments,
- )?)
- } else {
- inmem_model_engine
+ ),
+ _ => public_base.as_str().trim_end_matches('/').to_owned(),
};
+ let attachments = static_file::inbound::attachment::StaticFileAttachmentService::new(Arc::new(
+ static_file::outbound::CdnStaticFileRepo::new(cdn_base),
+ ));
+ let inmem_model_engine: Arc<dyn TurnEngine> = Arc::new(StaticFileAttachmentTurnEngine::new(
+ inmem_model_engine,
+ public_base,
+ attachments,
+ )?);
// Cold attaches (fresh spawns and post-restart resumes) rebuild
// their model context from the same log every frame lands in.
let frames = Arc::new(LogFrameSource::new(session_repo.clone()));