Repository navigation
fix(tools): name the renamed integration token when it is missing - #8636
Conversation
After #7990 stopped reading CREWAI_PLATFORM_INTEGRATION_TOKEN, projects that still set it got "No Enterprise Action Auth Token found", which reads as if no token was configured. Agents then warned only that their apps resolved to no tools, without the reason, since the error was logged at verbose level. The token lookup now says the old variable is set and must be renamed, and the agent's no-tools warning ends with the resolution error as its cause. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Strix Security Review✅ No open security findings. PR summary: This PR improves the error and warning text emitted when the CrewAI Enterprise Action Auth Token is missing: it names the legacy `CREWAI_PLATFORM_INTEGRATION_TOKEN` variable that projects still set, and appends the underlying resolution error to the agent's "apps resolved to no tools" warning. Review summaryThe change is limited to two diagnostics paths: the platform-token lookup in Ruled out (2)
Review 1 on this PR · Reviewed by Strix |
alex-clawd
left a comment
There was a problem hiding this comment.
Approving. Small, well-scoped, and it fixes a genuinely bad failure mode.
The bug worth fixing
After #7990 the old variable stopped being read, so a project that still set CREWAI_PLATFORM_INTEGRATION_TOKEN got "No Enterprise Action Auth Token found" — which tells the user the opposite of what is true. They had configured a token; it was just under the old name. That is the kind of message that costs someone an afternoon.
The second half is the part I like more. The real error was going to self._logger.log("error", ...), which is verbose-gated, so by default the user saw only:
Agent 'X' declares apps [gmail] but none resolved to any tools
with no cause at all. Appending Cause: <error> to the warning means the actual reason travels with the symptom. Generic improvement, not specific to this rename — any future resolution failure (API 503, bad app name) now surfaces too, which the second test covers explicitly.
Checks I made
No token values leak into the new message. The Cause: suffix forwards whatever CrewaiPlatformTools raised, so I read every raise site in crewai_platform_tools/. All of them name variables or selectors; none interpolate a token value. The new ValueError names CREWAI_PLATFORM_INTEGRATION_TOKEN and CREWAI_ENTERPRISE_ACTION_AUTH_TOKEN as names, never their contents. Worth confirming given this message now reaches stderr by default where the old one did not.
No silent fallback. The new branch only fires when the new variable is empty and the old one is set, and it raises rather than reading the old value. #7990's intent holds — the error is a signpost, not a compatibility shim. The Remove in 2.0 comment is on the branch itself, which is where someone will actually see it.
Precedence is pinned by a test. test_clipper_client_ignores_the_old_token_when_the_new_one_is_set asserts the Authorization header carries new_token when both are set. Easy case to get backwards, good to have locked.
cause = "" default. test_get_platform_tools_warning_has_no_cause_without_an_error covers the case where resolution returns empty without raising, so the warning does not grow a dangling Cause:. Small detail, but it is the one that would look sloppy in the common "app name typo" path.
One thing I appreciated in the description
Out:
crewai.context.get_platform_integration_token(MCP, skills, tracing grants) still returnsNonesilently when only the old variable is set. That needs a follow-up ticket.
That is the same class of bug, still live on a different path, and it is named rather than quietly left. Worth actually filing — a user who renames the variable because of this error message will fix action discovery and still hit silent None on MCP and tracing grants, which is a confusing second trip.
Unlike #8622 and #8623, the description here matches the code exactly, including the scope limits. All 26 checks green.
A project created before #7990 sets only CREWAI_PLATFORM_INTEGRATION_TOKEN, which crews no longer read. doctor said CREWAI_ENTERPRISE_ACTION_AUTH_TOKEN was not set, the misleading message #8636 removed from the integrations client. It now gives the same rename instruction the crew's error does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
After #7990, CrewAI reads the Enterprise Action Auth Token only from
CREWAI_ENTERPRISE_ACTION_AUTH_TOKEN. Projects that still setCREWAI_PLATFORM_INTEGRATION_TOKENgot "No Enterprise Action Auth Token found", which reads as if no token was configured. An agent withappsthen warned only that they "resolved to no tools", because the real error was logged at verbose level. Now the error says the old variable is set and needs renaming, and the agent's warning ends withCause: <the error>.crewai_tools(used for action discovery and execution) and the warning fromAgent.get_platform_tools.crewai.context.get_platform_integration_token(MCP, skills, tracing grants) still returnsNonesilently when only the old variable is set. That needs a follow-up ticket.🤖 Generated with Claude Code
Note
Low Risk
User-facing error and warning text only; auth still reads CREWAI_ENTERPRISE_ACTION_AUTH_TOKEN with no legacy fallback.
Overview
Improves diagnostics after the enterprise auth env var rename (#7990): users who still set
CREWAI_PLATFORM_INTEGRATION_TOKENalone no longer see a generic “token missing” error.get_platform_integration_tokenin crewai-tools now raises aValueErrorthat names the old variable and instructs renaming it toCREWAI_ENTERPRISE_ACTION_AUTH_TOKEN(same value; no read of the legacy name).Agent.get_platform_toolsappendsCause: <exception>to the existingUserWarningwhen platform tool resolution fails, so rename/API errors surface without verbose logging.Tests cover the rename message, precedence when both vars are set, and warning cause behavior (including no
Cause:when resolution returns empty without an error).Reviewed by Cursor Bugbot for commit 651885e. Bugbot is set up for automated code reviews on this repo. Configure here.