Skip to content

[v26.1.x] rpk/ai: don't require a cloud cluster to run the ai plugin - #31079

Merged
birdayz merged 1 commit into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30990-v26.1.x-353
Jul 13, 2026
Merged

[v26.1.x] rpk/ai: don't require a cloud cluster to run the ai plugin#31079
birdayz merged 1 commit into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30990-v26.1.x-353

Conversation

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

Backport of PR #30990

`rpk ai <cmd>` died with

    unable to prepare rpk ai invocation: no cluster selected for this
    rpk profile; run 'rpk cloud cluster use <id>' or pass --rpai-endpoint

whenever no rpk cloud cluster was selected. Before exec'ing the plugin,
the managed-plugin hook resolved the AI Gateway endpoint from the
selected cloud cluster and injected it (plus the cached cloud token) as
RPAI_ENDPOINT / RPAI_TOKEN, and hard-failed when there was no cluster to
resolve from.

That injection is dead weight. The rpk ai plugin is self-contained: it
has its own login (`rpk ai auth login`) and its own environment
selection (`rpk ai env use`), and in plugin mode it deliberately ignores
an ambient RPAI_ENDPOINT and RPAI_TOKEN. So rpk was computing two values
the plugin throws away; the only observable effect left was a gate that
blocked the plugin from ever starting without a selected cluster --
including `rpk ai auth login`, the one command whose whole job is to
establish that context in the first place.

The gate also fired inconsistently (it depended on which dispatch path a
given invocation took), which is why it reproduced for some users and
not others.

Drop the injection entirely. rpk now only strips its own global flags
and execs the plugin, which owns auth and endpoint selection end to end.

(cherry picked from commit 6308e16)
@vbotbuildovich vbotbuildovich added this to the v26.1.x-next milestone Jul 13, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jul 13, 2026
@vbotbuildovich
vbotbuildovich requested review from a team and kbatuigas as code owners July 13, 2026 17:19
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jul 13, 2026
@vbotbuildovich
vbotbuildovich requested a review from birdayz July 13, 2026 17:19
@birdayz
birdayz enabled auto-merge July 13, 2026 17:31
@r-vasquez r-vasquez modified the milestones: v26.1.x-next, v26.1.13 Jul 13, 2026
@birdayz
birdayz merged commit 194ff0e into redpanda-data:v26.1.x Jul 13, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build area/rpk kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants