Skip to content

Factory: Compatibility issue with OMP default system prompt #1284

Open

Description

@lxm9357

[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:

can1357/oh-my-pi#19553

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

  1. Configure OMP to use Factory through Magpie's community Factory plugin.

  2. Start a fresh OMP session with the default system prompt.

  3. Send a simple message such as Hello.

  4. The request fails with content_policy_rejected.

  5. Restart OMP with a minimal system prompt:

    omp --system-prompt "You are a helpful assistant."
  6. 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

  1. HarryWang29 commented on Nov 18, 2026

    @HarryWang29

    I created a Magpie middleware plugin for this specific scenario:

    https://github.com/HarryWang29/magpie-factory-identity

    It uses the onProvider hook to rewrite OMP’s default identity sentence only when the selected upstream provider is factory. 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:

    github:HarryWang29/magpie-factory-identity
    

    Or use the CLI:

    magpie plugin add github:HarryWang29/magpie-factory-identity

    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.

  2. duelolar commented on Nov 18, 2026

    @duelolar

    Widening this beyond the identity sentence — we bisected two more gateway gates (full evidence in
    can1357/oh-my-pi#19553):

    1. Tool-name blocklist. Any tools[] entry whose function.name collides with Factory's internal
      tool 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, WriteTool
      Passing (200): omp_read, readfile, run_bash, shell_command, Read, Edit, WebSearch,
      ask, eval, find, wait, todo

      OMP's native tool schema carries exactly the banned names, so identity rewriting alone cannot fix
      agentic requests — the onProvider middleware also needs to rename tools[].function.name on the way
      out and map them back inside streamed tool_calls deltas on the response. Same hook, just a second
      transform; a local MITM doing that round-trip restores full function end to end.

    2. Client-version gate. Without a factory-cli User-Agent the gateway returns 400 Unable to determine client version on the entire o/v1 route even with zero tools. The middleware needs to
      inject User-Agent: factory-cli/<ver> + X-Client-Version headers as well.

    Also, per the omp thread: the content scan covers user messages and tool_result content, not only
    system — one blocked sentence anywhere in the transcript poisons the session. So @HarryWang29's
    rewrite likely needs to extend into message history too, not just the system block.

  3. HarryWang29 commented on Nov 19, 2026

    @HarryWang29

    yes, and I found this

    image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions