Skip to content

fix(webapp): keep the dashboard agent's tool calls on the user's instance - #4740

Merged
ericallam merged 1 commit into
mainfrom
fix/dashboard-agent-tools-origin-tri-13390
Aug 20, 2026
Merged

fix(webapp): keep the dashboard agent's tool calls on the user's instance#4740
ericallam merged 1 commit into
mainfrom
fix/dashboard-agent-tools-origin-tri-13390

Conversation

@ericallam

Copy link
Copy Markdown
Member

Summary

Follow-up to #4738. Splits the dashboard agent's base URL into two: the instance that hosts the agent project (used for sessions), and the instance the agent acts against as the user (used by its read-tools). #4738 only needed the first, but moved the second along with it, which breaks the tools when the agent runs on a different instance than the webapp.

Root cause

The agent's read-tools call the API as the logged-in user via a delegated user-actor token. The webapp signs that token with its own SESSION_SECRET, scoped to its own userId and environmentId, so it can only be verified by, and only resolves the user's data on, that same instance. #4738 routed the injected apiOrigin those tools use to the agent's host instance, so the token no longer verifies and the data isn't there.

Fix

dashboardAgentApiOrigin() stays the agent's host instance (sessions, task triggers, realtime, the in forward). A new dashboardAgentUserApiOrigin() returns the webapp's own origin (API_ORIGIN ?? APP_ORIGIN) and is injected into the run metadata the tools use. Same-instance deployments resolve both to the same host, so behavior is unchanged there.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a125926

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The change adds a user API origin helper with an APP_ORIGIN fallback. Dashboard agent routes use this origin in generated message metadata. Watch investigation and watch scheduling services use it in action and task payloads. Stream clients and Trigger client base URLs continue to use the existing agent API origin.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the issue and fix, but it omits the template's issue reference, checklist, testing, changelog, and screenshots sections. Add the required issue reference, checklist, testing steps, changelog entry, and screenshots section, or mark them as not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 and concisely identifies the main fix: routing dashboard agent tool calls to the user's instance.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dashboard-agent-tools-origin-tri-13390

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
apps/webapp/app/services/dashboardAgent.server.ts (1)

53-55: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Apply the crumb guideline to each new origin-propagation block.

  • apps/webapp/app/services/dashboardAgent.server.ts#L53-L55: Add a crumb marker to dashboardAgentUserApiOrigin.
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts#L96-L96: Mark user-origin resolution.
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts#L172-L172: Mark metadata propagation.
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts#L348-L348: Mark head-start metadata propagation.
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts#L61-L70: Mark investigation metadata construction.
  • apps/webapp/app/services/dashboardAgentWatches.server.ts#L1047-L1052: Mark scheduled tick payload construction.
  • apps/webapp/app/services/dashboardAgentWatches.server.ts#L1143-L1155: Mark batch tick payload construction.
  • apps/webapp/app/services/dashboardAgentWatches.server.ts#L1179-L1188: Mark delivery payload construction.

As per coding guidelines, **/*: Add crumbs as you write code — not just when debugging.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a705cc5-ec8e-40f2-9cf2-1ec192ed8bad

📥 Commits

Reviewing files that changed from the base of the PR and between 56f8756 and 1a77ccd.

📒 Files selected for processing (5)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📜 Review details
⏰ Context from checks skipped due to timeout. (33)
  • GitHub Check: report
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (16, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (20, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (13, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (24, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (15, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (19, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (21, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (17, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (22, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (23, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (18, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (14, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 24)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (1, 2)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (2, 2)
  • GitHub Check: runops-guard / runops-guard
  • GitHub Check: typecheck / typecheck
  • GitHub Check: fk-cascade-guard / fk-cascade-guard
  • GitHub Check: obsmap / 🧪 Unit Tests: Observability Map
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Prefer static imports over dynamic imports. Only use dynamic import() when:

  • Circular dependencies cannot be resolved otherwise
  • Code splitting is genuinely needed for performance
  • The module must be loaded conditionally at runtime

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: Access environment variables through the env export of env.server.ts instead of directly accessing process.env
Use subpath exports from @trigger.dev/core package instead of importing from the root @trigger.dev/core path

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
apps/webapp/app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

apps/webapp/app/**/*.{ts,tsx}: For dashboard changes, visually verify the running Remix app with Chrome DevTools MCP, using snapshots, screenshots, interaction, and console-message checks as appropriate.
Use useCallback and useMemo only for context provider values, expensive derived data used as a dependency, or stable references required by dependency arrays; do not wrap ordinary event handlers or trivial computations.
Use named constants for sentinel or placeholder values instead of scattering raw string literals across comparisons.

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
apps/webapp/app/routes/**/*.ts

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

apps/webapp/app/routes/**/*.ts: Use Remix flat-file route conventions with dot-separated segments; for example, api.v1.tasks.$taskId.trigger.ts maps to /api/v1/tasks/:taskId/trigger.
PAT-authenticated API routes must resolve their target organization or project within the caller's membership scope, using a membership filter or a helper such as findProjectByRef or resolveOrganizationForApiUser; RBAC authorization alone is insufficient.

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
apps/webapp/app/**/*.ts

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

