Skip to content

feat(webapp): dashboard agent — chat, reports, Investigate, Watch - #4418

Open
kathiekiwi wants to merge 387 commits into
mainfrom
feat/dashboard-agent-flows
Open

feat(webapp): dashboard agent — chat, reports, Investigate, Watch#4418
kathiekiwi wants to merge 387 commits into
mainfrom
feat/dashboard-agent-flows

Conversation

@kathiekiwi

@kathiekiwi kathiekiwi commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

An AI assistant in a side panel on every dashboard page, behind the dashboard-agent feature flag. It reads runs, errors, queues, deploys and health through the public API (read-only, delegated user token), answers with rich cards, and can keep watching things after the conversation ends.

What's inside

  • Foundation@internal/dashboard-agent-contracts (trigger:// URI grammar, intents, watch specs, block envelope), investigations + watches tables, head-start reliability fix, eval sample-rate gate.
  • Reportsget_report renders the deterministic health report as a card (metric grid, sparklines, Next steps button row); stale telemetry is flagged and never trusted for advice.
  • Investigate — hypothesis-driven investigation on a live card with system-owned identity and revisions; entry buttons on failed runs, errors, backed-up queues and waiting runs; code-grounded when a repo is connected; server-generated follow-ups (Show code, View similar, Watch for a repeat).
  • Watch (Dashboard Agent: Watch (background condition watches + wake notifications + alerts) #4456) — one-shot background watches with a compact creation card on run/queue/error/health pages: resolution + observed outcome model, exactly-once wake delivery, expiry sweep, optional investigate-on-attention, standing email/Slack/webhook alerts with one-click unsubscribe. Queue conditions: drain, above/below N, stalled, oldest-age SLA.
  • UI — blank-state hero (Ask AI) with a Tab-to-accept placeholder and colored smart prompts, fullscreen mode, one persistent agent spinner across all phases.
  • Smart prompts — page-aware chips on every env page (37 routes, 24 page kinds); investigate/status chips appear only on loader-backed abnormal state.
  • Tooling — navigation, TRQL queries with live charts, deploy correlation, docs answers; golden eval suite; seeder for a live playground project (db:seed:agent-examples, with --heartbeat / --degrade / --recover for demos).

How to review

GUIDEBOOK.md — 10-minute local setup and a hands-on walkthrough of every case.

Notes

  • Everything is gated by canAccessDashboardAgent; no behavior change with the flag off.

… the docs button

A card's watch button now sends a visible request the agent answers
with schedule_watch — the transcript shows what was asked, the agent
confirms, and the email-alert offer applies. Docs footer entries render
as the docs button whatever shape their link arrived in; cited
references keep a link via a status-page fallback.
…tions state the lifetime

The chat's watch list now includes fired/expired watches (chips still
filter to active), so a wake banner can tell good news from bad instead
of falling back to the neutral wording. The agent's watch confirmation
must now always say it fires once and exactly when it gives up.
…ved slot

Every chat row keeps the leading slot so titles align; watching spins
like thinking (the hover title says which) and the short status text
stays on hover.
…n through

The endpoints require chatId (the same chat-scoped floor watch creation
uses); the tools sent none and every call died as a 400.
…umber in one column

The throughput label now sits vertically centered against its
value+breakdown stack, and 842/830 start on the same vertical as
+12/min and the other rows' values; sub labels follow their numbers.
…aks plainly

One conversational message with the watch's note, a lime CTA, and the
same skeleton as the billing-limit email; the fielded fact sheet is
gone and the unsubscribe link keeps its wiring with footer styling.
'Watch update — all clear / needs your attention', toned by kind; the
identity moves to the details line and the subject follows suit.
@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4ff8859

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@trigger.dev/core Patch
trigger.dev Patch
@trigger.dev/build Patch
@trigger.dev/python Patch
@trigger.dev/redis-worker Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@internal/metrics-pipeline Patch
@trigger.dev/rbac Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@trigger.dev/sso Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/dashboard-agent Patch
@internal/sdk-compat-tests Patch
@trigger.dev/react-hooks Patch
@trigger.dev/rsc Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds a Dashboard Agent feature set. It introduces a contracts package for shared schemas (view blocks, intents, page context, watches, trigger:// URIs), a dedicated database package for chats, investigations, and watches, and core agent tool/prompt logic. It adds a watch-tick lifecycle with checks, alerts (email, Slack, webhook), and unsubscribe flows. It adds API routes for watches, alerts, queue metrics, and run diagnostics. It redesigns the chat panel UI with investigation, report, and watch cards, suggested prompts, and unread-wake notifications. It adds a Storybook demo gallery with screenshot tooling, seed scripts, and removes "Docs" links from page headers across the webapp.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.48% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the feature in detail but omits the required issue reference, checklist, Testing, Changelog, and Screenshots sections. Add the required template sections, complete the checklist, document test steps, summarize the changelog, include screenshots, and reference the closing issue.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the dashboard agent chat, reports, Investigate, and Watch feature work.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dashboard-agent-flows

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…t button; URLs are links

The prompt now treats earlier turns' pages as history — deictic
questions re-read the current page every turn, and page explanations
end with a matching docs link. The report's contact action falls back
to the contact page as a real external button instead of an ask
round-trip, and answers that point at a URL carry it as a link.
…ress line, wake toast opens its chat as an agent Callout

- navigate intents and navigate_to outputs resolve trigger:// URIs
  server-side and navigate in place; same-origin citation buttons
  navigate instead of opening a new tab.
- The transcript autoscrolls on send and follows streaming near the
  bottom; a store-order stable merge stops messages landing mid-chat
  after a page change (server-side single-read follow-up noted).
- The generic Working line yields to a tool-specific one.
- The wake toast is the new agent Callout variant (chat icon) and opens
  the exact chat that woke.
Base automatically changed from feat/queue-metrics-and-health to main July 29, 2026 15:45
An in-flight tool call now shows a compact pill (per-tool phrase +
spinner, watch-chip visual language) instead of raw streaming JSON —
covering render_view and get_report, the biggest offenders. Completed
and error states render as before; gallery in-flight examples reworked
and a pill line-up section added.
The answer is the prose and the cards, never the input/output plumbing:
a landed call disappears (the pill was its only trace), and only a
FAILED call keeps its error row. Gallery example reworked accordingly.
Wakes are wake-shaped (banner renders), no prose points at tool rows
that no longer render, footer-era phrasing removed, the four-wake
variation matrix became one coherent story, and tests now enforce all
of it (wake ids parse via the real WakeBanner, removed-UI phrases are
banned).
Offering to fetch what a tool can fetch now is banned; 'how do I check
X' about the user's project gets both the how-to and the actual check;
only genuinely unreachable steps (their infra, their code, external
pages) go to the user, clearly separated.
…flows

# Conflicts:
#	.changeset/report-health.md
#	.server-changes/agent-detail-metrics-layout.md
#	.server-changes/paginate-concurrency-keys-table.md
#	.server-changes/queue-metrics-dashboard.md
#	apps/webapp/app/components/dashboard-agent/AgentChart.tsx
#	apps/webapp/app/components/metrics/MiniLineChart.tsx
#	apps/webapp/app/components/query/QueryEditor.tsx
#	apps/webapp/app/env.server.ts
#	apps/webapp/app/hooks/useMetricResourceQuery.ts
#	apps/webapp/app/presenters/v3/QueueListPresenter.server.ts
#	apps/webapp/app/presenters/v3/QueueMetricsPresenter.server.ts
#	apps/webapp/app/presenters/v3/RunQueueMetricsPresenter.server.ts
#	apps/webapp/app/presenters/v3/reports/health/health-data.ts
#	apps/webapp/app/presenters/v3/reports/health/health-messages.ts
#	apps/webapp/app/presenters/v3/reports/health/health.ts
#	apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/ExamplesContent.tsx
#	apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/TableSchemaContent.tsx
#	apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx
#	apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues_.$queueParam/route.tsx
#	apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.standard.$taskParam/route.tsx
#	apps/webapp/app/routes/api.v1.query.schema.ts
#	apps/webapp/app/routes/resources.metric.tsx
#	apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query.ai-generate.tsx
#	apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam.spans.$spanParam/route.tsx
#	apps/webapp/app/routes/resources.queues.concurrency-keys.ts
#	apps/webapp/app/services/queryService.server.ts
#	apps/webapp/app/v3/querySchemas.ts
#	apps/webapp/app/v3/queueMetrics.server.ts
#	apps/webapp/test/reportHealth.test.ts
#	internal-packages/clickhouse/src/client/tsql.ts
#	internal-packages/run-engine/src/engine/systems/enqueueSystem.ts
#	internal-packages/tsql/src/query/schema.ts
@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@8d3676a

trigger.dev

npm i https://pkg.pr.new/trigger.dev@8d3676a

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@8d3676a

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@8d3676a

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@8d3676a

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@8d3676a

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@8d3676a

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@8d3676a

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@8d3676a

commit: 8d3676a

@kathiekiwi kathiekiwi changed the title Dashboard Agent V1 — chat, reports, Investigate, Watch feat(webapp): dashboard agent — chat, reports, Investigate, Watch Aug 6, 2026
The table is append-only quality data with no reader, so the sweep now drops rows past
the period in one bounded statement per run.
…and the judge

Payloads, outputs, query rows and file contents are replaced by their shape before a turn
reaches the judge, and the row now keeps the derived verdict only.
A per-org feature flag the agent checks before every judged turn, and a turn is judged only
on an explicit yes.
The CI lane reads its own variable and defaults to every turn, so neither lane can change
the other's rate.
The docs claimed every turn is judged; the sampled rate, the redaction rule, the code-mode
skip, the opt-out and the retention period are now written down in one place.
…ponsibility

tools.ts now only assembles ready adapters, in the same frozen key order: the
HTTP/JWT client, result curation, the docs client, the source-read ledger,
evidence canonicalisation, investigation persistence, and the api/navigation/
watch/alert tool groups each own their own module. A pure move.

The prompt-prefix fingerprints are unchanged, which is what keeps the head-start
and agent prefixes byte-identical.
…ion, batch and adapters

watch-tick.ts keeps the two task definitions and the per-watch check; the wake
delivery, the condition lifecycle, the group tick and the db/session/callback
adapters each move to their own module. A pure move: watch-tick.ts re-exports
everything it exported before.
dashboardAgentWatchChecks.ts keeps the dispatcher, the failure envelope and the
previous-facts reader, and re-exports the run, queue, error and health families
plus the shared reader contract. A pure move; every import path is unchanged.
The chip factory and slot vocabulary, the evergreen docs chips, the per-page slot
table and the signal chips each get their own module; registry.ts is now the
public face that re-exports them. A pure move.
…ing it

The batch took the 500 soonest-expiring watches of a group every tick, so a group
larger than the cap could leave the rest unchecked until the first 500 expired.
The group is now ordered least-recently-checked first, with a generated
cadence_minutes column and an index so the due predicate no longer re-parses the
spec JSON per tick.
…e watch

The page load reported unread wakes only, so a fresh browser whose watch was
created elsewhere and hasn't fired yet never started polling: the wake landed
without a toast or a dot until a reload. The loader now returns the active-watch
presence too, in one read per page load.
The message-size checks ran after the body had been read, so a request without a
content-length was buffered and parsed in full before being refused. An ingress
cap on the agent's paths now counts the bytes as they arrive, and the chat proxy
reads its body with a ceiling instead of reading it whole first.
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.

2 participants