Skip to content

feat(platform): per-step error feedback in the automation test panel#1870

Merged
yannickmonney merged 1 commit into
mainfrom
feat/automation-tester-step-error-feedback
Jun 11, 2026
Merged

feat(platform): per-step error feedback in the automation test panel#1870
yannickmonney merged 1 commit into
mainfrom
feat/automation-tester-step-error-feedback

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Closes #1484. Built on #1487 (merged in #1868) — consumes its getExecutionStepStatuses query without redefining it. Originally stacked on feat/workflow-node-execution-status; rebased onto main after #1868 merged.

What / why

Run-level error persistence (bug fix). No failure path ever wrote wfExecutions.error — every path serialized the error into the metadata JSON string, and failExecution replaced that string wholesale, destroying componentWorkflowIds (the step journal's primary id list) and never setting completedAt (failed runs had no duration). The four chokepoints now write top-level error, merge metadata via a shared mergeExecutionMetadata helper, stamp completedAt, and record a coarse errorCode:

  • failExecution → caller-supplied code (step_failure from the engine callback and the next-step pre-mark, start_failure from startWorkflowFromFileConfig)
  • updateExecutionStatus → top-level error + metadata merge, completedAt for failed (not only completed), canceled code from the canceled engine outcome
  • stuck-recovery watchdog → timeout
  • cancelExecutioncanceled

getExecutionStatus and getExecutionStepStatuses now expose errorCode. The schema field is a plain optional string (adding codes never needs a migration); writers are typed to the ExecutionErrorCode union and internal-mutation args validate against a literal union.

Test panel per-step feedback. The tester subscribes to #1487's getExecutionStepStatuses and renders a live step list in the result card: status icon per step (icon/color conventions shared with the canvas badges, extracted to execution-status-icons.ts), an attempts counter for retried/looped steps, and the failing step's error inline. The failing step's name deep-links to its editor through the existing panel/step URL state. Runs that fail with no failed journal step (never started, timed out, canceled) fall back to the run-level error plus a translated reason line.

Server-side input preflight (test runs only). startWorkflowFromFile validates the tester's input against the start node's inputSchema via the existing validateWorkflowInput, throwing field-specific messages (Missing required parameter: 'x', type mismatches) before an execution record is created; the tester's existing catch surfaces them in the toast. Client-side gating from #1792 remains the first line.

Decision-gate recommendations baked in

Notes for review:

  • invalid_input is reserved in the code union: the preflight rejects before an execution record exists, so it is never persisted today.
  • Metadata merge is additive — executions-table.tsx renders parsed metadata verbatim and no consumer relies on replacement.
  • One lock-in test updated intentionally: execution_lifecycle.test.ts asserted completedAt stays unset on failed; that was the bug.

Verification

Performed:

  • bun run check at repo root (format, lint, typecheck, all tests) — pass, re-run after the rebase onto main.
  • Targeted: fail_execution.test.ts (new failExecution coverage incl. metadata merge preserving componentWorkflowIds), new update_execution_status.test.ts, new preflight_test_run_input.test.ts, recover_stuck_executions.test.ts, get_execution_step_statuses.test.ts, full app/features/automations UI suite (21 files) incl. extended automation-tester.test.tsx (step rows in start order, failing-row deep link, attempts counter, run-level fallback, a11y).
  • bun run --filter @tale/docs lint + test (locale parity) — pass.

Manual verification required (not performed here — needs the local dev stack):

  • Run a workflow with a required typed input from the test panel: wrong type → server preflight message in the toast; mid-workflow failure → step list shows the failing step with its journal error and the row click opens that step's editor; Executions tab row shows error/duration on the failed run.

Pre-PR checklist

  • Ran bun run check (format, lint, typecheck, all tests).
  • No hand-rolled skeletons — N/A (no loading states added).
  • Updated services/platform/messages/{en,de,fr}.json.
  • Updated /docs/{en,de,fr}/ (workflows.md test-panel section).
  • Touched docs page has a real opening and closing (existing page, paragraph added mid-page; docs tests pass).
  • Ran bun run --filter @tale/docs lint and bun run --filter @tale/docs test.
  • README updates — N/A.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@yannickmonney, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 27 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1a024e79-73a9-405f-b341-b3606dbf7d6b

📥 Commits

Reviewing files that changed from the base of the PR and between 90b9961 and 94408f8.

⛔ Files ignored due to path filters (1)
  • services/platform/convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing (29)
  • docs/de/platform/automations/workflows.md
  • docs/en/platform/automations/workflows.md
  • docs/fr/platform/automations/workflows.md
  • services/platform/app/features/automations/components/automation-tester.test.tsx
  • services/platform/app/features/automations/components/automation-tester.tsx
  • services/platform/app/features/automations/components/node-execution-status-badge.tsx
  • services/platform/app/features/automations/utils/execution-status-icons.ts
  • services/platform/convex/wf_executions/internal_mutations.ts
  • services/platform/convex/wf_executions/mutations.ts
  • services/platform/convex/wf_executions/queries.ts
  • services/platform/convex/workflow_engine/execution_lifecycle.test.ts
  • services/platform/convex/workflow_engine/helpers/engine/dynamic_workflow_handler.ts
  • services/platform/convex/workflow_engine/helpers/engine/on_workflow_complete.ts
  • services/platform/convex/workflow_engine/helpers/engine/start_workflow_from_file.ts
  • services/platform/convex/workflow_engine/helpers/recovery/recover_stuck_executions.ts
  • services/platform/convex/workflow_engine/helpers/validation/preflight_test_run_input.test.ts
  • services/platform/convex/workflow_engine/helpers/validation/preflight_test_run_input.ts
  • services/platform/convex/workflows/executions/fail_execution.test.ts
  • services/platform/convex/workflows/executions/fail_execution.ts
  • services/platform/convex/workflows/executions/get_execution_step_statuses.ts
  • services/platform/convex/workflows/executions/types.ts
  • services/platform/convex/workflows/executions/update_execution_metadata.ts
  • services/platform/convex/workflows/executions/update_execution_status.test.ts
  • services/platform/convex/workflows/executions/update_execution_status.ts
  • services/platform/convex/workflows/executions/validators.ts
  • services/platform/convex/workflows/schema.ts
  • services/platform/messages/de.json
  • services/platform/messages/en.json
  • services/platform/messages/fr.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/automation-tester-step-error-feedback

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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 and usage tips.

Fix run-level error persistence first: no failure path ever wrote
wfExecutions.error — failExecution serialized the error into metadata
and replaced the JSON wholesale (destroying componentWorkflowIds, the
step journal's id list) and never set completedAt. All four failure
chokepoints (failExecution, updateExecutionStatus, the stuck-recovery
watchdog, user cancel) now write the top-level error, merge metadata
instead of clobbering it, stamp completedAt, and record a coarse
errorCode (start_failure / step_failure / timeout / canceled /
invalid_input) surfaced by getExecutionStatus.

On top of #1487's getExecutionStepStatuses query the tester renders a
live step list: per-step status icon, an attempts counter for retried
and looped steps (collapsed to the latest attempt), and the failing
step's error inline — its name deep-links to that step's editor via
the existing panel/step URL state. Runs that fail without a failed
journal step (never started, timed out, canceled) fall back to the
run-level error plus a translated reason. Test runs are additionally
preflighted server-side against the start node's inputSchema
(validateWorkflowInput), rejecting missing or mistyped fields with
field-specific messages before an execution record exists; production
trigger paths stay unenforced.
@yannickmonney yannickmonney force-pushed the feat/automation-tester-step-error-feedback branch from 9ed77c4 to 94408f8 Compare June 11, 2026 07:56
@yannickmonney yannickmonney merged commit ba8a088 into main Jun 11, 2026
30 checks passed
@yannickmonney yannickmonney deleted the feat/automation-tester-step-error-feedback branch June 11, 2026 08:14
yannickmonney added a commit that referenced this pull request Jun 11, 2026
…tion

Two fixes to e2e/specs/automation.spec.ts:

- Scope the completion assertion to the tester side panel
  (role=complementary, labelled "Test automation"). After PRs #1868/#1870
  the canvas now renders a "viewing run" role=status banner whose "Completed"
  label collides with the tester result's, making a bare getByRole('status')
  a strict-mode violation (2 elements). The banner lives on the canvas,
  outside the panel, so the complementary scope is unambiguous.

- Make reaching the editor idempotent across retries. The first attempt
  installs the `test` template, which removes it from the "From template"
  picker; a retry that still went through the install flow hung on a missing
  button. Now: if `test` is already installed, open its list row directly;
  otherwise install via template. Wait for the table to settle (row or empty
  state) before the branch so a mid-load read can't wrongly pick install.
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.

Bug: No Clear Error Feedback in Test Panel

1 participant