Skip to content

fix: classify 403 forbidden as workspace-mismatch#1

Merged
NgoQuocViet2001 merged 1 commit intoNgoQuocViet2001:mainfrom
wwenrr:fix/failover-403-workspace-mismatch
Apr 3, 2026
Merged

fix: classify 403 forbidden as workspace-mismatch#1
NgoQuocViet2001 merged 1 commit intoNgoQuocViet2001:mainfrom
wwenrr:fix/failover-403-workspace-mismatch

Conversation

@wwenrr
Copy link
Copy Markdown
Contributor

@wwenrr wwenrr commented Apr 3, 2026

Summary

  • treat common HTTP 403/Forbidden responses as workspace-mismatch in failover classification
  • keep auto-switch policy unchanged (still only switches for supported reasons)
  • add tests to cover 403 plain-text and JSON payload cases

Why

Some workspace/organization policy failures return 403-style messages instead of the current keyword set. Without this mapping, those failures are not classified and no failover is attempted.

Verification

Ran locally:

  • npm test23 passed
  • npm run buildpass
  • npm run release:checkRelease guard passed

Scope check

Changed files only:

  • src/core/failover-engine.ts
  • tests/failover-engine.test.ts

Copy link
Copy Markdown
Owner

@NgoQuocViet2001 NgoQuocViet2001 left a comment

Choose a reason for hiding this comment

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

Thanks for the focused fix. Classifying the common 403/Forbidden workspace-policy path as workspace-mismatch makes sense for this project and the extra tests are helpful too.

@NgoQuocViet2001 NgoQuocViet2001 merged commit b840b8c into NgoQuocViet2001:main Apr 3, 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