Skip to content

fix: address Copilot review feedback from PRs #2 and #3#13

Merged
ShutovKS merged 1 commit into
devfrom
fix/review-feedback
Jul 14, 2026
Merged

fix: address Copilot review feedback from PRs #2 and #3#13
ShutovKS merged 1 commit into
devfrom
fix/review-feedback

Conversation

@ShutovKS

Copy link
Copy Markdown
Owner

Summary

Follow-up on the two actionable Copilot review comments left on earlier PRs (the rest of the PRs got no review — Copilot quota ran out from #4 onward).

PR #3 — suppressed low-confidence comment (valid bug)

errorText only walked the cause chain when the value was an Error instance. Plain-object wrappers fell through to JSON.stringify, and JSON.stringify(new Error("x")) yields "{}" — so retryable text buried in { message: "request failed", cause: new Error("model is overloaded") } was silently dropped and the pattern path never matched. Now records with a cause are walked explicitly with the same MAX_CAUSE_DEPTH cap (cycle-safe).

PR #2 — inline comment on the prune test

The test claimed pruning coverage but only asserted that an expired cooldown made the model selectable again (already true via the nextModel time check, even without pruning). Pruning is now observable: model_fallback_control status reports cooling (model → cooldown-expiry timestamp), and the test asserts expired entries are actually removed while the fresh one remains.

Testing

  • bun run typecheck — clean
  • bun test test/index.test.ts — 61 pass (2 new: plain-object cause text; circular plain-object cause chain)
  • bun test test/e2e-server.test.ts — 4 pass

🤖 Generated with Claude Code

PR #3 (suppressed comment): errorText only walked `cause` for Error
instances; plain-object wrappers fell through to JSON.stringify, which
serializes a nested Error to {} and drops retryable text. Walk `cause`
explicitly for records too, with the same depth cap.

PR #2 (inline comment): the prune test only proved an expired cooldown made
the model selectable again — pruning itself was unobservable. Expose active
cooldowns as `cooling` in model_fallback_control status and assert the
expired entries are gone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 21:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ShutovKS ShutovKS merged commit 269424f into dev Jul 14, 2026
1 check passed
@ShutovKS ShutovKS deleted the fix/review-feedback branch July 14, 2026 21:06
@ShutovKS ShutovKS mentioned this pull request Jul 14, 2026
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.

2 participants