fix(agent): explicit error when workflow executor URL is not configured#1689
Open
PMerlet wants to merge 1 commit into
Open
fix(agent): explicit error when workflow executor URL is not configured#1689PMerlet wants to merge 1 commit into
PMerlet wants to merge 1 commit into
Conversation
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>
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (1)
🛟 Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
When the agent receives a request on the workflow-executor proxy routes
(
GET /_internal/workflow-executions/:runId,POST .../trigger) but theworkflowExecutorUrloption is not configured, the route was simply nevermounted. 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 inthe browser console or the agent logs.
Change
workflowExecutorUrlis missing, throw anInternalServerErrorwith 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
detailfor the client (instead of a silent 404), and logs it atErrorlevel.The constructor now tolerates a null URL instead of throwing at boot.
Tests
handleProxythrows an explicit error whenworkflowExecutorUrlis not set.BASE_ROUTE_SIZEupdated since the route is always mounted now.🤖 Generated with Claude Code
Note
Throw explicit error when workflow executor URL is not configured
executorUrlinstead of requiring a valid URL at construction time.WorkflowExecutorProxyRoute, regardless of whetherworkflowExecutorUrlis set.InternalServerErrorwith a descriptive message instead of returning a 404.workflowExecutorUrlcaused the route to be absent (404); now the route exists and returns a 500 with an explicit message.Macroscope summarized da6e08e.