fix(cli): Keep regex log queries intact in --query - #1407
Conversation
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
from
October 5, 2026 16:38
c560771 to
61301cb
Compare
JoshuaKGoldberg
changed the base branch from
main
to
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
October 5, 2026 16:38
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
branch
from
October 5, 2026 16:42
7277c79 to
80ba22e
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
2 times, most recently
from
October 5, 2026 18:17
b71ce0c to
12a56db
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
branch
from
October 5, 2026 18:17
80ba22e to
d801aab
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
from
October 5, 2026 19:11
12a56db to
5bbe572
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
branch
2 times, most recently
from
October 5, 2026 19:27
85f016a to
d33ede4
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
from
October 5, 2026 19:27
5bbe572 to
2ea9342
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
branch
from
October 5, 2026 19:38
d33ede4 to
d1be5cb
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
from
October 5, 2026 19:38
2ea9342 to
0e13b15
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
branch
from
October 5, 2026 20:13
d1be5cb to
a0082d7
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
from
October 5, 2026 20:13
0e13b15 to
aced5d6
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
branch
from
October 5, 2026 20:36
a0082d7 to
863cfb1
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
from
October 5, 2026 20:36
aced5d6 to
56664f6
Compare
Parse `key://pattern//` (and `!key://pattern//`) as a single opaque filter, ending at the first `//` followed by whitespace, `)`, or end of query, so sanitizeQuery no longer rewrites commas, brackets, `OR`/`AND`, or repeated whitespace inside a pattern. Document regex search in the syntax reference and the CLI skill docs for logs. Refs LOGS-1031 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sentry accepts tags[k,string], tags[k:sub], flags[...], quoted, and [*] keys before a regex value, so --query now preserves regexes on those keys instead of normalizing or rewriting inside the pattern. Refs LOGS-1031 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every regex test now includes something the old sanitizer rewrites, and the comments the regex change made stale or redundant are gone. Refs LOGS-1031 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream allows a filter to follow ) or a quote with no space, so the preserved-segment check now accepts those too. Refs LOGS-1031 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Array regex needs the tags[name,array][*] key form, so listing arrays without it would point agents at a regex that silently matches nothing. Refs LOGS-1031 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1031-keep-regex-log-queries-intact-in-the-sentry-cli
branch
from
October 5, 2026 21:04
56664f6 to
714c712
Compare
JoshuaKGoldberg
force-pushed
the
joshgoldberg/logs-1015-pass-regex-log-queries-through-sentry-mcps-search-tools-as
branch
from
October 5, 2026 21:04
863cfb1 to
62d3af8
Compare
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
--- Adds a `--no-agent-skills` flag to `sentry cli upgrade`. The `upgrade` command re-runs `cli setup` on the freshly downloaded binary, which reinstalls agent skills every time. `setup` already supports `--no-agent-skills`, but `upgrade` had no way to pass it through. This wires a `--no-agent-skills` flag on `upgrade` that is forwarded into the spawned `setup` args across all upgrade paths (curl/install, package-manager in-place, and nightly standalone migration). ``` sentry cli upgrade --no-agent-skills ``` ## What changed - new `--no-agent-skills` boolean flag on the `upgrade` command (default `false`) - threaded through `runSetupOnNewBinary`, `executeStandardUpgrade`, and `migrateToStandaloneForNightly`; appends `--no-agent-skills` to the `cli setup` args when set - added an example to the command's help text - tests: default upgrade does not pass `--no-agent-skills`; `--no-agent-skills` is forwarded to setup ## Not included (needs a product decision) The issue also asks to make skill installation **opt-in by default**. That's a behavior change affecting the install script and default `setup` flow, so it's out of scope for this flag-only change — flagged for maintainers. The other points in the issue (skill content quality: `issue view --json`, jq shapes, redacting request session data) are about the generated skill content, not the upgrade command, and belong in a separate change. ## Testing - `vitest run test/commands/cli/upgrade.test.ts` — 32 passed (incl. 2 new) - `tsc --noEmit` clean - `biome check` clean on changed files Note: generated skill/doc files are gitignored and regenerated by CI, so they're intentionally not in this diff. Closes getsentry#1403 --- --------- Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
--- Adds a `--no-agent-skills` flag to `sentry cli upgrade`. The `upgrade` command re-runs `cli setup` on the freshly downloaded binary, which reinstalls agent skills every time. `setup` already supports `--no-agent-skills`, but `upgrade` had no way to pass it through. This wires a `--no-agent-skills` flag on `upgrade` that is forwarded into the spawned `setup` args across all upgrade paths (curl/install, package-manager in-place, and nightly standalone migration). ``` sentry cli upgrade --no-agent-skills ``` ## What changed - new `--no-agent-skills` boolean flag on the `upgrade` command (default `false`) - threaded through `runSetupOnNewBinary`, `executeStandardUpgrade`, and `migrateToStandaloneForNightly`; appends `--no-agent-skills` to the `cli setup` args when set - added an example to the command's help text - tests: default upgrade does not pass `--no-agent-skills`; `--no-agent-skills` is forwarded to setup ## Not included (needs a product decision) The issue also asks to make skill installation **opt-in by default**. That's a behavior change affecting the install script and default `setup` flow, so it's out of scope for this flag-only change — flagged for maintainers. The other points in the issue (skill content quality: `issue view --json`, jq shapes, redacting request session data) are about the generated skill content, not the upgrade command, and belong in a separate change. ## Testing - `vitest run test/commands/cli/upgrade.test.ts` — 32 passed (incl. 2 new) - `tsc --noEmit` clean - `biome check` clean on changed files Note: generated skill/doc files are gitignored and regenerated by CI, so they're intentionally not in this diff. Closes getsentry#1403 --- --------- Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
--- Adds a `--no-agent-skills` flag to `sentry cli upgrade`. The `upgrade` command re-runs `cli setup` on the freshly downloaded binary, which reinstalls agent skills every time. `setup` already supports `--no-agent-skills`, but `upgrade` had no way to pass it through. This wires a `--no-agent-skills` flag on `upgrade` that is forwarded into the spawned `setup` args across all upgrade paths (curl/install, package-manager in-place, and nightly standalone migration). ``` sentry cli upgrade --no-agent-skills ``` ## What changed - new `--no-agent-skills` boolean flag on the `upgrade` command (default `false`) - threaded through `runSetupOnNewBinary`, `executeStandardUpgrade`, and `migrateToStandaloneForNightly`; appends `--no-agent-skills` to the `cli setup` args when set - added an example to the command's help text - tests: default upgrade does not pass `--no-agent-skills`; `--no-agent-skills` is forwarded to setup ## Not included (needs a product decision) The issue also asks to make skill installation **opt-in by default**. That's a behavior change affecting the install script and default `setup` flow, so it's out of scope for this flag-only change — flagged for maintainers. The other points in the issue (skill content quality: `issue view --json`, jq shapes, redacting request session data) are about the generated skill content, not the upgrade command, and belong in a separate change. ## Testing - `vitest run test/commands/cli/upgrade.test.ts` — 32 passed (incl. 2 new) - `tsc --noEmit` clean - `biome check` clean on changed files Note: generated skill/doc files are gitignored and regenerated by CI, so they're intentionally not in this diff. Closes getsentry#1403 --- --------- Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
…tsentry#1408) --- Two follow-ups to getsentry#1407 (requested by @BYK on getsentry#1403). Skills stay opt-out by default per the maintainers' product decision — this does **not** flip that default. ## 1. Persist the `--no-agent-skills` preference Passing `--no-agent-skills` once now sticks. `cli setup` records `defaults.agent-skills=off` in the metadata KV store, and subsequent runs skip skill installation even without the flag — so a bare `sentry cli upgrade` (which re-runs `cli setup`) no longer reinstalls skills the user opted out of. - new `defaults.agent-skills` metadata key + `getAgentSkillsPreference` / `setAgentSkillsPreference` (mirrors the existing `telemetry` preference) - `cli setup` persists an explicit `--no-agent-skills` opt-out and honors a stored opt-out when the flag is absent - `sentry cli defaults agent-skills on|off` to view/change it; shows up in `sentry cli defaults` - re-enable anytime with `sentry cli defaults agent-skills on` ## 2. Skill content quality (issue points 1–3) Source docs feed the generated skill (`agent-guidance.md`, the `issue` command fragment, and the `event` field description): - **points at `sentry issue view <SHORT-ID> --json`** as the fastest way to get an agent up to speed, in both the workflow example and the field docs - **documents the jq shapes** — event data lives under `event.entries[]` tagged by `type`, not top-level `event.request` (the "first guess that doesn't match"); added correct recipes for request URL/method and exception type/value - **steers away from dumping request/session data** — recommends `--fields event.id,...` and named-field jq extraction instead of the whole `event` object, since the `request` entry can carry live cookies/headers/body Regenerated `SKILL.md` + `references/issue.md` are included (CI checks these are in sync). ## Testing - `vitest run test/commands/cli/defaults.test.ts` — 40 passed (incl. new agent-skills storage + shape tests) - `vitest run test/commands/cli/setup.test.ts` — new persistence tests pass (persists opt-out; honors stored opt-out without the flag). Note: 3 pre-existing agent-skill install tests fail in the sandbox because they need a live skill fetch/generation that isn't available locally — they fail identically on clean `main` here and are unrelated to this change. - `tsc --noEmit` clean - `biome check` clean on changed files Refs getsentry#1403 --- --------- Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com>
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
…tsentry#1408) --- Two follow-ups to getsentry#1407 (requested by @BYK on getsentry#1403). Skills stay opt-out by default per the maintainers' product decision — this does **not** flip that default. ## 1. Persist the `--no-agent-skills` preference Passing `--no-agent-skills` once now sticks. `cli setup` records `defaults.agent-skills=off` in the metadata KV store, and subsequent runs skip skill installation even without the flag — so a bare `sentry cli upgrade` (which re-runs `cli setup`) no longer reinstalls skills the user opted out of. - new `defaults.agent-skills` metadata key + `getAgentSkillsPreference` / `setAgentSkillsPreference` (mirrors the existing `telemetry` preference) - `cli setup` persists an explicit `--no-agent-skills` opt-out and honors a stored opt-out when the flag is absent - `sentry cli defaults agent-skills on|off` to view/change it; shows up in `sentry cli defaults` - re-enable anytime with `sentry cli defaults agent-skills on` ## 2. Skill content quality (issue points 1–3) Source docs feed the generated skill (`agent-guidance.md`, the `issue` command fragment, and the `event` field description): - **points at `sentry issue view <SHORT-ID> --json`** as the fastest way to get an agent up to speed, in both the workflow example and the field docs - **documents the jq shapes** — event data lives under `event.entries[]` tagged by `type`, not top-level `event.request` (the "first guess that doesn't match"); added correct recipes for request URL/method and exception type/value - **steers away from dumping request/session data** — recommends `--fields event.id,...` and named-field jq extraction instead of the whole `event` object, since the `request` entry can carry live cookies/headers/body Regenerated `SKILL.md` + `references/issue.md` are included (CI checks these are in sync). ## Testing - `vitest run test/commands/cli/defaults.test.ts` — 40 passed (incl. new agent-skills storage + shape tests) - `vitest run test/commands/cli/setup.test.ts` — new persistence tests pass (persists opt-out; honors stored opt-out without the flag). Note: 3 pre-existing agent-skill install tests fail in the sandbox because they need a live skill fetch/generation that isn't available locally — they fail identically on clean `main` here and are unrelated to this change. - `tsc --noEmit` clean - `biome check` clean on changed files Refs getsentry#1403 --- --------- Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com>
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
…tsentry#1408) --- Two follow-ups to getsentry#1407 (requested by @BYK on getsentry#1403). Skills stay opt-out by default per the maintainers' product decision — this does **not** flip that default. ## 1. Persist the `--no-agent-skills` preference Passing `--no-agent-skills` once now sticks. `cli setup` records `defaults.agent-skills=off` in the metadata KV store, and subsequent runs skip skill installation even without the flag — so a bare `sentry cli upgrade` (which re-runs `cli setup`) no longer reinstalls skills the user opted out of. - new `defaults.agent-skills` metadata key + `getAgentSkillsPreference` / `setAgentSkillsPreference` (mirrors the existing `telemetry` preference) - `cli setup` persists an explicit `--no-agent-skills` opt-out and honors a stored opt-out when the flag is absent - `sentry cli defaults agent-skills on|off` to view/change it; shows up in `sentry cli defaults` - re-enable anytime with `sentry cli defaults agent-skills on` ## 2. Skill content quality (issue points 1–3) Source docs feed the generated skill (`agent-guidance.md`, the `issue` command fragment, and the `event` field description): - **points at `sentry issue view <SHORT-ID> --json`** as the fastest way to get an agent up to speed, in both the workflow example and the field docs - **documents the jq shapes** — event data lives under `event.entries[]` tagged by `type`, not top-level `event.request` (the "first guess that doesn't match"); added correct recipes for request URL/method and exception type/value - **steers away from dumping request/session data** — recommends `--fields event.id,...` and named-field jq extraction instead of the whole `event` object, since the `request` entry can carry live cookies/headers/body Regenerated `SKILL.md` + `references/issue.md` are included (CI checks these are in sync). ## Testing - `vitest run test/commands/cli/defaults.test.ts` — 40 passed (incl. new agent-skills storage + shape tests) - `vitest run test/commands/cli/setup.test.ts` — new persistence tests pass (persists opt-out; honors stored opt-out without the flag). Note: 3 pre-existing agent-skill install tests fail in the sandbox because they need a live skill fetch/generation that isn't available locally — they fail identically on clean `main` here and are unrelated to this change. - `tsc --noEmit` clean - `biome check` clean on changed files Refs getsentry#1403 --- --------- Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com>
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
…tsentry#1408) --- Two follow-ups to getsentry#1407 (requested by @BYK on getsentry#1403). Skills stay opt-out by default per the maintainers' product decision — this does **not** flip that default. ## 1. Persist the `--no-agent-skills` preference Passing `--no-agent-skills` once now sticks. `cli setup` records `defaults.agent-skills=off` in the metadata KV store, and subsequent runs skip skill installation even without the flag — so a bare `sentry cli upgrade` (which re-runs `cli setup`) no longer reinstalls skills the user opted out of. - new `defaults.agent-skills` metadata key + `getAgentSkillsPreference` / `setAgentSkillsPreference` (mirrors the existing `telemetry` preference) - `cli setup` persists an explicit `--no-agent-skills` opt-out and honors a stored opt-out when the flag is absent - `sentry cli defaults agent-skills on|off` to view/change it; shows up in `sentry cli defaults` - re-enable anytime with `sentry cli defaults agent-skills on` ## 2. Skill content quality (issue points 1–3) Source docs feed the generated skill (`agent-guidance.md`, the `issue` command fragment, and the `event` field description): - **points at `sentry issue view <SHORT-ID> --json`** as the fastest way to get an agent up to speed, in both the workflow example and the field docs - **documents the jq shapes** — event data lives under `event.entries[]` tagged by `type`, not top-level `event.request` (the "first guess that doesn't match"); added correct recipes for request URL/method and exception type/value - **steers away from dumping request/session data** — recommends `--fields event.id,...` and named-field jq extraction instead of the whole `event` object, since the `request` entry can carry live cookies/headers/body Regenerated `SKILL.md` + `references/issue.md` are included (CI checks these are in sync). ## Testing - `vitest run test/commands/cli/defaults.test.ts` — 40 passed (incl. new agent-skills storage + shape tests) - `vitest run test/commands/cli/setup.test.ts` — new persistence tests pass (persists opt-out; honors stored opt-out without the flag). Note: 3 pre-existing agent-skill install tests fail in the sandbox because they need a live skill fetch/generation that isn't available locally — they fail identically on clean `main` here and are unrelated to this change. - `tsc --noEmit` clean - `biome check` clean on changed files Refs getsentry#1403 --- --------- Co-authored-by: jared-outpost[bot] <jared-outpost[bot]@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI's query sanitizer now passes
key://pattern//regex log filters through as written instead of rewriting inside the pattern.Closes LOGS-1031