Skip to content

Agent service compile requests are rejected with 401 because no auth token is sent #9078

Closed

Description

@sshiv012

What happened?

Root cause: agent-service/src/api/compile-api.ts#compileWorkflowAsync POSTs to ${WORKFLOW_COMPILING_SERVICE_ENDPOINT}/api/compile with only Content-Type. Since #5199 / #5404, WorkflowCompilationResource (@RolesAllowed(REGULAR, ADMIN)) sits behind JwtAuthFilter, which returns 401 when no Bearer token is present. The agent client (added in #4495) was never updated.

Before:  agent prepareStep -> POST /api/compile (no Authorization) -> 401 -> null -> agent sees no schemas / compile errors
After:   agent prepareStep -> POST /api/compile (Bearer <delegate token>) -> 200 -> schemas + operatorErrors in context

The failure is silent: it is logged as compilation failed and the agent proceeds without output schemas.

Expected: the compile call forwards the delegating user's token, the same way workflow-api.ts (createAuthHeaders) and the execution tool already do.

Audit of the other agent-service HTTP calls:

Call Auth sent Needs auth
/api/compile (compile-api.ts) no yes
/api/workflow/persist, /api/workflow/{wid} (workflow-api.ts) yes yes
workflow execution (workflow-execution-tools.ts) yes yes
/api/resources/operator-metadata (backend-api.ts) no no (unannotated, public)

How to reproduce?

  1. Deploy main with agent-service and workflow-compiling-service.
  2. Start an agent on a workflow with at least one operator and send a message.
  3. agent-service logs CompileAPI ... status 401 ... compilation failed on every step.

Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

3ba45ee

Relevant log output

{"module":"CompileAPI","status":401,"statusText":"Unauthorized","msg":"compilation failed"}

Activity

  1. sshiv012 commented on Oct 21, 2026

    @sshiv012
    ContributorAuthor

    /take

  2. added a commit that references this issue on Oct 21, 2026
    3fbc9ec
  3. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

    👋 Thanks for opening this issue, @sshiv012!

    It looks like the issue description doesn't quite follow our template yet:

    • This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.

    Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.

    You can find the template prompts by editing the description, or see CONTRIBUTING.md for the full contribution flow.

  4. added a commit that references this issue on Nov 2, 2026
    07fffb3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions