feat: add OMP (Oh My Pi) provider compatibility

Support OMP as a host alongside pi:
- Convert OMP's array-format system prompts to string via systemPromptToText
- Guard against OMP passing the literal env-var name as the API key value
- Add ~/.omp/agent/auth.json to default auth path lookup
- Fix --list-models output to check both stdout and stderr
- Add OMP compatibility smoke test with isolated temp HOME and mock server
- Deduplicate usage section in README, add OMP install and usage docs
This commit is contained in:
AlexVagrant
2026-05-28 04:12:35 -04:00
committed by wh.huajieyu
parent b850558199
commit c2497ed098
9 changed files with 303 additions and 37 deletions
+23
View File
@@ -302,6 +302,29 @@ describe("streamCommandCode — request serialization", () => {
assert.equal(objectAt(server.lastRequestBody(), ["params", "max_tokens"]), 8_192)
})
it("serializes OMP system prompt arrays as a string", async () => {
server.mockResponse({
type: "success",
events: [JSON.stringify({ type: "finish", finishReason: "stop" })],
})
const { streamCommandCode } = createTestDeps({ apiBase: server.baseUrl() })
await collectEvents(
streamCommandCode(
makeModel(),
makeContext({
systemPrompt: ["You are a test assistant.", "Use concise answers."] as unknown as string,
}),
{ apiKey: "mock-key" },
),
)
assert.equal(
objectAt(server.lastRequestBody(), ["params", "system"]),
"You are a test assistant.\n\nUse concise answers.",
)
})
it("runs onPayload and onResponse hooks", async () => {
server.mockResponse({
type: "success",