Summary
@link-assistant/agent 0.25.0 emits repeated AI SDK warnings during a normal multi-turn run against an OpenAI-compatible provider:
AI SDK Warning: System messages in the prompt or messages fields can be a security risk ... Set allowSystemInMessages to true ...
AI SDK Warning (opencode.chat / big-pickle): The feature "specificationVersion" is used in a compatibility mode. Using v2 specification compatibility mode.
This was found while auditing link-assistant/formal-ai#717. The successful Hive Mind self-coding E2E emits the system-message warning eight times and the compatibility warning four times.
Reproduction
bun add -g @link-assistant/agent@0.25.0
# Configure an @ai-sdk/openai-compatible provider and run a multi-turn tool loop.
agent --model formalai/formal-ai --permission-mode auto \
--output-format stream-json --compact-json --disable-stdin \
--prompt 'Create file self-coding-result.txt containing self-coding=passed'
Formal AI's exact harness is examples/self-coding/run.sh in link-assistant/formal-ai.
Root cause
js/src/session/prompt.ts calls AI SDK 6 streamText with system-role messages inside messages:
messages: [
...system.map((x): ModelMessage => ({ role: 'system', content: x })),
...safeModelMessages,
],
AI SDK 6.0.225's standardizePrompt warns unless the caller either uses the top-level system option or explicitly sets allowSystemInMessages. Since Agent intentionally builds these messages itself, it should use system where feasible, or set allowSystemInMessages: true after reviewing the injection boundary. The provider compatibility warning should likewise be resolved at the model/provider adapter boundary rather than globally silenced.
Expected
A successful standard Agent CLI run should not emit warnings. Please add a regression that captures stderr for a multi-turn OpenAI-compatible-provider run.
Summary
@link-assistant/agent0.25.0 emits repeated AI SDK warnings during a normal multi-turn run against an OpenAI-compatible provider:This was found while auditing link-assistant/formal-ai#717. The successful Hive Mind self-coding E2E emits the system-message warning eight times and the compatibility warning four times.
Reproduction
Formal AI's exact harness is
examples/self-coding/run.shin link-assistant/formal-ai.Root cause
js/src/session/prompt.tscalls AI SDK 6streamTextwith system-role messages insidemessages:AI SDK 6.0.225's
standardizePromptwarns unless the caller either uses the top-levelsystemoption or explicitly setsallowSystemInMessages. Since Agent intentionally builds these messages itself, it should usesystemwhere feasible, or setallowSystemInMessages: trueafter reviewing the injection boundary. The provider compatibility warning should likewise be resolved at the model/provider adapter boundary rather than globally silenced.Expected
A successful standard Agent CLI run should not emit warnings. Please add a regression that captures stderr for a multi-turn OpenAI-compatible-provider run.