Merge plugin system prompts for provider compatibility#2339
Merge plugin system prompts for provider compatibility#2339VamsiKrishna0101 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@VamsiKrishna0101 is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Pablosinyores
left a comment
There was a problem hiding this comment.
The in-place collapse is correct for a single transform, but the composition is worth a look. Both OpenWorkCapabilitiesKnowledge and OpenWorkExtensionsPreview register experimental.chat.system.transform and each flattens the entire output.system array. That only yields a single system message at send time if these two transforms run last. Any other plugin (or the base agent) that pushes a system entry after them reintroduces multiple system messages and the strict-proxy failure comes back. The guarantee is order-dependent and breaks silently if plugin order changes.
A single centralized flatten applied once, after all system.transform hooks have run, would be more robust than each plugin mutating the shared array, and it avoids duplicating the same six lines per plugin.
On the tests: both new cases exercise one plugin against a fresh array, so they do not cover the multi-system-message scenario the fix actually targets. A test that runs both transforms in sequence on the same output.system (or one transform over a pre-seeded multi-entry array) would prove the provider-compat behavior rather than the isolated case.
4190745 to
d40e64b
Compare
Good point, thanks. I updated the PR to avoid per-plugin flattening. The OpenWork guidance plugins now only append their own system context, and I added a dedicated I also updated the tests so the provider-compat behavior is covered at composition level: the new test runs both OpenWork system transforms on the same I also added the new normalizer plugin to the server build entrypoints so it is bundled for packaged builds. |
Summary
Why
systemmessage is sent.System message must be at the beginning.Issue
Scope
apps/server/src/opencode-plugins/openwork-capabilities-knowledge.ts.apps/server/src/opencode-plugins/openwork-extensions-preview.ts.Out of scope
Testing
Ran
pnpm --filter openwork-server exec bun test src/opencode-plugins/openwork-capabilities-knowledge.test.ts src/opencode-plugins/openwork-extensions-preview.test.tspnpm --filter openwork-server typecheckResult
openwork-capabilities-knowledge.test.ts: 2 passedopenwork-extensions-preview.test.ts: 1 passedtsc -p tsconfig.json --noEmit: passedCI status
Manual verification
/v1server.systemmessage instead of multiple plugin-added system messages.Evidence
messagespayload contains only onesystemmessage at the beginning.Risk
Rollback