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:
@@ -136,6 +136,7 @@ function hasLivePiAuth() {
|
||||
return (
|
||||
!!process.env.COMMANDCODE_API_KEY ||
|
||||
existsSync(join(homedir(), ".commandcode", "auth.json")) ||
|
||||
existsSync(join(homedir(), ".omp", "agent", "auth.json")) ||
|
||||
existsSync(join(homedir(), ".pi", "agent", "auth.json"))
|
||||
)
|
||||
}
|
||||
@@ -294,9 +295,10 @@ try {
|
||||
modelListRequestCount = 0
|
||||
const list = await runPi(["--no-extensions", "-e", EXT_PATH, "--list-models"], 20_000)
|
||||
assert.equal(list.code, 0, list.stderr)
|
||||
assert.match(list.stdout, /commandcode/)
|
||||
assert.match(list.stdout, /deepseek\/deepseek-v4-flash/)
|
||||
assert.match(list.stdout, /Qwen\/Qwen3\.7-Max/)
|
||||
const listOutput = list.stdout || list.stderr
|
||||
assert.match(listOutput, /commandcode/)
|
||||
assert.match(listOutput, /deepseek\/deepseek-v4-flash/)
|
||||
assert.match(listOutput, /Qwen\/Qwen3\.7-Max/)
|
||||
assert.equal(modelListRequestCount, 1)
|
||||
|
||||
console.log("[pi-local] print mode through real extension and mock API")
|
||||
|
||||
Reference in New Issue
Block a user