apps/webapp/app/**/*.ts: Never use request.signal to detect client disconnects. Use getRequestAbortSignal() from app/services/httpAsyncStorage.server.ts, which is wired to Express response close events.
Access environment variables through the env export from app/env.server.ts; never use process.env directly.
Always use Prisma findFirst instead of findUnique.
Always use the $transaction helper from ~/db.server, never call prisma.$transaction or $replica.$transaction directly. Pass isolation levels as strings, use Serializable for correctness-critical read-then-write invariants, and guard possibly undefined helper results when a definite value is required.

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Add crumbs as you write code — not just when debugging. Mark lines with
// @Crumbs or wrap blocks in `// `#region` `@crumbs. They stay on the
branch throughout development and are stripped by agentcrumbs strip
before merge.
Do not invent new namespaces — pick from this table or ask first.
Do not flag // @Crumbs markers, `#region `@crumbs blocks, or agentcrumbs
imports in reviews. These are temporary debug instrumentation stripped
before merge. Data logged in crumbs (IDs, names, values) never reaches
production.

Files:

  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts
  • apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts
  • apps/webapp/app/services/dashboardAgent.server.ts
  • apps/webapp/app/services/dashboardAgentWatches.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts
🔇 Additional comments (5)
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.in.$.ts (2)

15-15: LGTM!


172-172: 🗄️ Data Integrity & Integration

No change required. apiOrigin correctly uses the user-facing origin for delegated metadata, watch checks, and callbacks. TriggerClient and ApiClient retain the agent origin.

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboard-agent.ts (1)

45-45: LGTM!

apps/webapp/app/services/dashboardAgentWatchInvestigate.server.ts (1)

13-13: LGTM!

apps/webapp/app/services/dashboardAgentWatches.server.ts (1)

59-59: LGTM!

…ance

Follow-up to #4738. That change routed the agent's session (start, token,
transport, realtime) to a configurable instance, but it also moved the origin
the agent's read-tools call back to. Those tools act as the user with a
delegated token this webapp signs with its own SESSION_SECRET, scoped to its own
user and environment, so the token can only be verified by, and the data only
found on, that same instance.

Split the two origins. dashboardAgentApiOrigin() stays the instance hosting the
agent project (sessions, task triggers, realtime, the in forward). A new
dashboardAgentUserApiOrigin() returns this webapp's own origin and is injected
into the run metadata the tools use. When the agent runs on the same instance as
the webapp both resolve to the same host, so nothing changes there.
@ericallam
ericallam force-pushed the fix/dashboard-agent-tools-origin-tri-13390 branch from 1a77ccd to a125926 Compare August 20, 2026 14:15
@ericallam
ericallam marked this pull request as ready for review August 20, 2026 14:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b9c5a693-36ba-46fc-98e6-acd34fdf0e1a

📥 Commits

Reviewing files that changed from the base of the PR and between 1a77ccd and a125926.

📒 Files selected for processing (5)
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📜 Review details
⏰ Context from checks skipped due to timeout. (33)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (19, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (18, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (17, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (21, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (22, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (23, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (24, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (20, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (13, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (15, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (16, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (14, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 24)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 24)
  • GitHub Check: fk-cascade-guard / fk-cascade-guard
  • GitHub Check: obsmap / 🧪 Unit Tests: Observability Map
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (1, 2)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp (2, 2)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: runops-guard / runops-guard
  • GitHub Check: report
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Prefer static imports over dynamic imports. Only use dynamic import() when:

  • Circular dependencies cannot be resolved otherwise
  • Code splitting is genuinely needed for performance
  • The module must be loaded conditionally at runtime

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use function declarations instead of default exports

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use vitest for all tests in the Trigger.dev repository

**/*.{test,spec}.{ts,tsx}: We use vitest exclusively. Never mock anything - use testcontainers instead.
Test files go next to source files (e.g., MyService.ts -> MyService.test.ts).

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: Access environment variables through the env export of env.server.ts instead of directly accessing process.env
Use subpath exports from @trigger.dev/core package instead of importing from the root @trigger.dev/core path

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
apps/webapp/**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

Do not import env.server.ts directly or indirectly into test files; instead pass environment-dependent values through options/parameters to make code testable

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
apps/webapp/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

Test files must not import app/env.server.ts; pass configuration as options instead.

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Add crumbs as you write code — not just when debugging. Mark lines with
// @Crumbs or wrap blocks in `// `#region` `@crumbs. They stay on the
branch throughout development and are stripped by agentcrumbs strip
before merge.
Do not invent new namespaces — pick from this table or ask first.
Do not flag // @Crumbs markers, `#region `@crumbs blocks, or agentcrumbs
imports in reviews. These are temporary debug instrumentation stripped
before merge. Data logged in crumbs (IDs, names, values) never reaches
production.

Files:

  • apps/webapp/test/dashboardAgentForeignChat.test.ts
  • apps/webapp/test/dashboardAgentInProxyMintFailure.test.ts
  • apps/webapp/test/dashboardAgentClientMetadata.test.ts
  • apps/webapp/test/dashboardAgentCreateChatOrdering.test.ts
  • apps/webapp/test/dashboardAgentWatchInvestigate.test.ts

Comment thread apps/webapp/test/dashboardAgentClientMetadata.test.ts

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@ericallam
ericallam enabled auto-merge (squash) August 20, 2026 14:22
@ericallam
ericallam merged commit 9baebbd into main Aug 20, 2026
55 checks passed
@ericallam
ericallam deleted the fix/dashboard-agent-tools-origin-tri-13390 branch August 20, 2026 14:27
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