Skip to content

feat: drop query_alerts and switch query_incidents to free-text query#52

Merged
ysyneu merged 2 commits intomainfrom
feat/incident-query-and-drop-query-alerts
May 10, 2026
Merged

feat: drop query_alerts and switch query_incidents to free-text query#52
ysyneu merged 2 commits intomainfrom
feat/incident-query-and-drop-query-alerts

Conversation

@ysyneu
Copy link
Copy Markdown
Collaborator

@ysyneu ysyneu commented May 10, 2026

Summary

  • Drop query_alerts — it pushed LLMs into iterating over individual alert events instead of working with incidents (the actual top-level entity). query_alert_events is kept for drilling into a single alert by ID during investigation.
  • Switch query_incidents from titlequery — maps to the backend /incident/list query field, which:
    • Performs Doris full-text search across title / labels / content
    • Auto-resolves a 24-char hex string to an incident_id lookup
    • Auto-resolves a 6-char string to a num lookup
  • The previous title param defaulted to exact match and rarely surfaced anything from a fuzzy LLM-generated keyword.

The Alerts toolset shrinks from 2 → 1 tools (query_alert_events).

Dependencies

Requires flashcatcloud/flashduty-sdk#5 (adds Query to ListIncidentsInput). The replace directive in go.mod pins to the SDK fork commit while that PR is in review — swap to a real version once it merges.

Test plan

  • go build ./... clean
  • go test ./... passes
  • Restart Safari against this local MCP server and run e2e exercises
  • Drop replace directive after SDK PR merges

ysyneu added 2 commits May 10, 2026 11:07
The query_alerts tool nudged LLMs into iterating over individual alert
events instead of working with incidents (the actual primary entity in
Flashduty). Remove it; QueryAlertEvents is preserved for drilling into
a single alert by ID, which still has clear value during incident
investigation.

For query_incidents, replace the title param with query, which maps to
/incident/list's `query` field. Backend behavior:

- Doris full-text search across title/labels/content
- 24-char hex string -> resolved as incident_id
- 6-char string     -> resolved as incident num

The previous title param was exact-match by default and surfaced almost
nothing for fuzzy keywords coming out of an LLM. query is the same
field the web UI search bar uses.

go.mod replace pins to the SDK fork commit while
flashcatcloud/flashduty-sdk#5 is in review; swap to a real version
once that PR merges.
The previous commit pinned via a replace pointing at the ysyneu fork
because the SDK PR was open cross-fork. The SDK branch is now also on
flashcatcloud/flashduty-sdk, so we can pin straight to the upstream
commit pseudo-version and drop the replace.
@ysyneu ysyneu merged commit 7d60a5d into main May 10, 2026
13 checks passed
@ysyneu ysyneu deleted the feat/incident-query-and-drop-query-alerts branch May 10, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant