Skip to content

fix(agent): explicit error when workflow executor URL is not configured#1689

Open
PMerlet wants to merge 1 commit into
mainfrom
fix/workflow-executor-proxy-explicit-error
Open

fix(agent): explicit error when workflow executor URL is not configured#1689
PMerlet wants to merge 1 commit into
mainfrom
fix/workflow-executor-proxy-explicit-error

Conversation

@PMerlet

@PMerlet PMerlet commented Jun 20, 2026

Copy link
Copy Markdown
Member

Problem

When the agent receives a request on the workflow-executor proxy routes
(GET /_internal/workflow-executions/:runId, POST .../trigger) but the
workflowExecutorUrl option is not configured, the route was simply never
mounted. The client got a bare koa 404 with an empty body — indistinguishable
from a real "run not found" coming from the executor, and giving no hint that the
agent is actually misconfigured.

This came up debugging a staging agent where the deploying app didn't pass
workflowExecutorUrl: every workflow request 404'd with no actionable signal in
the browser console or the agent logs.

Change

  • Mount the proxy route unconditionally (routes/index.ts).
  • In the handler, if workflowExecutorUrl is missing, throw an
    InternalServerError with an explicit message
    (The workflow executor is not configured on this agent: the workflowExecutorUrl option is missing.).
    The agent's error-handling middleware turns this into a 500 with a clear
    detail
    for the client (instead of a silent 404), and logs it at Error level.

The constructor now tolerates a null URL instead of throwing at boot.

Tests

  • handleProxy throws an explicit error when workflowExecutorUrl is not set.
  • Constructor does not throw when the option is null.
  • BASE_ROUTE_SIZE updated since the route is always mounted now.
  • Existing proxy-forwarding tests unchanged and passing (21/21).

🤖 Generated with Claude Code

Note

Throw explicit error when workflow executor URL is not configured

  • The workflow executor route in workflow-executor-proxy.ts now accepts a null executorUrl instead of requiring a valid URL at construction time.
  • Routes in index.ts always register the WorkflowExecutorProxyRoute, regardless of whether workflowExecutorUrl is set.
  • When the handler is invoked without a configured URL, it throws an InternalServerError with a descriptive message instead of returning a 404.
  • Behavioral Change: previously, missing workflowExecutorUrl caused the route to be absent (404); now the route exists and returns a 500 with an explicit message.

Macroscope summarized da6e08e.

The /_internal/workflow-executions proxy route was only mounted when
`workflowExecutorUrl` was set, so hitting it on an agent without that option
returned a bare koa 404 with an empty body — indistinguishable from a real
"run not found" and giving the client no hint about the misconfiguration.

Mount the route unconditionally and throw an InternalServerError with an
explicit message when `workflowExecutorUrl` is missing, so the client gets a
clear 500 detail instead of a silent 404.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@qltysh

qltysh Bot commented Jun 20, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

⬆️ Merging this pull request will increase total coverage on main by 0.01%.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
packages/agent/src/routes/workflow/workflow-executor-proxy.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.

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