feat: support reasoningEffort and fix WriterAgent model override issues#79
Open
Misaka09982 wants to merge 7 commits intoNarcooo:masterfrom
Open
feat: support reasoningEffort and fix WriterAgent model override issues#79Misaka09982 wants to merge 7 commits intoNarcooo:masterfrom
Misaka09982 wants to merge 7 commits intoNarcooo:masterfrom
Conversation
Added optional reasoningEffort field to project schema and updated related fields.
Add optional parameter for reasoning effort in init command.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<!-- 1-3 bullet points: what changed and why -->reasoningEffort推理强度配置:作为一等配置字段,支持在.env、inkos.json及modelOverrides中设置,并自动映射到 OpenAI Chat (reasoning_effort) 和 Responses (reasoning: { effort }) API。WriterAgent第一阶段写作中硬编码的0.7温度,使其能够正确响应用户在modelOverrides.writer.temperature中的自定义设置。PipelineRunner的逻辑,确保当用户仅覆盖temperature、maxTokens或reasoningEffort时,这些参数能正确下沉到实际的 API 请求中。Motivation (optional)
<!-- Why this change is needed. Link issues if applicable. -->目前的 InkOS 在使用 OpenAI o1/o3 等具备推理能力的模型时,无法通过配置控制推理强度(
reasoning_effort)。此外,由于部分 Agent(如 WriterAgent)内部存在参数硬编码,导致用户即便在配置文件中设置了覆盖参数也无法生效。Changes
<!-- File-level change list: what each file does --> File | Change -- | -- packages/core/src/models/project.ts | 在 Schema 中新增 reasoningEffort 字段,并补全 AgentLLMOverrideSchema 中的可选覆盖项。 packages/core/src/utils/config-loader.ts | 增加对环境变量 INKOS_LLM_REASONING_EFFORT 的读取支持。 packages/core/src/llm/provider.ts | 实现 reasoningEffort 在不同协议(Chat/Responses)下的请求参数映射。 packages/core/src/pipeline/runner.ts | 修正 resolveOverride 逻辑,确保非 baseUrl 变化的覆盖配置也能创建正确携带默认值的客户端。 packages/core/src/agents/writer.ts | 将创意写作阶段的 temperature 从硬编码 0.7 改为读取 client.defaults.temperature。 packages/cli/src/commands/config.ts | KNOWN_KEYS 增加推理强度支持,并在 set-global 中添加 --reasoning-effort 参数。 packages/cli/src/commands/init.ts | 在项目初始化的 .env 模板中加入推理强度的配置示例和注释。Usage (optional)
<!-- Code snippets, CLI examples, or config samples showing how to use the new feature -->命令行设置全局推理强度:
在
inkos.json中针对特定模型配置:Test plan
pnpm typecheckpassespnpm testpasses (all existing + new tests).env中设置INKOS_LLM_REASONING_EFFORT=high,通过抓包工具确认 OpenAI 请求体中包含了正确的reasoning_effort或reasoning: { effort }。writeragent 设置特定的temperature: 0.9,确认实际 API 请求参数不再是默认的0.7。Breaking changes (optional)
<!-- List any breaking changes to public API, CLI flags, config format, etc. -->无破坏性变更。
reasoningEffort为可选字段,未设置时不会影响现有逻辑。🤖 Generated with Claude Code