The discovery tests were failing in CI with "demo" plugin name instead
of expected names. The root cause was test directory structure:
**The Bug:**
Original test code created installPath as a subdirectory:
```typescript
const installPath = join(createTemporaryDirectory("omo-plugin-install-"), "oh-my-openagent")
```
This created: `/tmp/omo-plugin-install-XXXXXX/oh-my-openagent`
If another test created `/tmp/omo-plugin-install-YYYYYY/.claude-plugin/plugin.json`
with name "demo", and the test execution order caused the discovery test
to pick up the wrong temp directory, it would read the manifest with "demo".
**The Fix:**
Changed tests to use unique temp directories directly:
```typescript
const installPath = createTemporaryDirectory("omo-npm-plugin-")
```
This creates: `/tmp/omo-npm-plugin-XXXXXX`
Each test now has its own unique temp directory that cannot be contaminated
by other tests.
**Also included:**
- mock.module() for process isolation in CI runner
- pluginsHomeOverride parameter for plugins database isolation
Fixes CI failure on dev branch.
The discovery tests were failing in CI with "demo" plugin name instead of
expected names. This happened because:
1. The CI test runner (run-ci-tests.ts) groups tests by directory
2. Tests using mock.module() are run in isolated processes
3. Tests without mock.module run in a shared batch
4. Other tests in the shared batch were creating plugin state that
contaminated the discovery tests
Fix adds mock.module() to discovery tests:
- Mocks the logger module to avoid noise
- Forces CI runner to run these tests in isolated process
- Prevents cross-test contamination
Combined with previous pluginsHomeOverride parameter fix, this ensures
tests are properly isolated both at the parameter level and process level.
Also removes debug logging that was added for troubleshooting.
Fixes CI failure on dev branch.
The discovery.test.ts was using process.env.CLAUDE_PLUGINS_HOME to set
the plugins directory, but this global state could be affected by other
tests running in parallel, causing flaky failures with errors like:
Expected: "oh-my-openagent"
Received: "demo"
Changes:
- Added pluginsHomeOverride option to PluginLoaderOptions type
- Modified discoverInstalledPlugins to accept optional pluginsHomeOverride
- Modified loadInstalledPlugins to accept optional pluginsBaseDir
- Updated all 3 discovery tests to use pluginsHomeOverride instead of
relying on global process.env.CLAUDE_PLUGINS_HOME
This makes the tests properly isolated and deterministic regardless of
test execution order or parallelization.
Fixes CI failure on dev branch.
GitHub Copilot performs rolling model updates which sometimes return
'400 Bad Request' when a model is temporarily unavailable. This error
was not in the retryable message patterns, causing model fallback to
not trigger and users getting stuck.
Changes:
- Added 'bad request' to RETRYABLE_MESSAGE_PATTERNS in model-error-classifier.ts
- Added test cases for 'bad request' pattern matching
Fixes#3130