← Back to PRs

#23139: test: fix flaky auth tests when OPENCLAW_GATEWAY_TOKEN is present

by Imccccc open 2026-02-22 02:14 View on GitHub →
channel: msteams gateway commands agents size: S
Running `pnpm test` locally with `OPENCLAW_GATEWAY_TOKEN` set causes `src/gateway/server-runtime-config.test.ts` and `src/browser/server.post-tabs-open-profile-unknown-returns-404.test.ts` to fail because they don't isolate their environment properly. This clears the token in `beforeEach` and restores it in `afterEach` for these specific suites. <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixes flaky auth tests by properly isolating `OPENCLAW_GATEWAY_TOKEN` and `OPENCLAW_GATEWAY_PASSWORD` environment variables in test suites. The PR bundles several unrelated changes including Gemini 3.1 model support, markdownlint config updates, Windows long path detection improvements, and formatting fixes. <h3>Confidence Score: 4/5</h3> - Safe to merge with minor concerns about bundling unrelated changes - The core test isolation fix is correct and necessary. The bundled changes (Gemini 3.1 support, markdownlint config, path detection) appear sound but violate the repository's guideline to avoid bundling unrelated changes in a single PR. The `@ts-ignore` additions are justified but go against the coding style preference to avoid `@ts-nocheck`/ignores when possible. - No files require special attention - all changes are straightforward <sub>Last reviewed commit: 2493b67</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs