You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Consolidates the five open Cursor BugBot PRs (#908, #947, #973, #1023,
#1044)
into a single, de-duplicated, rebased PR. Each genuinely-needed fix is
verified
against current `main`; overlapping fixes use the best variant; stale
and
subjective changes are dropped.
## Why consolidate
The five BugBot PRs heavily overlapped and had gone stale (7–113 commits
behind
`main`): the cache `JSON.parse` guard appeared 3×, the `withTTY` test
fix 2×, the
pagination guard 3×. Several also failed CI only on unrelated base
drift. This PR
lands the real fixes once and adds guardrails so the
duplication/staleness
doesn't recur.
## Fixes included
**Cache hardening** (`fix(db)`) — from #908/#947/#1044
- New `safeParseJson()` db helper; used in `getPaginationState()` (with
`Array.isArray` validation) and `getCachedDetection()` so corrupt cached
JSON
is a cache miss, not a crash.
- `log.debug()` added to three silent catch blocks in
`sentry-client.ts`.
**Event pagination** (`fix(events)`) — from #947
- `listIssueEvents` now uses the shared `autoPaginate()` helper and
drops
`nextCursor` when a page overshoots `limit`, so `-c next` never skips
events.
Adds a property test for the `autoPaginate` trim-drops-cursor invariant
plus a
focused overshoot regression test.
**Relative time** (`fix(formatters)`) — from #1044
- `formatRelativeTime` clamps `diffMs` to `>= 0` ("0m ago" instead of
"-5m ago").
**Seer** (`fix(seer)`) — from #973/#1023, relates to #958
- `normalizeAgentStatus` maps `canceled`/`cancelled` → `CANCELLED`
(fixes a
polling-timeout bug) and `need_more_information` →
`NEED_MORE_INFORMATION`.
- `searchContainersForRootCauses` requires `causes.length > 0` so an
empty
legacy array no longer blocks the agent-artifact fallthrough.
- `extractNoSolutionReason` reads the step-level `description` (current
API)
before the artifact-level `reason` (legacy).
**Release set-commits** (`fix(release)`) — from #1023
- Narrow the default-mode 400 fallback to the exact
`NO_REPO_INTEGRATIONS_MESSAGE`
so unrelated 400s (invalid refs, bad release state) propagate instead of
being
masked as "no integration".
**Test isolation** (`test`) — from #1044/#947
- `withTTY` now saves/restores `NO_COLOR` and `FORCE_COLOR` (CI sets
`NO_COLOR=1`).
## Systemic guardrails
- `script/check-error-patterns.ts` gains an advisory silent-catch scan
(`SENTRY_STRICT_SILENT_CATCH=1` to enforce).
- `AGENTS.md` documents automated-fix-PR rules: check existing
PRs/issues first,
rebase before review, separate correctness from opinion, prefer shared
helpers.
- Removed a stale, now-unused `biome-ignore` in `formatters/local.ts`
that broke
repo-wide lint under biome 2.3.8.
## Dropped (intentionally)
- **`issue list` "lifetime" collapse removal** (#973) — superseded on
`main` by
the `shouldCollapseLifetime` param; issue #969 is already closed.
- **Issue selector hint `is:resolved` → bare list** (#1023) — subjective
UX;
`main`'s current behavior is deliberate.
## Follow-up
- A scheduled stale-bot to auto-close inactive bot PRs (out of scope
here).
## Testing
- `pnpm run typecheck` ✓
- `pnpm run lint` ✓ (766 files)
- `pnpm run check:errors` ✓ · `pnpm run check:deps` ✓
- `pnpm run test:unit` ✓ (325 files, 7419 passed, 13 skipped)
Closes#908, #947, #973, #1023, #1044.
Copy file name to clipboardExpand all lines: AGENTS.md
+39-1Lines changed: 39 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -510,7 +510,7 @@ CliError (base, exitCode=1)
510
510
- Pass `alternatives: []` when defaults are irrelevant (e.g., for missing Trace ID, Event ID)
511
511
- Use `" and "` in `resource` for plural grammar: `"Trace ID and span ID"` → "are required"
512
512
513
-
**CI enforcement:**`bun run check:errors` scans for `ContextError` with multiline commands and `CliError` with ad-hoc "Try:" strings.
513
+
**CI enforcement:**`bun run check:errors` scans for `ContextError` with multiline commands, `CliError` with ad-hoc "Try:" strings, and silent `catch` blocks (advisory).
514
514
515
515
```typescript
516
516
// Usage examples
@@ -554,6 +554,12 @@ catch (error) {
554
554
555
555
Use `logger.withTag("command-name")` for tagged logging in command files.
556
556
557
+
**CI enforcement:**`bun run check:errors` includes a silent-catch scan that flags
558
+
`catch` blocks which are empty, comment-only, or return-only without surfacing the
559
+
error. It is currently **advisory** (warns, does not fail CI) because of a pre-existing
560
+
backlog; run with `SENTRY_STRICT_SILENT_CATCH=1` to enforce. Do not add new silent
561
+
catches — they will appear in the scan output during review.
562
+
557
563
### Auto-Recovery for Wrong Entity Types
558
564
559
565
When a user provides the wrong type of identifier (e.g., an issue short ID
0 commit comments