Repository navigation
Description
[Factory] Compatibility issue with OMP default system prompt
Description
When using the Magpie Factory provider with Oh My Pi (OMP), requests using OMP's default system prompt are rejected by Factory's usage policy check (content_policy_rejected).
However, replacing OMP's default system prompt with a minimal one makes the same setup work correctly.
A related issue has already been investigated in the OMP repository:
That investigation identified a specific sentence in OMP's default system prompt that appears to trigger Factory's policy check:
You are omp's trusted coding assistant.
Rewording this sentence was reported to resolve the issue.
Since Magpie is designed to provide model access and compatibility across different AI agents, it would be helpful if the Factory provider could handle this compatibility issue at the provider level, without requiring users to modify OMP's system prompt manually.
Steps to reproduce
-
Configure OMP to use Factory through Magpie's community Factory plugin.
-
Start a fresh OMP session with the default system prompt.
-
Send a simple message such as
Hello. -
The request fails with
content_policy_rejected. -
Restart OMP with a minimal system prompt:
omp --system-prompt "You are a helpful assistant." -
Send the same message through Magpie. The request succeeds.
Test results
| Configuration | Result |
|---|---|
| Official Factory Droid CLI | Success |
| OMP → Factory directly (default prompt) | Rejected |
| OMP → Magpie → Factory (default prompt) | Rejected |
| curl → Magpie → Factory (minimal request) | Success |
| OMP → Magpie → Factory (minimal prompt) | Success |
Expected behavior
The Magpie Factory provider should ideally support OMP's default system prompt without requiring users to manually replace or maintain a custom prompt.
Additional observations
I inspected the system prompt in the request sent from Magpie toward Factory and confirmed that it still contained:
You are omp's trusted coding assistant.
I have not compared the complete original request sent by OMP with the request forwarded by Magpie, so I cannot determine exactly which prompt transformations are already being applied.
However, the upstream OMP issue suggests that this specific sentence may be responsible for the rejection.
Suggested improvement
Could the Factory provider investigate whether its existing system prompt compatibility handling can be extended to support OMP's default prompt?
Ideally, the fix would be applied transparently at the provider level, preserving OMP's coding capabilities and avoiding the need for users to maintain custom system prompt files.
Thanks for maintaining the Factory integration!
Activity
HarryWang29 commentedon Nov 18, 2026
I created a Magpie middleware plugin for this specific scenario:
https://github.com/HarryWang29/magpie-factory-identity
It uses the
onProviderhook to rewrite OMP’s default identity sentence only when the selected upstream provider isfactory. The rest of OMP’s system prompt—including its engineering guidelines, tool policies, and workflow instructions—remains unchanged, so users do not need to maintain a custom OMP prompt template.Requests are working in my environment after installing it. It would be helpful if you could verify it against the reproduction steps in this issue.
To install, enter the following in Magpie’s Add plugin field:
Or use the CLI:
One limitation: it only rewrites system/developer instructions. It does not rewrite occurrences in user messages, assistant replies, or tool outputs. Please test with a fresh OMP session using the default system prompt, since an existing conversation may still contain text that triggers Factory’s check.
This is an independently maintained middleware, not a change to the community Factory provider itself.
duelolar commentedon Nov 18, 2026
Widening this beyond the identity sentence — we bisected two more gateway gates (full evidence in
can1357/oh-my-pi#19553):
Tool-name blocklist. Any
tools[]entry whosefunction.namecollides with Factory's internaltool namespace is rejected — 403 before the model sees it. Single-tool payloads, descriptions stripped
to
"x", valid Droid system block:Banned (403):
read,read_file,bash,write,edit,glob,grep,task,web_search,Bash,Write,execute_command,BashTool,WriteToolPassing (200):
omp_read,readfile,run_bash,shell_command,Read,Edit,WebSearch,ask,eval,find,wait,todoOMP's native tool schema carries exactly the banned names, so identity rewriting alone cannot fix
agentic requests — the
onProvidermiddleware also needs to renametools[].function.nameon the wayout and map them back inside streamed
tool_callsdeltas on the response. Same hook, just a secondtransform; a local MITM doing that round-trip restores full function end to end.
Client-version gate. Without a
factory-cliUser-Agent the gateway returns 400Unable to determine client versionon the entireo/v1route even with zero tools. The middleware needs toinject
User-Agent: factory-cli/<ver>+X-Client-Versionheaders as well.Also, per the omp thread: the content scan covers
usermessages andtool_resultcontent, not onlysystem— one blocked sentence anywhere in the transcript poisons the session. So @HarryWang29'srewrite likely needs to extend into message history too, not just the system block.
HarryWang29 commentedon Nov 19, 2026
yes, and I found this