Skip to content

Main CI failed: Qwen Code CI — src/serve/hosted-harness-session.test.ts > … > parks an admitted prompt when model request preparation fails (+1 more) #14101

Closed

Description

@qwen-code-dev-bot

A main-branch Qwen Code CI run failed on main.

  • Failed jobs:
    • Test (ubuntu-latest, Node 22.x) — failed in step Run tests and generate reports

Failing tests

  • src/serve/hosted-harness-session.test.ts > Hosted Harness no-tool session > parks an admitted prompt when model request preparation fails
  • src/serve/hosted-harness-session.test.ts > Hosted Harness no-tool session > retains cleanup debt after interrupted channel settlement until original-owner release succeeds

This issue is labeled for autofix so the existing agent can create a repair PR.
It is deduped by failing test, so every later commit that hits the same
failure is appended below instead of opening another issue.

Recurrences

Activity

  1. added
    type/bugSomething isn't working as expected
    status/ready-for-agentFully specified; an AFK coding agent can pick this up with no human context
    autofix/approvedMaintainer explicitly approved this issue for autonomous autofix
    on Oct 13, 2026
  2. added
    autofix/in-progressThe scheduled autofix agent has claimed this issue
    and removed
    autofix/approvedMaintainer explicitly approved this issue for autonomous autofix
    on Oct 13, 2026
  3. qwen-code-dev-bot commented on Oct 13, 2026

    @qwen-code-dev-bot
    CollaboratorAuthor

    🤖 The scheduled autofix agent is picking this issue up. It will attempt to establish the current behavior, implement the requested change, run E2E verification, and open a pull request linked to this issue. If the attempt fails, this claim will be withdrawn so a human can take over.

    Maintainers: comment or assign someone to stop future automated attempts, or add the autofix/skip label.

  4. doudouOUC commented on Oct 13, 2026

    @doudouOUC
    Collaborator

    根因分析

    CI-TEST-REGRESSION — commit 53579861daba (fix(serve): resume committed file results after runtime retirement #14059) 引入的回归。

    回归确认

    • Green run 44ddf79ef4e8 (run 38418699275, 2026-10-13T15:03Z) 的 Test (ubuntu-latest, Node 22.x) job success:✓ src/serve/hosted-harness-session.test.ts (459 tests) 188409ms——全部 459 个测试通过。
    • Failing run 53579861daba (run 38410683888, job 115369140703) 同一 test file 2 个测试失败(×3 attempts = 6 fails)。
    • 53579861daba 修改了 3 个源文件 + 重写了 hosted-recovery.test.ts:
      • hosted-workspace-tool-turn.ts (+68/-1):新增 retiredOwnerResults 状态 + confirmReplacedHostedTurnOwner 自动恢复逻辑
      • hosted-turn-cleanup.ts (+61/-7):抽取 cleanupIdentity + 新增 confirmReplacedHostedTurnOwner 函数
      • hosted-file-history.ts (+4/-1):放宽 canSettleHostedFileHistory 的 record 参数类型为 Pick<…, 'pendingTurn'|'pendingUndo'|'pendingMessageId'>
    • 测试文件 hosted-harness-session.test.ts 未被此 commit 修改(parent 与 new byte-identical 25646 行)。

    失败 1:parks an admitted prompt when model request preparation fails

    AssertionError: expected { …(3) } to match object { hasActivePrompt: false, …(1) }
    - Expected          + Received
      {                   {
    -   "hasActivePrompt": false,    +   "hasActivePrompt": true,
    -   "recoveryBlocked": true,      +   "recoveryBlocked": false,
      }                     }
      at hosted-harness-session.test.ts:6094:27
    

    测试用 LlmRequestPreparationError mock 模型准备失败,期望 prompt 被 park (hasActivePrompt:false, recoveryBlocked:true),实际 prompt 仍 active 且 recovery 未阻塞。

    该测试使用 app()(无 broker、无 toolProfile),属 Hosted Harness no-tool session describe 块。新代码在 resumeCommittedResults (hosted-workspace-tool-turn.ts:1993-2050) 中新增的 HOSTED_WORKSPACE_FILE_PROFILE 自动恢复路径不应直接触发(无 file history pendingTurn),但 finish() 的 guard 从 if (!this.acquired) return; 改为 if (!this.acquired && !this.retiredOwnerResults) return;(:6893),以及 acquire() 新增 retiredOwnerResults early-throw(:6898),可能通过共享代码路径影响了 no-tool session 的模型准备失败处理流程。

    失败 2:retains cleanup debt after interrupted channel settlement until original-owner release succeeds

    AssertionError: expected "release" to be called 1 times, but got 0 times
      at hosted-harness-session.test.ts:6139:23
    

    测试通过 prewriteChannelWriteInterruption(true) 预写 channel turn + cleanup debt,然后 app(true) 恢复加载,期望 release 被调用 1 次(recoveryBlocked:true)。

    新代码 confirmReplacedHostedTurnOwner (hosted-turn-cleanup.ts:138-183) 在 resumeCommittedResults (:2034) 中被调用,条件为 !saved?.pendingTurn && !saved?.pendingUndo(:1994-1995)。但测试 setup 通过 commitHostedFileHistory 设置了 pendingTurn: channelTurn,因此 saved.pendingTurn 非 null → !saved?.pendingTurn 为 false → 新自动恢复路径不应触发。

    然而 release 被调用 0 次(期望 1 次),说明原有的 reconcileHostedTurnCleanup 调用路径(cleanup() :6924-6929)被新代码阻断。可能的机制:新代码在 resumeCommittedResults 的 if (saved?.pendingTurn) 分支(:1891)内部行为发生变化——canSettleHostedFileHistory 调用的参数类型被放宽后,可能接受了之前会被拒绝的部分对象,改变了恢复流程的分支走向。

    建议

    1. 需确认 resumeCommittedResults 在 saved.pendingTurn 存在时的新旧路径差异——特别是 canSettleHostedFileHistory 参数放宽后是否导致 settle 检查行为变化。
    2. 确认 finish() guard !this.retiredOwnerResults 是否在 no-tool session 路径意外允许了不应继续的 finish。
    3. 此 commit 的 hosted-recovery.test.ts 同步重写了对应测试(+251/-111),新增了 9 个参数化 case,但 hosted-harness-session.test.ts 中的这两个测试未同步更新——可能存在测试期望与新行为不匹配。
    4. HEAD 6212189f 中 hosted-workspace-tool-turn.ts 与 53579861daba byte-identical(未修复),CI run 38435473057 仍在排队。
  5. jabrailkhalil commented on Oct 24, 2026

    @jabrailkhalil
    Contributor

    I reproduced the cleanup-debt case as an overlap between the wake retry and a passive load. Besides the extra release, a late failed retry can re-block a Session after cleanup succeeds. I fixed both in #15482; the unchanged regressions fail with the old production code and pass with the fix. Full Harness/approval and related recovery checks pass. This addresses the cleanup case here, not the separate prompt-parking report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

autofix/in-progressThe scheduled autofix agent has claimed this issuestatus/ready-for-agentFully specified; an AFK coding agent can pick this up with no human contexttype/bugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions