Skip to content

test(adapters/linear): assert the deadline branch returns RateLimited in the deadline test - #116

Merged
ThomasK33 merged 1 commit into
mainfrom
test-111-deadline-branch
Oct 19, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
test-111-deadline-branch

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Fixes #111

What changed

TestRateLimitDeadlineReturnsTypedRateLimited checked that a 429 whose backoff ends past the caller deadline returns *linear.RateLimited. Three branches in doJSONWithRetry (adapters/linear/retry.go) return that type: the attempt cap, the MaxElapsed ceiling and the deadline check. The test passed whichever one fired.

The test now passes a recording slog.Handler through the public linear.Options.Logger field. The handler keeps the outcome attribute of each linear rate limited record. After PostThought returns, the test requires the outcomes to equal ["deadline"]: the deadline branch returned the error and no other retry decision happened.

Test code only. No production change and no new seam. The test keeps the #110 timing approach (10 s deadline, 5 s bound on the result). The new assertion adds no timing assumption.

Red check

I changed retry.go for one run each and restored it after.

Mutation in retry.go New test Test on main
Deadline branch disabled (false && ok) FAIL at the 5 s bound ("slept past its caller deadline") FAIL the same way
Ceiling returns first (elapsed+delay >= policy.MaxElapsed) FAIL: retry outcomes = ["ceiling"], want ["deadline"] PASS (the #111 gap)

Validation


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

… in the deadline test

TestRateLimitDeadlineReturnsTypedRateLimited checked only that a 429 with
a backoff past the caller deadline returns *linear.RateLimited. The attempt
cap and the MaxElapsed ceiling return the same type, so the test passed
whichever branch fired. It now records the "outcome" attribute of the
adapter's retry log, through the public Options.Logger field, and requires
exactly ["deadline"].

Fixes #111

_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T17:41:58.110552Z 7863048 Manual request
🔒 Security Review ✅ Completed 2026-10-19T17:42:02.621712Z 7863048 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 7863048a24

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 7863048a24

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 merged commit 4f6bcad into main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(adapters/linear): assert the deadline branch fires in TestRateLimitDeadlineReturnsTypedRateLimited

1 participant