ToolsExplorer is unable to handle Redirect to URL

Created on 7 July 2025, 16 days ago

Problem/Motivation

In the AI Tools Explorer, the description of the Drupal Core Actions Β» Redirect to URL reads: URL (e.g. /node/123 or https://example.com). But testing the tool with one of those patterns leads to the Β«Oops, something went wrong. Check your browser's developer console for more details.Β»

Of all the DCAs handled by the Tools Explorer, Redirect to URL is the only one that isn't of type entity reference. The key insight is that the GotoAction is fundamentally different from all the other actions - it expects actual URLs, not entity references.

Looks like the GotoAction is actually working. It's successfully redirecting to /node/1, but the AJAX handler doesn't know how to handle a redirect response, so it's treating it as an error.

Proposed resolution

The issue is that the GotoAction tries to create a redirect response during AJAX, which breaks the expected response format. Let's just prevent the redirect from happening in the Tools Explorer context.

Remaining tasks

Create an issue fork and provide the fix.

πŸ› Bug report
Status

Active

Version

1.2

Component

AI API Explorer

Created by

πŸ‡¨πŸ‡¦Canada bisonbleu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bisonbleu
  • Pipeline finished with Success
    16 days ago
    Total: 308s
    #541334
  • Pipeline finished with Success
    16 days ago
    Total: 189s
    #541382
  • πŸ‡©πŸ‡ͺGermany marcus_johansson

    That logic should imho not be in the tool explorer or be a solution that actions solves - and if the url action doesn't work well, we should remove it and create an actual function call for it.

    We can't have conditionals for specific actions, outside of the ActionPluginDeriver, and even there we should have very little logic. Its also unclear if the goto action actually would work together with an agent, since the trigger is an API request. We should rather build a way for function calls to interact via JS.

    So, I will close this, because the function call actions is not the solution to this problem from practical point of view, but also security point of view. I'm sorry about you did put work into this and it did not make it into the code, but this would just be a small band-aid trying to solve a huge gash.

  • πŸ‡¨πŸ‡¦Canada bisonbleu

    NP, c'est la vie. Thank you @Marcus for taking the time to explain. You expose intricate & implicit details that I could only partially fathom. Now I better understand. Moving on… : )

  • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    unassigning

Production build 0.71.5 2024