Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

test(server): agent-task-recovery Retry-After floor case flakes under load

Open Beginner friendly
#7,613 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, typescript

Research direction

Start with tests/server/agent-task.test.ts around the failing assertion at line 1414, then inspect the shared globalThis.fetch stub and nearby recovery cases. Reproduce with the supplied bun scripts/test.ts --changed=v2.91.0 command under load. Scope the fetch count to this case or clean up pending recoveries; done when the Retry-After floor assertion remains deterministic in the multi-file run.

Written by the indexing model from the issue text.

Description

bug proxy
Client or integration

Other

Area

Proxy and routing

Summary

tests/server/agent-task-recovery.test.ts case "agent task recovery transient retry (#3661) > a Retry-After inside the deadline is honoured as a floor, not capped" failed once in a loaded multi-file run (bun scripts/test.ts --changed=v2.91.0, 47151 pass / 1 fail) during 2.92.0 release-candidate verification at dev 03bcf789e95c. The interval between the first and second recovery fetch was 664 ms, against an expected floor of 2400 ms. In isolation it passed 6/6 at the candidate and 6/6 at v2.91.0, and neither src/server/responses/agent-task-recovery.ts nor the test changed in the train, so this looks like a test-isolation flake rather than a product regression.

Suspected cause: the case counts any call to the shared globalThis.fetch stub as the second recovery attempt. A retry left pending by an earlier case in the same file (its timer delayed under CPU load) can land on this case's stub, increment fetches to 2, and record secondAt early. Scoping the stub per request (for example, matching a per-case request marker) or awaiting and cancelling the earlier cases' pending recoveries in afterEach would make the assertion deterministic.

Reproduction
OCX_TEST_RUNNER_BUN=/path/to/bun-1.4.3 bun scripts/test.ts --changed=v2.91.0

Intermittent and load-dependent (host load average about 5 to 10 during the run). It does not reproduce with bun test --isolate tests/server/agent-task-recovery.test.ts alone.

Version

dev @ 03bcf789e95cc01fb809b624e4fb109e351308eb (2.92.0 candidate)

Operating system

macOS (arm64)

Provider and model

N/A

Logs or error output
Expected: >= 2400
Received: 664
      at tests/server/agent-task-recovery.test.ts:1414:32
(fail) agent task recovery transient retry (#3661) > a Retry-After inside the deadline is honoured as a floor, not capped [2502.99ms]
Screenshots and supporting files

No response

Redacted configuration

No response

Checks
  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.
Dominant language
TypeScript
Stars
16.9k
Forks
1.3k
Avg merge
8h 13m
Merged PRs (30d)
625

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lidge-jun/opencodex

All issues in lidge-jun/opencodex

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.