Skip to content
Discussion options

You must be logged in to vote

你的自检基本正确,补上 harness 侧源码确认(本地 0.1.2-alpha.1 = cd5ef81;上游 0a53fb5 仅版本号,同代码)+ 两个可行解法。

机制确认(harness 侧)

  • 路由不写 apiKeyEnv 时,resolveApiKey() 直接返回 undefined——注释明确这是「defer to pi-ai's provider-native discovery」,即 harness 不注入任何凭据,把判断交给 pi-ai(packages/llm/llm-pi-ai/src/index.ts:171-187)。
  • 于是 harnessApiKeyAuth 拿到空 credential → 解析结果 auth: {}packages/llm/llm-pi-ai/src/provider.ts:96-113),pi-ai 的 OpenAI 兼容实现发现既无 apiKey 也无 Authorization 头 → 抛 No API key for provider: <路由名>,也就是你看到的 PI_AI_ERROR。
  • 这是刻意设计而非疏漏:harness 自己的 spec 测试把该行为钉死了(llm-pi-ai/tests/catalog.spec.ts:340-371,测试名就叫 "leaves an unauthenticated route to its protocol rather than inventing a credential")——无凭据路由的期望错误正是 No API key for provider: local-llm

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kostya-sec
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants