Safe workflow for changing account selection, fallback, retry, or failover behavior in the plugin runtime.
Adjust routing policy without obscuring why requests changed behavior.
index.tslib/request/failure-policy.tslib/request/rate-limit-backoff.tslib/request/stream-failover.tslib/request/request-transformer.tslib/accounts.tslib/rotation.tstest/index.test.tstest/index-retry.test.tstest/failure-policy.test.tstest/request-transformer.test.tstest/stream-failover.test.ts
- Write down the policy change in one sentence before coding.
- Identify whether the change affects:
- account choice
- fallback model choice
- retry timing
- cooldown timing
- stream failover behavior
- Add or update the narrowest tests first.
- Preserve request invariants unless the change explicitly targets them:
stream: truestore: false- include
reasoning.encrypted_content
- Prefer adjusting one policy decision point instead of rewriting multiple layers at once.
- If behavior becomes harder to explain, add diagnostics or comments before merging.
npm run lint
npm run typecheck
npm test -- test/index.test.ts test/index-retry.test.ts test/failure-policy.test.ts test/request-transformer.test.ts test/stream-failover.test.ts
npm run build- policy delta is clearly stated
- request invariants remain covered
- retry or fallback changes have targeted regression tests
- reviewers can tell whether behavior changed intentionally or accidentally
- no storage or CLI refactor was mixed into the same change