Skip to content

[Bug]: combo rename regression tests time out and leak async work into the next fixture on clean dev #6777

Closed

Description

@thisisjun786

Client or integration

Other

Area

Other

Summary

On clean dev commit e6c6e13a22e465812f509a423990e9f09e32b1d0, tests/routing/combo-management-api.test.ts reproducibly reports 37 pass / 2 fail / 1 error under Bun 1.4.0.

PUT renames atomically, migrates public references, and clears both ids reaches provider model discovery, logs DestinationDnsResolutionError, and exceeds its default 5000ms timeout. Its async work then continues into the next test, producing an unhandled assertion (new-public expected, stable-public received). PUT rename migrates canonical references when the public alias stays unchanged subsequently reads a missing config file (ENOENT).

Expected: these existing local-fixture tests complete without depending on external DNS/model discovery, and one timed-out test cannot mutate or remove another test's fixture. This report does not establish that combo rename is broken in production; the reproducible defect may be missing test dependency isolation plus timeout cleanup.

The failures reproduce both in a worktree with an unrelated /v1/messages header patch and in a pristine git archive HEAD extraction with no source modifications. The separate reproducible native Codex toggle failure is tracked in #6776.

Reproduction

  1. Use a clean checkout of dev at e6c6e13a22e465812f509a423990e9f09e32b1d0, with dependencies installed.
  2. Start Bun with a fresh fake HOME to avoid the separate [Bug]: bare bun test prunes the real ~/.claude/agents/ocx-*.md (Bun homedir() ignores the preload's HOME sandbox) #6775 test-home hazard:
FH=$(mktemp -d)
mkdir -p "$FH/.claude"
env -u HTTPS_PROXY -u NODE_EXTRA_CA_CERTS HOME="$FH" CLAUDE_CONFIG_DIR="$FH/.claude" \
  "$BUN_BIN" test --cwd "$CHECKOUT" tests/routing/combo-management-api.test.ts

BUN_BIN is the absolute Bun executable; CHECKOUT is the repository directory.

  1. Observe the timeout at the case starting on line 1028, the unhandled assertion at line 1105, and the next test's missing fixture at line 1139.
  2. Repeat against a pristine archive of the same commit with the same dependencies. Both isolated focused runs yield 37 pass / 2 fail / 1 error, around 6 seconds. An import-connected suite also exhibits the same failures.

No real user home, installed package, or running service was modified. There are no paid provider calls in the reproduction; the unexpected discovery path fails DNS.

Version

2.82.0-dev, commit e6c6e13

Operating system

Linux x86_64, kernel 7.0.0-38-generic; Bun 1.4.0 (34cbb9a40)

Provider and model

Synthetic test providers a/b/c, models m1/m2; not a real provider-specific report.

Logs or error output

[opencodex] Provider model discovery for "a" threw DestinationDnsResolutionError [urlClass=provider-models, fallback=configured].
[opencodex] Provider model discovery for "b" threw DestinationDnsResolutionError [urlClass=provider-models, fallback=configured].
(fail) combo management API > PUT renames atomically, migrates public references, and clears both ids [5000.40ms]
  ^ this test timed out after 5000ms.

# Unhandled error between tests
error: expect(received).toBe(expected)
Expected: "new-public"
Received: "stable-public"
  at tests/routing/combo-management-api.test.ts:1105:44

ENOENT: no such file or directory, open '<isolated-test-home>/.opencodex/config.json'
  at tests/routing/combo-management-api.test.ts:1139:36
(fail) combo management API > PUT rename migrates canonical references when the public alias stays unchanged

37 pass
2 fail
1 error
Ran 39 tests across 1 file.

Screenshots and supporting files

No screenshots; existing committed tests reproduce the problem without extra files.

Redacted configuration

The reproduction uses the synthetic baseConfig and withTempHome fixtures already committed in tests/routing/combo-management-api.test.ts; no production configuration is required.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Oct 8, 2026
  2. lidge-jun commented on Oct 9, 2026

    @lidge-jun
    Owner

    Fixed on dev by #6833 (merge commit 6d7e5f4).

    It was test isolation, as you suspected. The fixture's synthetic providers had live discovery on, so the rename route's awaited Claude agent sync reached provider DNS, which the request's abort signal does not bound. A slow lookup pushed the case past 5 s, and Bun started the next case while the first was still running. The fixture now uses liveModels: false, withTempHome owners are serialized and drained (bounded) in afterEach, and a stuck owner poisons the helper instead of sharing its environment. Regressions cover zero discovery calls on rename, overlapping owners, and the poison path. The route's await is unchanged. Thanks for the clean reproduction.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions