Skip to content

feat(workflow-executor): add FORCE_AI_ERROR dev mode#1593

Merged
Scra3 merged 8 commits into
feat/prd-214-server-step-mapperfrom
feat/force-ai-error-dev-mode
May 26, 2026
Merged

feat(workflow-executor): add FORCE_AI_ERROR dev mode#1593
Scra3 merged 8 commits into
feat/prd-214-server-step-mapperfrom
feat/force-ai-error-dev-mode

Conversation

@Scra3
Copy link
Copy Markdown
Member

@Scra3 Scra3 commented May 25, 2026

Summary

  • Adds AlwaysErrorAiModelPort adapter that makes every AI call fail immediately
  • Wired via FORCE_AI_ERROR=true env var (parsed in cli-core.ts, passed as forceAiError option)
  • Adds start:with-executor:ai-error script in packages/_example for one-command local testing

Usage

# in packages/_example
yarn start:with-executor:ai-error

Or manually:

FORCE_AI_ERROR=true tsx watch ../workflow-executor/src/cli.ts --pretty

Every AI-dependent step returns status: error with "The AI service is unavailable." — lets you exercise all executionType error paths without a real AI service.

🤖 Generated with Claude Code

Note

Add FORCE_AI_ERROR dev mode to workflow-executor to force AI call failures

  • Adds AlwaysErrorAiModelPort in always-error-ai-model-port.ts, an AiModelPort implementation whose invoke() always rejects with AiModelPortError.
  • Setting FORCE_AI_ERROR=true activates this adapter via buildCommonDependencies in build-workflow-executor.ts; the flag is silently ignored in production.
  • Startup logs and CLI help text in cli-core.ts reflect forced-error mode when active.
  • Behavioral Change: only available outside NODE_ENV=production; in production the flag is ignored and normal AI adapter selection applies.

Macroscope summarized fd00427.

@Scra3 Scra3 changed the base branch from fix/execution-type to feat/prd-214-server-step-mapper May 25, 2026 10:35
@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 25, 2026

All good ✅

@Scra3 Scra3 force-pushed the feat/force-ai-error-dev-mode branch 2 times, most recently from 06cd386 to cdc58b4 Compare May 25, 2026 10:38
Comment thread packages/workflow-executor/src/build-workflow-executor.ts Outdated
@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 25, 2026

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (3)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
packages/workflow-executor/src/build-workflow-executor.ts100.0%
Coverage rating: A Coverage rating: A
packages/workflow-executor/src/cli-core.ts100.0%
New Coverage rating: A
...s/workflow-executor/src/adapters/always-error-ai-model-port.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

alban bertolini and others added 8 commits May 26, 2026 10:50
…rror paths locally

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…NV=production)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…oduction guard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… diff

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dev mode

- Fix env var name in always-error-ai-model-port comment (WORKFLOW_EXECUTOR_FORCE_AI_ERROR → FORCE_AI_ERROR)
- Restore _config parameter on loadRemoteTools to match AiModelPort interface
- Log when production guard silently ignores forceAiError=true
- Update logStartup to show 'forced-error (dev only)' as aiConfig when forceAiError is active
- Strengthen build-workflow-executor tests: assert mutual exclusion of adapters
- Add cli test for FORCE_AI_ERROR='false' (must not activate forceAiError)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er logStartup branches

- Revert accidental mcpServerId → sourceId regression from #1583 (RemoteTool exposes
  sourceId, not mcpServerId; the TS error blocked the build-workflow-executor test suite)
- Add logStartup tests for forceAiError and aiConfigurations branches to reach coverage threshold

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s (regression from merge)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Scra3 Scra3 force-pushed the feat/force-ai-error-dev-mode branch from 73a2af7 to fd00427 Compare May 26, 2026 08:52
@Scra3 Scra3 merged commit 5d540f3 into feat/prd-214-server-step-mapper May 26, 2026
30 checks passed
@Scra3 Scra3 deleted the feat/force-ai-error-dev-mode branch May 26, 2026 09:00
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