Commit 6ef943d
committed
test: comprehensive Codespace e2e tests, fix detection for GH Actions +
- Add 32 adversarial e2e tests covering:
- Full Codespace env simulation (all 11 official env vars)
- GitHub Actions environment detection
- `GH_TOKEN` (gh CLI alias) as machine-scoped token
- Token prefix variations (`ghu_`, `ghs_`, `ghp_`, `github_pat_`)
- `CODESPACES=false` and `CODESPACES=""` edge cases
- Config-based override still works in Codespaces
- Other providers (anthropic, openai) unaffected
- Retry delay monotonicity and bounds
- Malformed JSON error handling in retryable()
- Extend detection to GitHub Actions (`GITHUB_ACTIONS=true`)
- Treat `GH_TOKEN` as machine-scoped alongside `GITHUB_TOKEN`
- Add warn log when max retries exhausted (self-heal guidance)
- Revert discover.ts comment to upstream original (only user-facing
message in index.ts was the real fix)GH_TOKEN
1 parent ace2ada commit 6ef943d
4 files changed
Lines changed: 510 additions & 14 deletions
File tree
- packages/opencode
- src
- mcp
- provider
- session
- test/provider
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1071 | 1071 | | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1080 | 1089 | | |
1081 | 1090 | | |
1082 | 1091 | | |
1083 | 1092 | | |
1084 | 1093 | | |
1085 | 1094 | | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
1091 | 1105 | | |
1092 | 1106 | | |
1093 | 1107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
411 | 421 | | |
412 | 422 | | |
413 | 423 | | |
| |||
0 commit comments