Skip to content

[bug] 负 token 预算强制产生无效输出 #84

Description

@Misaka477

step-realtime-cli 版本

1.0.0

Node 版本 & OS

Node 24.16.0 / Linux (Fedora 44)

复现步骤

  1. 构造一个远超出 context window 的对话(promptTokens > maxContextTokens
  2. Agent loop 在 computeStepMaxTokens 中计算 remainingBudget 为负数
  3. clamp 返回 minOutputTokens(默认 256)
  4. API 返回 context length exceeded 错误(或抛出异常)

期望行为

remainingBudget 小于等于 0 时应返回 0,跳过该次模型调用或触发 compact 流程

实际行为

模型被强制要求生成 256 token 的输出,但 context 窗口已无空间,API 调用失败

日志 / 堆栈

截图(可选)

No response

自检

  • 我已搜索 existing issues,确认这不是重复问题
  • 我已阅读 CONTRIBUTING.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions