mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-11-24 22:48:22 +08:00
feat/cli-deploy-test
184
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4f55ea22b8 |
fix(cli): exit 1 and print raw results in crewai deploy test
Logged out or outside a project now exits 1 instead of 0. The run's result is printed with click.echo so a pipe gets it unwrapped and unconverted. Status reads use a 30 s read timeout, a non-JSON status body is reported as such, and the failed-read limit is renamed to what it counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
374ee68ee6 |
feat(cli): add crewai deploy test to run a deployment once
`crewai deploy test [-u UUID] [--inputs JSON] [--timeout SECONDS]` starts one run of the project's deployment through AMP API v1 with the CLI login, polls its status every 3 s, prints the result, and exits 0 only when the run succeeds. A refusal, a failed, stopped, paused or unknown state, three failed status reads in a row, or the timeout each exit 1 with the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
a71ff1f245 |
fix(cli): keep deeply nested json as text in the run tui on python 3.12 (#8696)
Python 3.12's C json decoder accepts nesting that its pure-Python indent encoder cannot walk (3.10/3.11 refuse it on load; 3.13 encodes indent in C). _try_parse_structured returned such a structure from json.loads, and _format_json_in_text then raised RecursionError from json.dumps inside the render tick. The json.loads result is now checked with the same dumps call the ast fallback already uses, so the text stays as it was. test_format_json_in_text_survives_deep_nesting failed on 3.12 only, and never in CI because the lib/cli suite did not run there until #8603. A new test reproduces the decoder/encoder mismatch on every version. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
cf8af65d10 |
test(cli): stop the memory-save drain and consent tests failing under load (#8612)
* test(cli): make the memory-save drain and consent tests deterministic under load wait_for_consent accepted a pushed TraceConsentScreen before compose ran: the screen had no buttons yet and all() of none is True, so query_one raised NoMatches. It now also requires the buttons to exist. The two memory-save drain tests asserted "still subscribed" after a pilot.pause() that, on a loaded machine, outlasted the 50ms grace, and then expected the unsubscribe within a fixed 80ms. They now assert right after the completion emit (the loop has not run, so only a synchronous unsubscribe from the handler shows), poll for the unsubscribe with a 5s cap, and assert a lower bound on the wait: a timer can be late, never early. The queued-events test also no longer yields between crew done and the completion, so the crew-done drain timer cannot expire in the same loop step the test resumes in and unsubscribe before the re-arm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(cli): widen the drain poll cap and early-timer margin The unsubscribe poll gave up after 5s, and a stalled loop on a loaded machine was seen holding a single pause for over 12s, so it now waits up to 30s (under the suite's --timeout=60; the cap costs only on failure). Textual's timer can fire about 0.5ms early, so the lower bound is 0.045s instead of the exact 0.05s grace; a 1ms grace still fails both tests. The queued-events comment now names the stale crew-done drain timer as a product race rather than test timing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
af9b35c446 |
fix(cli): let the json crew runner load against an older crewai-core (#8605)
* fix(cli): let the json crew runner load against an older crewai-core The JSON crew runner execs the installed CLI's crewai_cli package inside the project's environment. crewai_cli.utils imported get_or_create_project_id and get_project_id from crewai_core.project at module load, and crewai-core 1.15.0-1.15.10 lack both, so a project locked to those versions failed with ImportError before the crew started (regressed in #6791). The two names are now thin functions in crewai_cli.utils that import from crewai-core on call. Names, signatures, __all__ and every caller's patch target are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(cli): mirror the old-core json runner guard into the ci suite lib/cli/tests is not run by CI, so the only test that catches a module-level import of a newer crewai-core symbol on the JSON runner path never ran there; that is how #6791 regressed it. Mirror the guard into lib/crewai/tests/cli, and drop two project-id tests that re-tested crewai-core behaviour already covered by lib/crewai/tests/telemetry/test_project_id.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(cli): import crewai_cli.run_crew one way in the mirrored runner test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
e9efcde016 | feat: bump versions to 1.15.32 (#8691) | ||
|
|
2733f8ee62 | feat: bump versions to 1.15.31 (#8683) | ||
|
|
ed0abf25b3 |
fix(security): patch deserialization, SQL injection, and path traversal vulnerabilities [SECT-601] (#8623)
* fix(security): patch deserialization, SQL injection, and path traversal vulnerabilities Fixes three security issues reported in SR-2026-0127 / GHSA-wp6h-6xxh-g8fp: 1. Deserialization bypass: _resolve_tool_dict() now requires CREWAI_DESERIALIZE_CALLBACKS=1 for unregistered tool types, and stops pre-resolving cache_function strings that bypassed the env-var guard. 2. NL2SQL read-only bypass: SQL comment stripping prevents comment-based injection that could hide write commands from the read-only validator. 3. Tar extraction TOCTOU: Member-by-member extraction with post-creation symlink target verification eliminates race conditions in archive unpacking. Linear: SECT-601 * fix(security): keep tool restore working behind the deserialization gate The gate on unregistered tool types also refused crewai's own tools when a checkpoint was resumed in a fresh process, refused tools declared as dicts in JSON project files, and, with the cache_function pre-resolution removed, refused the default cache function on every serialized tool. - crewai. and crewai_tools. tool types import without the opt-in. Any import now only registers classes, so a target that is not a BaseTool subclass is refused even with CREWAI_DESERIALIZE_CALLBACKS=1. - The default cache_function path restores without importing anything; any other path still goes through SerializableCallable's gate. - The JSON loader resolves dict tool_type through its trusted class-ref path, as it already does for "module:Class" strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(security): normalize nl2sql comments once and keep mysql executable comments Comment stripping ran in three helpers but not in the EXPLAIN resolver or the CTE matcher, so a comment after EXPLAIN or between AS and "(" still hid a write. It also deleted MySQL/MariaDB executable comments, whose contents the server runs, so "/*!50000 DROP TABLE t */ SELECT 1" passed as SELECT. Each statement is now normalized once, where validation and the commit decision start, so every check reads the same text. Comments become a space, since DELETE/**/FROM is a DELETE; executable comments are kept verbatim and fail closed as an unrecognised command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(security): refuse link members in the skill archive fallback The phased extraction still let a dest-relative symlink be followed by a later ".." member, and a hardlink to a dangling symlink member is re-created by tarfile as that symlink at the hardlink's path, after its target was checked against a different directory. The fallback only runs on Pythons without filter="data" (before 3.10.12, 3.11.4, 3.12), so it now refuses symlink and hardlink members outright, with a message naming the versions that handle them, checks every other member's path, and extracts with extractall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(security): refuse commented nl2sql statements in read-only mode Stripping comments only honoured single-quoted literals, so a comment marker inside a double-quoted or backtick identifier or a dollar quote truncated the statement: WITH "a--" AS (SELECT 1) DELETE FROM users was validated as a lone CTE and executed. Any stripper has to match every database's quoting rules, and each mismatch is a bypass. Read-only mode now refuses statements with -- or /* outside single-quoted literals; the scan can only end a literal early, never late, so it errs toward refusing. With allow_dml=True, commented statements are committed as writes. _strip_sql_comments is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(security): refuse nl2sql comment markers anywhere in read-only mode Skipping single-quoted literals let a quote inside an identifier open a fake literal that swallowed a real comment, and MySQL's # comment was not detected: WITH "q'" AS (SELECT 1 --') SELECT 1 / ) DELETE FROM users and WITH a AS (SELECT 1 #) SELECT 1 / ) DELETE FROM users both passed. Read-only mode now refuses -- and /* anywhere, including inside string literals, and # when db_uri is MySQL or MariaDB (on PostgreSQL # is a JSON operator). allow_dml=True keeps committing commented statements as writes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(security): refuse link members in the skill cache tar fallback crewai.skills.cache._safe_extractall is the same fallback the CLI uses, with the link-target validation the CLI copy dropped: a dest-relative symlink can still carry a later member's write outside the cache directory. Apply the same link-refusing version and note that the two copies must change together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Joao Moura <joaomdmoura@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
70efcec62d |
feat: bump versions to 1.15.30 (#8478)
* feat: bump versions to 1.15.30 * fix(deps): raise filelock, pypdf, and setuptools floors for new advisories pip-audit started flagging filelock 3.29.1 (GHSA-v4x8-3wr5-3wq8, GHSA-9vhv-jxww-xfm5, GHSA-567q-5qvw-pf92), pypdf 6.21.1 (GHSA-6c7f-9265-g8fw, GHSA-jr96-gvgh-j3r4, GHSA-gmh7-3g9r-mjh5), and setuptools 83.0.0 (GHSA-xmj3-9gf7-h52w). - pypdf>=6.21.2 in the root overrides and in crewai-files, so published consumers get the fix too; 6.21.2 is inside the 3-day cutoff, so it gets an exclude-newer-package entry. - setuptools>=84.1.0. - filelock>=4.2.1 on Python 3.11+ only (4.2.x drops 3.10); 3.10 stays on 3.x. The override goes past the filelock<4 caps in unstructured and snowflake-connector-python 4.x, which only use FileLock/BaseFileLock/Timeout. Lock regenerated with uv 0.13.4 (CI's version); only these three packages change version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
07361f6dc5 |
fix(cli): AGENTS.md starts the login while evaluating, and stops after three rounds (#8315)
* fix(cli): AGENTS.md starts the login while evaluating, and stops after three rounds "No account is needed to evaluate: don't wait on a login" made logged-out agents treat the login as optional: setting up a project, half of them stopped starting it. Evaluation loops also ran on without reporting. The file now says to start the login hand-off and evaluate without waiting for it, and to stop when the goal gate passes or after three rounds, reporting the first and latest grades with both report links. A guard pins both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): C-011 accepts reporting grades and report links, not only "the brief" Stopping after three rounds and reporting the first and latest grades with both report links is the answer the file now teaches; the key only matched "brief". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
2ce184ba50 | feat: bump versions to 1.15.29 (#8471) | ||
|
|
3b0833f606 |
fix(cli): derive platform integration tokens from login (#8350)
* feat(core): fetch integration token from AMP * feat(cli): fetch integration token from saved login * feat(cli): sign in before fetching integration token * feat(cli): select organization for integration token * feat(cli): fetch integration token during crew setup * fix(cli): retry expired login for integration token * fix(cli): use login token for platform integrations * fix(cli): document intentional env credential storage * fix(cli): handle integration token access errors |
||
|
|
351717a7f1 | feat(cli): search platform applications (#8357) | ||
|
|
9f033cab5d | feat(cli): highlight action picker search (#8353) | ||
|
|
fa73663ce3 |
fix(skills): skip non-UTF-8 cached skill metadata (#8169)
Co-authored-by: D41910 <158550716+D41910@users.noreply.github.com> |
||
|
|
49f52a0044 | feat(cli): select organization during login (#8334) | ||
|
|
6132b094ec |
fix(deps): update vulnerable audit dependencies (#8352)
* fix(deps): update vulnerable audit dependencies * fix(ci): update uv bootstrap pins |
||
|
|
a8877f0cdf |
feat(cli): every crewai eval keeps the evaluation's full data in the project (#8326)
* feat(cli): every crewai eval keeps the evaluation's full data in the project
An evaluation's report opens for one five-minute sitting after it is first
read, and the verdict `crewai eval` waits for is that read. A coding agent
that wants a check's quotes, the outputs or the trace after its edits ran
`crewai eval export` and found it closed ("has been read already").
Right after the verdict, `crewai eval` now saves the export into
`.crewai/evaluations/<id>/` (report.md, run/checks.md, run/outputs.md,
run/trace.json, beside a `.gitignore` of `*`) and says where. Graded again
with nothing changed, it points at what it saved instead of asking AMP a
second time. Only inside a project; the ten newest are kept. A service that
does not export yet says nothing, and any other failure is one line: the
verdict and the exit code are never the save's.
The export writer now raises an error its callers decide about instead of
exiting, and writes into a nested folder the same way it wrote into one:
each folder opened inside the one before it, never through a link.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): a saved evaluation is marked whole, pruned only by its owner, and fetched briefly
Review on #8326:
- the save asks AMP with its own short timeout (20 s to read) instead of
export's two minutes: the verdict is already printed, and CI waits on the
command (`PlusAPI.export_evaluation(..., timeout=)`);
- a marker is written last, and only when every file was; it, not report.md,
says an evaluation is saved, so a save cut short is tried again;
- a save that skipped a file says "Part of its data was saved … N skipped"
and leaves no marker, instead of claiming the full data;
- only a folder this command saved whole (the marker, a plain file) is ever
removed to keep the newest ten; never a link or a junction, and nothing at
all when `.crewai/` or `.crewai/evaluations/` is a link;
- the path writer (Windows) refuses a link anywhere on the folder's way
before making anything through it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): AMP cannot send a saved evaluation's marker
Review on #8326: `_export_target` reserved the folder's `.gitignore` but not
the marker that says a save was whole. A payload carrying
`.crewai-eval-saved` and one file that is skipped would have left that
marker on a partial save: read as whole, never tried again, and kept over a
complete one. The marker is now reserved the same way, compared as a
case-insensitive filesystem that drops trailing dots sees it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
94508c971f |
feat(cli): with no terminal, crewai eval sends the crew's own output to a log (#8325)
* feat(cli): with no terminal, crewai eval sends the crew's own output to a log A coding agent reads every line `crewai eval` prints, and pays for it. When `crewai eval` ran the crew itself, the crew's panels, final answer and tool calls came first: 341 of 378 lines in a measured run, all before the verdict, and an agent that cuts long output could lose the verdict and the brief at the end. With no terminal, what the crew prints while it runs now goes to `.crewai/last_run.log`, and the agent gets one line saying so, one saying how long the run took, then the verdict and brief as before: 40 lines for the same crew. A run that leaves no trace to evaluate shows its last 40 lines, which usually hold the error. At a terminal nothing changes. It moves this process's stdout and stderr while the crew runs, which every child inherits, so every way a project runs is covered; anything that keeps them from moving leaves the output on screen. `.crewai/` is already left out of the project-changed check, so the log never triggers a re-run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): the run log is the owner's alone, and both streams always come back Review on #8325: - the run log holds final answers, tool output and tracebacks that can carry a credential: it is now opened owner-only (0600) and never through a link, and a log an earlier run left is emptied and tightened; - both descriptors are saved before either moves, and a move that fails halfway puts back what it moved, so the verdict still reaches the screen; - putting them back is best effort for each on its own and never raises, so the run's own error is the one that surfaces; - whether to keep the transcript off screen is decided by stdout, as for the brief (`nobody_watching()`): an agent can hand the command a terminal for stdin and still read a captured stdout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(cli): the run log is a file object closed by its with; a test's raise moves into a helper Code-quality review on #8325: the log descriptor was closed by hand on every path; it is now a file object (os.fdopen) the redirect holds in a with, so it is closed however the block ends. The put-back test raised inline inside pytest.raises, which reads as unreachable code after it; the raise is now in a helper. No behaviour changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
4f4573706e |
fix: treat checkpoint paths literally in glob patterns (#8269)
JsonProvider.prune() and the checkpoint CLI joined the checkpoint location (and branch) with "*.json" or "**/*.json" and passed the result to glob.glob(), so glob characters in the path were read as a pattern. For "runs[1]", pruning deleted the checkpoints in "runs1" and kept its own, and the CLI list, info and prune commands read "runs1". Escape the directory part, so that only the file name part is a pattern. |
||
|
|
37f0bd32ce | fix(cli): keep runtime input prompts on stderr (#8297) | ||
|
|
aaa33e03e0 |
fix(cli): crewai eval says why before it asks, and its help says when it asks (#8301)
At a terminal, the first time tracing is turned on, `crewai eval` showed
crewAI's trace consent screen ("Detailed execution traces are
available! ... Share this execution trace with CrewAI?") with nothing
before it, though no crew had run yet. It now says first why the crew
runs and where its trace goes ("No traced run of this crew yet. To
evaluate it, the crew runs now and its trace goes to CrewAI AMP, which
grades it."), and does not repeat the run line after a yes. Without a
terminal nothing changes: no screen, no extra line.
`crewai eval --help` still said "Nothing is asked, with or without a
terminal". It now says a person at a terminal is asked the first time
tracing is turned on, and that a project that turned tracing off is
asked at a terminal and told how without one.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
87c2868123 |
feat(cli): rewrite the scaffolded AGENTS.md and fail PRs that teach coding agents less (#8298)
* feat(cli): rewrite the scaffolded AGENTS.md around the CrewAI + AMP workflow The template opened with an API reference and mentioned traces, eval and deployment as optional extras, so coding agents rarely used them. It now opens with the steps an agent follows in a session (set up, reuse what the organization has on AMP, run, trace and evaluate every change, deploy when the work has to run elsewhere), then a short reference of the facts models get wrong. About 3.3K tokens instead of 11.9K, with outdated claims corrected. Tests assert the behaviours the old wording carried, check every documented `crewai` command against the CLI, and keep numbered lists gapless with and without the evaluation blocks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(cli): index the features AGENTS.md no longer details, and guard the file The workflow rewrite dropped references to guardrails, knowledge, MCP, conversational and declarative flows, checkpoints and more. An "Also available" index under Reference names each one with its API and docs path. Tests now guard the shipped file on every PR: a reference manifest, a token budget, text that is wrong on main, imports that must resolve, python blocks that must parse, and docs paths that must exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(cli): add a core API section to AGENTS.md for models that don't know CrewAI Measured with OpenAI models, the workflow rewrite lost the basics they don't know without the file: flow decorators and state, the @CrewBase class, task fields, CrewOutput and custom tools. A short Core API section restores them and folds in the two crew and router facts it would otherwise repeat. The reference manifest now guards those core references too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: run the AGENTS.md guards on PRs that touch the template The guards live in lib/cli/tests, which the main test workflow doesn't run. A path-filtered job runs them when the template, its tests or the docs pages it links change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: run the AGENTS.md workflow only on pull requests against main Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(cli): close the gaps where AGENTS.md taught less than the file it replaces Question by question against today's file, V6 trailed on facts it had cut or worded loosely: the context window and date options, task output folders and human review, the guardrail's return shape, test targets before writes, the eval's structural fixes, logged-in trace visibility, partial selector misses, written IDs for silent failures, ZIP deploys with an origin, the flow memory root, and LiteLLM for providers outside the native set. Each is back, verified on main. Measured on Claude Code (Haiku, Sonnet) and Codex, no question now scores below today's file. The token budget rises to 4,800 to hold them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(cli): teach the hooks and planning that telemetry counts, and three facts the old file had The index named kickoff hooks and Crew(planning=True), but the features most projects use are interception hooks (@on(InterceptionPoint...) in crewai.hooks) and agent planning (Agent(planning_config=PlanningConfig(...))). Both lines now lead with those. Three facts today's file taught come back: OpenAI's Responses API, agents judge while code computes, and answering a paused deployed flow through AMP's human_feedback_requests API. Measured on 221 questions in Claude Code (Haiku, Sonnet) and Codex, no question scores below today's file. The budget rises to 5,000 tokens, guards cover the new lines, and the never-teach list allows naming reasoning=True as replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(devtools): agents-md-eval fails a PR whose AGENTS.md teaches coding agents less `devtools agents-md-eval` asks a 218-question bank in fresh, tool-less Claude Code and Codex sessions, once with the base branch's AGENTS.md and once with this branch's, grades each answer by its key, and exits non-zero when either agent scores more than 10% below the base. The AGENTS.md workflow runs it on PRs that change the template, the eval or its questions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(devtools): run the AGENTS.md eval per model and count sessions with no answer The action asks Claude Code with the latest Haiku and Sonnet and Codex with gpt-5.6-luna and gpt-5.6-sol, one job per model. A session that hangs, fails or returns nothing is retried once and then counted; past 2% unanswered the comparison is called unreliable instead of scored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: run the AGENTS.md eval only on pull requests against main Drops the manual trigger and the conditions it needed; a test pins the trigger. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(devtools): say why AGENTS.md eval sessions gave no answer Each unanswered session records its exit code and last error line (keys redacted) or a timeout, and the command prints the most common reasons, so a run called unreliable can be diagnosed from the CI log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): grade 'is a different command' as a warning, accept 'call the agent directly' Two answer-key misses found reading V6's answers: a correct answer that warns off `crewai update` tripped its trap, and "No. Call the agent directly" didn't count as needing no crew. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): B-065's trap fires only on advice to run crewai update Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): read a failed session's reason from stdout when stderr is empty Claude Code prints some failures, such as 'Not logged in', on stdout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): accept 'never a fix' in C-018's key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): read typographic apostrophes and 'replaces' as warnings in traps Codex writes "don’t"; the negation check knew only "don't", so its warnings counted as recommendations. "X replaces reasoning=True" now reads as a warning too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(devtools): add hooks and agent planning questions; D-018 needs the tools, not the package name Three questions for features telemetry counts and the bank missed: tool-call hooks, LLM-call hooks and agent planning (221 questions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(cli): AGENTS.md teaches that crewai eval runs the crew itself, logged in or out Since #8270, `crewai eval` runs the crew, traced, when the project changed since its last traced run. The file still said to `crewai run` first, and that a run without a terminal is traced only when logged in, so logged-out coding agents logged in or stopped instead of evaluating. It now says `crewai eval` works logged in or out, with or without a terminal, with no `crewai run` between rounds and no wait on a login. The CLI test's command parser stops at a group that runs without a subcommand (`crewai eval`, `crewai eval --models ...`), which `crewai eval` became when it gained `export`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): ask whether crewai eval needs a login, and read "doesn't" as a warning Two questions join the bank: can a logged-out coding agent with no terminal get a verdict, and does it need `crewai run` first. Three keys follow main: C-004 and B-051 accept `crewai eval` (it runs and traces the crew), C-032 accepts "flow code". Negations now include doesn't, didn't, aren't and can't, so "evaluation doesn't require an account" no longer trips the trap it warns against. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ci): run the AGENTS.md eval from the base commit, with the PR's files as data The eval job checked out the pull request and ran its devtools with both API keys in the environment, so a branch could print or send them. It now checks out the base commit, fetches the pull request's commit only to read its AGENTS.md and CLAUDE.md (`agents-md-eval --head <sha>`), and runs in the `agents-md-eval` environment, where the keys can sit behind a required reviewer. When the base branch has no eval yet, the job skips with a notice. The eval also names a session's real error: Claude Code can end its output with a JSON log line after the message ("Invalid API key"), which hid every Haiku failure. Item text and reasons print as text, so `[tool.crewai]` isn't dropped and `[/...]` can't raise MarkupError after the paid runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): AGENTS.md says deploys build from any git origin, not only GitHub `crewai deploy create` sends whatever `origin` URL the project has, and AMP builds from GitHub or another git host (`any_git`). The file said an origin meant GitHub, which pointed GitLab and other users at the wrong fix. The GitHub integration note now applies to GitHub only, and a guard keeps it so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ci): run the AGENTS.md eval on pull_request_target, so its keys reach only reviewed code Under pull_request a branch's own copy of the workflow runs, so a pull request could edit the eval's steps and still get the keys. The eval now has its own workflow on pull_request_target: GitHub runs it from the base branch, the job checks out the base commit, and the pull request's AGENTS.md and CLAUDE.md are fetched and read as data, never run. It runs for this repository's branches only, since pull_request_target would hand the keys to forks too, and it fetches the pull request's commit only once it knows it will run, so a skip can't fail on the fetch. The guards stay on pull_request, with no secrets, and no longer persist the checkout's token for the pull request's code to read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(devtools): accept "go-ahead" as asking first in C-052's key "Publishing writes to your organization, so it needs your go-ahead first" asks before publishing, but the key only matched ask, approve, confirm or permission, so correct answers scored wrong. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
0b84f8e18b |
fix(core): send AMP requests through the proxy the environment names (#8186)
* fix(core): send AMP requests through the proxy the environment names PlusAPI built its httpx clients with trust_env=False, so HTTP(S)_PROXY, NO_PROXY and SSL_CERT_FILE were ignored and every AMP call tried a direct connection. On a corporate network or inside a coding-agent sandbox (Claude Code, Codex), which only allow traffic through that proxy, deploy, eval, org, triggers, trace upload, skills and repository agents all failed with "[Errno 8] nodename nor servname provided", while `crewai login` (module-level httpx.post) worked. trust_env=False dates from #1455, when the client used requests, where it also stopped ~/.netrc credentials from replacing the AMP bearer token. httpx 0.28 no longer reads .netrc, so the flag now only disables proxy and CA-bundle variables. Remove it from the three clients (core request and multipart, and the CLI's multipart override). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(core): keep the direct-request proxy test off the OS proxy settings With no proxy variables set, httpx falls back to urllib's getproxies(), which reads the macOS or Windows system proxy settings. On a machine with a system proxy configured, the "no proxy variables" test would have routed through it. Model a machine with none configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): keep a project's .env from choosing how crewai eval sends the login crewai eval already refuses to send the saved login to an AMP host that only the project's .env names. With AMP requests now honoring proxy and CA variables, the same .env could still pick the route: its own proxy and its own CA bundle, past that check. eval and eval --models now leave *_proxy, SSL_CERT_FILE and SSL_CERT_DIR out when they load the project's .env, say so, and keep the machine's own settings (shell exports, OS proxy). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(core): take AMP's proxy and CA from the machine, not a project's .env AMP requests carry the saved login. Honoring HTTP(S)_PROXY and SSL_CERT_FILE from the live environment let a cloned project's .env choose both: `crewai run` on a JSON crew or a declarative flow loads it with override=True, and `crewai.llm` loads it again on import, which also undid the filter `crewai eval` applied to its own loader. PlusAPI now pins the proxy and CA variables when crewai_core.plus_api is first imported, which the CLI does at startup, and hands them to httpx explicitly with trust_env=False. With none set, the OS proxy settings apply, read live. The eval loader goes back to main's, since the client now covers every command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): pin AMP's proxy and CA in the JSON-crew runner too `crewai run` runs a JSON crew in a fresh `uv run python -c` interpreter that never imports cli.py, and `_run_json_crew` loads the project's .env with override=True before tracing first imports crewai_core.plus_api, so the pin recorded the project's proxy and CA. The runner now imports plus_api before anything else. Declarative flows re-run through `uv run crewai run`, which already pins in cli.py. Also keeps `_requests_sent_by` off machine and OS proxies, so a developer's proxy can't mount a real transport ahead of its MockTransport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(core): keep urllib's CGI proxy rule, and surface a broken plus_api import The pinned proxy map dropped urllib's REQUEST_METHOD rule: in a CGI process an uppercase HTTP_PROXY can come from a client's Proxy header, and AMP's login and deployment ZIPs would follow it. REQUEST_METHOD is now pinned with the other transport variables, and the map is read exactly as urllib reads it. The JSON-crew runner skipped any ImportError from crewai_core.plus_api. It now skips only a crewai-core too old to have the module; any other failure stops the run with its own error instead of running with nothing pinned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): import the proxy pin with the project folder off sys.path `python -c` puts the working directory, the project, first on sys.path, so a project folder named crewai_core could supply the module that pins where the saved login travels. The JSON-crew runner now imports the pin with the project off the path and restores the path right after, so project code (custom tools importing their neighbours) still finds its own modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(core): pin AMP's proxy and CA first thing in `import crewai` A crew run in its own process (`uv run run_crew`) never imports the CLI, so `import crewai` is where the pin happens there. It already preceded the project's .env, loaded by crewai.llm on import, but only by import order. The pin is now the first import in crewai/__init__.py, and a test runs a fresh interpreter in a project whose .env names a proxy and CA: the .env loads, and the pin still holds only what the machine set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): keep the machine's proxy and CA for the crew `crewai eval` runs `crewai eval` loads the project's .env into its own process and then runs the crew in a child that inherits that environment. The child pins what it inherits, so a .env naming HTTPS_PROXY and SSL_CERT_FILE became the run's machine transport, and that run's traces carry the saved login. The proxy and CA variables go back to the machine's pin right after the .env loads; the rest of the .env still applies, and the run loads the .env itself after its own pin, as under `crewai run`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(core): keep a project's UV_ENV_FILE out of the crew `crewai eval` runs `crewai eval` loads the project's .env and starts the crew with `uv run`. A .env naming itself as UV_ENV_FILE had uv load it into the run before Python started, so the run pinned the project's proxy and CA anyway. UV_ENV_FILE now counts among the variables restored to the machine's. The pin test starts the run through `uv run`, as the CLI does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3da49f872b |
feat(cli): crewai eval runs the crew itself, so a coding agent gets a verdict from one command (#8270)
* feat(cli): crewai eval runs the crew itself, so a coding agent gets a verdict from one command
Most `crewai eval` attempts stopped before an evaluation began because the
project had no traced run. Telemetry since Sept 25: 117 projects stopped as
"untraced", 97 of them with no terminal (coding agents), and 67 of those never
got further. With no terminal the command could only print steps, and without
a login those steps could not work: an unattended anonymous run never uploads
its trace.
- With no traced run, or when the project's files changed since the last one,
`crewai eval` runs the crew and evaluates that run. No question, with or
without a terminal: running the command is the request to have the run
graded, and the grade is read off its trace. Tracing is on for that run only;
nothing is written to the project's `.env`.
- crewAI's tracing approves the upload of that run through the existing
handshake: a token in CREWAI_EVAL_AWAITING_RUN that counts only while its file
exists in the user's crewAI data folder, so a `.env` cannot claim it. Shared
as `crewai_core.eval_handshake`; the run app keeps its own copy because it
also runs against a project's older crewai-core, and a test pins the two.
- The run app's Evaluate on an untraced run closes the app and runs the crew
again, traced, through `crewai eval`'s own path, instead of a notice.
- Counts: `eval_ran_crew:{no_traced_run,project_changed,run_again}`,
`eval_finished:{passed,failed,inconclusive,unknown}`, and
`eval_stopped:untraced_after_run` replacing the catch-all `untraced`
(`declined` is gone with the question). The CLI tests no longer send usage
counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): a project that turned tracing off is asked before crewai eval runs it
`CREWAI_TRACING_ENABLED=false` is the project's no, and nothing overrules it,
not even a run `crewai eval` started.
- `crewai eval` at a terminal asks to turn tracing on before running the crew.
A yes writes it to the project's `.env`; a no runs nothing (exit 0,
`eval_stopped:declined`). With no terminal it stops and says how to turn it
on (`eval_stopped:tracing_off`), which a coding agent can do itself.
- The run app's Evaluate on an untraced run asks the same question in a modal
(TurnTracingOnScreen) before running the crew again. Otherwise it still runs
it again with no question.
- crewAI's tracing respects an explicit off again: `should_enable_tracing`
checks it before a run `crewai eval` started, and `execution._tracing_disabled`
is back to what main has.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(tracing): the telemetry opt-out no longer turns tracing off; an evaluated run says where its trace goes
- `OTEL_SDK_DISABLED` is the telemetry opt-out, a separate setting from
tracing, which has its own (`CREWAI_TRACING_ENABLED`, `tracing=`).
`execution._tracing_disabled` no longer reads it. The trace session's own
TracerProvider records even when the OpenTelemetry SDK is switched off
(`session._trace_provider`), because the SDK otherwise hands out tracers that
record nothing. A provider a host passes in is left as it is. Tests that used
`OTEL_SDK_DISABLED` as a way to stop a trace now cover the two real switches;
new tests show a traced run, anonymous or logged in, recorded and uploaded
with it set.
- A run app opened to run the crew for an evaluation (`crewai eval`, or
Evaluate on a run that was not traced) shows one plain note on mount: "This
run will be evaluated: its trace is sent to CrewAI AMP, which grades it."
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): say where the trace goes only when the yes is inferred from crewai eval
The note, in the run app ("This run will be evaluated: its trace is sent to
CrewAI AMP, which grades it.") and in `crewai eval`'s line, is for the case
where nobody turned tracing on: not `tracing=True` on the crew or flow, not
`CREWAI_TRACING_ENABLED=true`, not a consent a person gave once
(`crewai_core.user_data.is_tracing_enabled`), and not the yes they just gave to
turn it on. A project or a person who opted in is told nothing new.
The run `crewai eval` starts no longer sets `CREWAI_TRACING_ENABLED=true`:
the handshake alone turns tracing on for it, so the setting a run reads is the
project's own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): turn tracing on once with a note, pin the eval handshake, and keep the saved login to trusted AMPs
From the review on #8270, and João's call on the note:
- The first `crewai eval` that infers the yes turns tracing on for the
project (`CREWAI_TRACING_ENABLED=true` in `.env` and for the run) and says
so once, in the command and in the run app: "Tracing is now on for this
project…". Afterwards the project traces and nothing more is said. A run
whose crew or flow sets `tracing=False` is never told its trace is sent.
- The handshake's folder is found from the account's home in the account
database, never `HOME` or `XDG_DATA_HOME`, so a project's `.env` cannot plant
a token file that approves an upload. Both copies (crewai-core, the run app)
are pinned to the same folder and file by a test.
- The token file carries the AMP origins `crewai eval` trusted before the
project's `.env` was loaded. A run it started sends the saved login only
there over HTTPS or loopback; an AMP the `.env` chose gets an anonymous
grant.
- Evaluate on an untraced run carries that run's definition, inputs (prompted
ones included) and trained-agents file into the re-run. The conversational
flow consumes the request too, and a crew or flow that sets `tracing=False`
says why it cannot be evaluated instead of paying for another run.
- "The project changed" also sees deleted files: each evaluation keeps the
list of the project's files (`.crewai/eval_project_state.json`) and the next
one compares against it. That list is taken after this command's own
project-id write, so the write is no change.
- The OpenTelemetry override probes its provider and warns if an SDK version
still records nothing, instead of failing silently.
- The stale `sdk` case of `test_disabled_execution_does_not_collect_or_request_grants`
is gone; the handshake tests are typed (type-checker CI).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): keep the saved login off a project's AMP on every path crewai eval runs
From the second review round on #8270:
- Evaluate's re-run runs in a process that already loaded the project's
`.env`, so it passes this machine's AMPs (`_machine_amp_origins`) as the
trusted set instead of reading `CREWAI_PLUS_URL` there (`eval_crew(
trusted_amp_origins=…)`).
- A project's `.env` can neither set nor replace `crewai eval`'s token:
`run_crew.load_project_env` keeps the token the process was started with and
drops one a `.env` sets. The JSON-crew, declarative-flow and eval paths all
load `.env` through it.
- `crewai eval` turns tracing on only when every credential this machine holds
(the saved login, or a PAT or integration token from before the `.env`) may
go to the AMP the run would trace to. A project's crewai older than the
handshake would otherwise send it to an AMP the `.env` names. A newer crewai
still traces the run anonymously through the handshake.
- A conversational flow named by its definition is re-run by that definition.
- Code quality: no redundant assignment in `_awaiting_dir`, no unused names in
the credential test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): crewai eval does not run a crew whose trace would carry the login to an untrusted AMP
When tracing is on for the run (the project's .env, or a consent given once)
and a credential of this machine would go to an AMP the command does not
trust, the crew is not run. A project's crewai older than the handshake would
send the login there, and the CLI cannot tell which crewai the project runs.
The command stops (`eval_stopped:untrusted_amp`) and says how to go on: log
in to that AMP, or remove CREWAI_PLUS_URL from the project's .env. A project
that turned tracing off is not asked to turn it on toward such an AMP. With
no credential on the machine, there is nothing to protect and the run goes on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Ask at a terminal before tracing is first turned on
A person running `crewai eval` at a terminal, in a project that never
turned tracing on, is now asked on crewAI's trace consent screen before
the crew runs; a yes turns tracing on for the project, a no (or the
screen timing out) runs nothing and is counted as `declined`. The run
app's Evaluate on an untraced run asks on its own consent screen the same
way. With nobody at a terminal (a coding agent, a script) the yes is
still inferred from the command, tracing is turned on and said once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep main's Iterator import, which the rebase over #8187 dropped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* A run-app test no longer leaves .crewai/last_eval.json in the repo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Two run-app tests from #7963 no longer leave .crewai/last_eval.json in the repo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Never run the crew toward an AMP the login must not reach; check before asking
`crewai eval` now refuses to run the crew whenever a credential of this
machine would go with the trace to an AMP it does not trust, whatever the
tracing setting: `tracing=True` in code is invisible to the CLI, and a
project's crewai older than the handshake sends the credential wherever
the run traces. The run app's Evaluate makes the same check before it
asks anything, so a yes can never write CREWAI_TRACING_ENABLED=true to
`.env` for a re-run that is then refused.
Which credentials are this machine's is read from the environment as it
was before any project `.env` was loaded (`run_crew.environment_before_project`),
so on Evaluate's re-run a CREWAI_USER_PAT the project's own `.env` brought
is the project's, as on any run of it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Run the crew only toward an AMP this machine trusts, login or not
Whether this machine holds a login right now no longer decides: with no
login yet, `crewai eval` still wrote CREWAI_TRACING_ENABLED=true toward a
CREWAI_PLUS_URL the project's `.env` chose, and the first run after
`crewai login` would have carried the login there. Toward an AMP this
command does not trust, the crew is now never run, nobody is asked and
nothing is written, in `crewai eval` and the run app's Evaluate alike.
That also drops the credential bookkeeping from
|
||
|
|
1410318b2e |
feat(cli): crewai eval export downloads an evaluation as files (#8187)
* crewai eval export downloads an evaluation's full data as files A coding agent that is asked to act on an evaluation needs more than the brief: the report, every setup's outputs, every check with the judge's words, and the traces. AMP serves them as one export; this writes them into ./crewai-eval-<id>/ with a .gitignore of `*`, so customer data is never committed by accident. `crewai eval` becomes a group so the subcommand can live under it; every existing invocation is unchanged. The paths come from whichever AMP answered, so only plain relative paths that resolve inside the folder are written; the rest are skipped and counted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * A .gitignore link already in the export folder is replaced, never followed Writing through it would have put `*` into whatever file it points at, outside the folder. The tests also read the export as UTF-8, as it is written, so a Windows locale cannot misread its dashes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * The export writes through folder handles and refuses Windows device names A name Windows keeps for a device (CON, PRN, AUX, NUL, COM0-9, LPT0-9, with any extension) is skipped like any other unsafe path, on every platform: on Windows `NUL.md` is the null device, and the export would report a file written that nobody can read. On Linux and macOS each folder of a path is opened inside the one before it, never through a link, and the file inside the last: no path is checked and then opened again, so a link another process swaps in while the export runs is never gone through. A link where a folder goes skips that file; a link at a file's own place, symbolic or hard, is removed and the file made anew; the export folder itself being a link stops the export with one sentence. Windows keeps the resolved-path check. Reading an evaluation sends `can_export=1`, so the brief names `crewai eval export` only when the CLI, AMP and the evaluation service all serve it. An AMP without the export route (a 404 that is not AMP's `not_found`) says it needs an update; AMP's `export_unsupported` and `export_too_large` answers are printed in AMP's own words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * A folder where an exported file goes is skipped; the path writer replaces hard links and refuses a junction - A folder already standing where an exported file goes is skipped and counted, as a file where a folder goes already was, instead of stopping the export. - On the path writer (Windows), whatever is at a file's place is removed and the file created anew. A hard link there is no longer written through. - The export folder must resolve to itself. A Windows junction, which `is_symlink` does not see, stops the export like a link. - The file handle is closed if wrapping it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Say why a missing file is no error before the export makes it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * A folder where the export's .gitignore goes stops the export before any data The data never goes into the folder without the .gitignore that keeps it out of git. The Windows path writer's comment now states the race it leaves open, and why that loss is bounded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9112709294 |
fix(cli): run JSON crews headless when there is no terminal (#8239)
`crewai run` on a JSON crew opened the Textual run screen unless CREWAI_DMN was set. Without an interactive terminal (a coding agent's shell, CI, piped input) the screen stayed open after the crew finished, so the command never exited. It now opens only when is_interactive() is true, the convention declarative flows already follow; otherwise the crew runs on plain output and the command exits. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3da2d4e993 |
Filter platform actions while selecting them (#7991)
* Mark the platform action picker as searchable. The flag is off for every other multi-select, and filtering comes in the next change. * Filter picker labels by query while keeping their original indexes. An empty query matches every label, and a typed query can match the display name or the slug. * Let the platform action picker filter as the user types. The arrow-key list shows the query and hides non-matching rows, and the numbered fallback uses the same filter without dropping checked actions. * Erase leftover rows when a search result is shorter than the previous list. A filtered action picker now shows only the matching actions. * Show the action search in green under the navigation hint. The line includes how many actions the query matched. |
||
|
|
aa5f2acd9b |
deploy push reads AMP's comparison refusal by its code (#8161)
* deploy push reads AMP's comparison refusal by its code AMP's 409 for a deployment with a models comparison running now carries the sentence in `error`, because every released CLI prints a failed request's `error` and none has `--force`; the refusal is named in `code`. `crewai deploy push` recognises it by `code` and prints the sentence as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Recognise AMP's refusal named in `error` too, on every route An AMP from before the `code` field (a branch on staging, a factory that upgrades later) names the refusal in `error`; recognising both keeps the sentence for an upgraded CLI whichever AMP it talks to. A test covers deploy by id, by name and the ZIP update in both shapes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c7c0d8969a |
Rename the platform token and preselect default app actions (#7990)
* Rename the platform integration token to the Enterprise Action Auth Token. The CLI now asks for that token under Settings → Account and stores it as CREWAI_ENTERPRISE_ACTION_AUTH_TOKEN. * Add the latest Clipper platform applications to the catalog. SharePoint Graph, Resend, Vercel, and Pinecone come from clipper v5 and are grouped in the platform picker. * Preselect three default actions for every platform application. The create wizard checks those actions in the picker, and a test keeps the defaults list the same length as the catalog. * Fail the Clipper client test when the Enterprise Action Auth Token is absent. A deployment instance id is not a substitute for that token, so the test no longer sets one. * fix(agent): name the Enterprise Action Auth Token when apps resolve to no tools |
||
|
|
b0c16c162a |
fix(cli): crewai eval waits out AMP's rate limit instead of quitting (#8148)
* fix(cli): crewai eval waits out AMP's rate limit instead of quitting
On prod (2026-10-14) a `crewai eval --models` comparison ended its CLI with
exit 1 on one poll AMP answered 429 ("Too many evaluation requests. Please
retry later." — AMP allows 30 evaluation requests a minute per IP), while
the deployment went on running the comparison. A 429 mid-poll is now waited
out: Retry-After seconds, never less than a poll's interval nor more than
RATE_LIMIT_MAX_WAIT_SECONDS (120), a missing or odd header a minute; then
the poll goes on, however many come. It is not counted as a miss: being
asked to slow down is no reason to stop waiting for a running evaluation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): a rate limit that never lifts ends the wait; Retry-After as RFC 9110 has it
Review on #8148:
- Rate-limited without a break for RATE_LIMITED_FOR_AT_MOST_SECONDS (15
minutes, counted over the waits the 429s asked for and reset by any other
answer), the wait stops: "AMP kept rate-limiting this command for 15
minutes, so it stopped waiting; the evaluation keeps running at <url>."
A limit that passes is still ridden out; CI, agents and the TUI no longer
wait without end.
- Retry-After is read in both forms RFC 9110 allows, delay-seconds and an
HTTP-date (a date already past waits a poll's interval); a negative or
non-finite number, or words, waits a minute, as documented — NaN and the
infinities no longer slip past that.
- The test compares the whole list of waits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(cli): the passing-limit case checks every poll it made
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): the rate-limit count never overruns, and any other answer restarts it
CodeRabbit on #8148 (outside the diff):
- A 5xx between 429s is an answer too: every non-429 answer now restarts
the count, before the 5xx branch continues.
- The last wait is what is left of RATE_LIMITED_FOR_AT_MOST_SECONDS, so the
wait never runs past fifteen minutes (it could overrun by up to 119 s).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): a 429 breaks a streak of unreachable or 5xx polls
CodeRabbit on #8148: POLL_RETRIES counts a consecutive streak of
unreachable or 5xx polls, and a 429 is AMP answering. Four 503s, a 429 and
one more 503 stopped the wait; the 429 now resets the streak.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): one deadline over every kind of refusal while waiting
iris on #8148: a 503 reset the rate-limit count and a 429 reset the 5xx
streak, so refusals taking turns could keep CI and agent callers waiting
without end. The two counts are now one monotonic deadline (_clock):
polls that get no answer about the evaluation — rate-limited, failing,
unreachable, in any mix — for UNANSWERED_FOR_AT_MOST_SECONDS (15 minutes)
without a break end the wait, and only AMP's answer (a 200) restarts it.
The last wait is still what is left of the deadline. The sentence names the
cause: "AMP kept rate-limiting this command for 15 minutes" when every
refusal was a 429, else "AMP gave this command no answer about the
evaluation for 15 minutes (rate limits, errors, no connection)".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
8dcb00584f |
feat(cli): crewai deploy push --force, and why AMP held a push back (#8150)
* feat(cli): crewai deploy push --force, and why AMP held a push back
AMP now holds back a redeploy while a models comparison is running on the
deployment (crewAIInc/crewai-plus#4776): a redeploy restarts the workers
and the comparison loses its runs (pr_security_reviewer, 2026-10-14). It
answers 409 {"error": "comparison_running", "message": ...}.
- `crewai deploy push --force` goes ahead anyway: deploy_by_uuid /
deploy_by_name send {"force": true} and update_crew_from_zip a force field
(crewai-core and the CLI's own copy), only when asked — an unforced push
sends exactly what it always did, and an older AMP ignores the field.
- A push AMP held back prints AMP's sentence (which names --force) and
"Nothing was deployed.", and exits 1 — not the bare error code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(llms): Claude 3.5 Sonnet v2 on Bedrock has a 200k window in the refreshed catalog
The 1.15.28 release refreshed the packaged LiteLLM catalog, which now lists
anthropic.claude-3-5-sonnet-20241022-v2:0 at 200,000 input tokens (it had
1,000,000), the model's documented window. The test still expected 1M, so
every PR's test job failed on main's own catalog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cli): AMP's hold-back sentence is printed literally
Review on #8150: the comparison_running message went through Rich markup,
so a bracketed word in it vanished and a stray closing tag raised
MarkupError before "Nothing was deployed." could print. It is printed with
markup=False now; a test sends one with both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
7056fe1fe2 | feat: bump versions to 1.15.28 (#8146) | ||
|
|
ddfa8517b8 |
feat(cli): crewai eval --models says at once where a stopped model broke (#8105)
* feat(cli): crewai eval --models says at once where a stopped model broke The service's poll answer now lists the setups that stopped, with where in the project each broke (step → crew → task → agent), the whole reason and its plain words. The CLI says each one the moment that is known, while the others keep running: a coding agent gets a block it can start fixing from, the run's own words quoted as data; a person gets one red line. An older service sends nothing and nothing changes. The AGENTS.md templates say to run a comparison in the background and read its output as it goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): a stopped setup's location is a list of names, and the run's words come only from `reported` Review (#8105): `where` from the service was used whenever it was truthy, so a string skipped the wait and printed one character per place, and anything not iterable raised. Each stopped setup is now parsed once into a checked record (_Stop): only a list of non-empty strings is a location; the run's own words are read only from `reported`, where the service (crew-optimize #25) puts them beside its data-not-instructions note — top-level text is not the run's channel. The AGENTS.md templates say a location prints when the service knows it, and an unplaced stop after about 20 seconds or when the comparison ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(cli): pin when an unplaced stop is said, not just the order Review (#8105): the ordering assertion passed even if an invalid `where` were announced on the first poll, since the progress line prints first anyway. The test now records the fake clock when the stop is said and asserts 30 s — after the wait ran out, never at the first poll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
18473adc33 |
fix(cli): flow add-crew finds the package from pyproject (#8082)
`crewai flow add-crew` looked for `src/<folder name>/crews`, so a project cloned or created under a different directory name failed with "Crews folder does not exist". It now resolves the package from `[project].name` (normalized like the scaffolder does) and falls back to a single `src/*/crews`; several candidates or none fail with a message naming what was expected or found. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
ab423144c1 |
docs: correct deploy and platform-tool guidance in the project AGENTS.md (#8084)
* docs: correct deploy and platform-tool guidance in the project AGENTS.md The AGENTS.md that `crewai create` ships told coding agents that `crewai deploy remove <id>` works (the CLI only takes `-u <uuid>`), that a deploy needs a GitHub repository (with no origin it uploads a ZIP), that PLATFORM_APPS is the source of truth for action selectors (some of its action names resolve to no tool), and to measure quality with `crewai test`. Its router example also declared no labels, so `crewai flow plot` could not draw the branches. - Template: platform token, selector syntax, `apps:` YAML example and selector check; router labels; deploy prerequisites, `-y`, `.env` upload, org commands, `project_id`; best practice points at `crewai eval` inside the eval markers. - Docs: quickstart deploy prerequisite and `remove -u`, and router labels in concepts/flows, in en, ar, ko and pt-BR. - Tests parse every documented deploy/org command against the real CLI, run the routing example through the plot builder, and check the best practices stay numbered without gaps for crew and tool projects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: base the quickstart ZIP-deploy note on any git origin The CLI deploys from git whenever an `origin` exists, GitHub or not, and uploads a ZIP only when there is none. The quickstart said "GitHub origin ... without one", which reads as if a non-GitHub origin takes the ZIP path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
744bf60367 |
fix(cli): show why a deployment failed and fix deploy remove and lockfile checks (#8083)
* fix(cli): show why a deployment failed and fix deploy remove and lockfile checks - deploy status prints AMP's error_message and error_suggested_fix when a deployment has failed, verbatim (no Rich markup), instead of only "Provisioning Failed, try again." - deploy remove -u names the removed UUID instead of the local project, and a failed removal prints the API's error. - deploy validate asks `uv lock --check` (offline) whether uv.lock is current instead of comparing file times, which flagged metadata-only edits that `uv lock` never clears. File times remain the fallback without uv or for poetry.lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: note that deploy status prints the failure reason Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cli): print deploy validate findings without Rich markup render_report printed codes, titles, details and hints as Rich markup, so bracketed text vanished: `[stale_lockfile]`, `[project]`, `[tool.hatch.build.targets.wheel]`, `crewai[tools]`. Raw `uv` stderr in the new unverified_lockfile detail could also raise MarkupError on a stray closing tag. Escape every finding field. Also bound the test fixture's `uv lock` with a timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6b9e62180e |
fix(core): give trigger list and payload requests a 60s timeout (#8081)
`crewai triggers list` timed out on every real organization: the apps listing takes about 11s and these two calls fell back to httpx's 5s default. Other PlusAPI calls keep their current timeouts. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
9d5fd32661 |
fix(cli): deploy push reads AMP's source_type, so a ZIP deployment gets the new code (#7980)
#7345 made push follow how AMP holds a deployment's code, read from a `zip_deployment` boolean on the status. AMP's status never sends that field: it sends `source_type` ("zip", "studio", "github", "any_git"). So push always fell back to the local origin remote, and a ZIP deployment whose project has a git remote was redeployed by uuid — AMP rebuilt the ZIP it already held, not the code being pushed. Seen on a real deployment: after raising crewai to 1.15.26, `crewai deploy push` rebuilt the stored 1.15.23 ZIP ("CrewAI version detected: 1.15.23"), with no upload. `zip_deployment` is still read first when a server sends it. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
d522c31339 | feat: bump versions to 1.15.27 (#8001) | ||
|
|
b3c4409bc5 |
feat(cli): record why an evaluation stopped before its verdict (#7963)
* feat(cli): record why an evaluation stopped before its verdict `cli_usage:evaluate` counts presses of Evaluate and `cli_usage:eval` counts evaluations that started, but about four in five presses never become an evaluation and nothing said why. Every stop now counts once as `cli_usage:eval_stopped:<reason>` from a closed list: untraced, declined, no_project, login_unreadable, network_error, amp_401/403/404/4xx/5xx, invalid_response, unexpected. The reason rides on EvaluationStoppedError from where it is raised; messages, exit codes and screens are unchanged. A run that `crewai eval` hands to the run app and that turns out untraced is counted by the command only, so one stop is never counted twice. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(cli): count each eval stop once, with the reason shown - the run app answers for a delegated run it could not start, so the waiting crewai eval does not start it again and count the stop twice - an unreadable saved login on the unattended path counts as login_unreadable, not untraced - an evaluation AMP itself failed counts as evaluation_failed, in the CLI and the app; --models unchanged Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
ed71a6f4d6 |
crewai eval --models: per-run cost and time, and no repeated progress lines (#7965)
* crewai eval --models: per-run cost and time, and no repeated progress lines The comparison table printed each setup's cost and time summed over all its runs, while the brief and the report say them per run. It now prints cost_per_run / seconds_per_run under 'cost / run' and 'time / run' (the totals, headed 'cost' / 'time', only when the service sends no per-run figure; a column never mixes the two). Progress deduped only against the previous line, so parallel setups made polls alternate and the same lines printed again and again. Each line is now said once per wait. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * Keep the per-run unit when a model is unpriced, and explain its dash Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
24a1ddf23f |
feat(cli): record what the run app's Deploy met before an attempt (#7964)
About half the presses of Deploy in the run app never reach a deployment attempt, and nothing said why. With no saved login the press raises before the attempt is counted and prompts for one. That prompt now counts once as `cli_usage:deploy_login_prompted`, and a press that still never reaches an attempt counts as `cli_usage:deploy_stopped:<reason>`: login_still_required, login_abandoned or login_failed. Counting re-raises; what the user sees is unchanged. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
1eff1d6bc9 | feat: bump versions to 1.15.26 (#7961) | ||
|
|
b90fa6e822 |
fix(cli): show actual task output in log-tasks-outputs (#7936)
* fix(cli): show actual task output in log-tasks-outputs * fix(cli): show task result instead of storage blob in log-tasks-outputs --------- Co-authored-by: Vidit Ostwal <110953813+Vidit-Ostwal@users.noreply.github.com> |
||
|
|
7ed27d764a | feat: bump versions to 1.15.25 (#7945) | ||
|
|
82d09de711 |
feat: bump versions to 1.15.24 (#7941)
* feat: bump versions to 1.15.24 * chore: update tool specifications --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> |
||
|
|
00e2ff98e9 |
feat(cli): crewai eval prints a markdown brief when run by an agent (#7907)
* feat(cli): crewai eval prints a markdown brief when run by an agent When stdout is not a terminal (or CREWAI_DMN is on), `crewai eval` and `crewai eval --models` print the poll response's `brief_markdown` after the verdict and the report link — written straight to stdout, never through Rich markup — or "Brief (markdown): <brief_url>" when only the link came. An older AMP sends neither and nothing extra is printed. In a terminal nothing changes. Exit codes unchanged. `crewai eval --help` and the `--models` help say so, and the AGENTS.md the crew, flow and declarative-flow templates scaffold gains an "Evaluating" section telling a coding agent to run `crewai eval` after a change and act on the brief. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs(cli): an agent re-runs before it re-evaluates; each command's exit rule; the brief may be a link Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(cli): keep the eval guidance out of tool projects; the brief is conditional in --help `crewai create tool` copies the shared AGENTS.md too, but a tool project has no `crewai run` and no traced run for `crewai eval`. The evaluation blocks are marked in the template and dropped for a tool (`evaluation=False`); crew, flow and JSON-crew projects keep them, markers stripped. --help now says the brief prints when AMP provides it, else its link, else nothing more. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
e836a191cf |
fix(cli): correct train filename error message (#7903)
* fix(cli): correct train filename error message * fix(cli): fail train on invalid input with nonzero exit --------- Co-authored-by: Vidit Ostwal <110953813+Vidit-Ostwal@users.noreply.github.com> |
||
|
|
1b9bbccbed |
feat(cli): crewai eval --models, and llm_overlay swaps models as well as roles (#7811)
* feat(llm): llm_overlay maps models too, not only agent roles A key `model:<provider/model>` maps every LLM built from that model string inside the block, and `model:*` every LLM built from any model string. That reaches what a role cannot: a flow step's own `LLM(...).call()`. The key is read in `LLM.__new__` (and so `create_llm` and an agent's `llm="..."`), and on an agent's declared llm built outside the block; a role key still wins for that agent. The caller's settings follow the mapped model by the rule a declared llm's do. `MODEL_KEY_PREFIX` is public so another package can feature-detect the form. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(telemetry): allow-list cli_usage:eval_models attributes The span `crewai eval --models` records carries whether the caller was logged in, the models compared (provider/model names) and how many, in both telemetry classes. Nothing about the run, its output or the organization. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(cli): crewai eval --models compares models on the deployment `crewai eval --models "a,b"` (and `--deployment UUID` when AMP cannot tell the deployment from the project id) asks AMP for a models evaluation: the project id, the models from one comma-separated list (stripped, repeats dropped, provider/model required, 1-5) and the project's eval.jsonc. It needs the login, prints and opens the report link, says where the comparison is while it runs, then prints one row per model (goal, tasks, agents, tools, cost, time; the deployed one marked, the best per column starred) and the top three suggestions. Exit 0 when it finished, 1 when it failed or could not start. Everything from the wire is printed as Text. The comparison is counted as `cli_usage:eval_models` once AMP accepts it. Mode 1 now sends the project id with `create_evaluation` too, so every evaluation is filed under the project it is about. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(cli): crewai deploy create and push send the project id Every create (git or ZIP) and every push (redeploy by name or uuid, or a ZIP update) carries `[tool.crewai].project_id` when the project has one, so AMP knows which project a deployment runs and `crewai eval --models` can find it. The id is read, never minted: a deploy does not rewrite pyproject.toml. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(llm): a model key maps an LLM whose declared SDK is not installed Nothing is built on the declared model, so a missing SDK for it is no reason to fail the mapped build; its credentials cannot be matched to the new provider, so none are carried. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(cli): crewai eval --models leaves its criteria behind as eval.jsonc When the comparison's answer carries `eval_config` and the project has no eval.jsonc, it is written through `write_eval_config` and the same one line Mode 1 prints says so. An existing file is never overwritten. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(llm): a model key compares providers by provider, not by class `_same_route_provider` now follows `_same_provider`'s rule case for case: a LiteLLM-routed `LLM(...)` is on the same provider as a native route when its provider names that native class, so its key and endpoint follow a model key to another model of the same provider. Another provider still gets none. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore(llm): say why mark_mapped may skip an object, and one import form in its tests Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(cli): usage stats name a compared model only when it is a public one `cli_usage:eval_models` carried the `--models` strings as typed, and those can identify a customer: a fine-tune id, an Azure deployment name, a self-hosted model or host. A model is now sent by name only when it is an exact entry of crewAI's model catalog (`LLM_CONTEXT_WINDOW_SIZES`), else as `<provider>/other`, and a provider crewAI does not route as `other/other`. An `ft:` id is never sent. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(cli): a refused comparison's test no longer keeps a None return Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(llms): re-importing OpenAI's completion module restores its package attribute `test_openai_completion_module_is_imported` deletes the module from sys.modules and lets `LLM(...)` import it again, which binds the new module on `crewai.llms.providers.openai` as well. monkeypatch restored only the sys.modules entry, so every later test on that worker saw two module objects for one name: `patch("crewai.llms.providers.openai.completion.X")` patched the attribute's module while `from ... import X` read sys.modules'. On Python 3.10 that made tests/llms/azure/test_azure_responses.py fail whenever it shared a worker with test_openai.py and test_crew_loader.py, which the new tests' even split now did. The attribute is restored too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(llm): model keys strip only a model's own prefix; a role builds from the declaration Two review findings on the model-for-model overlay: - `overlay_model_for_model` took the text after the first slash as another name for the model, so an aggregator's route (`openrouter/openai/gpt-4o`) matched a `model:openai/gpt-4o` or `model:gpt-4o` key meant for the native model. A prefix is now stripped only when it is a native provider's own and what remains has no slash; an instance on an aggregator is compared as `<provider>/<its model id>`. - With a role key and a model key both active, the model key mapped the declared llm first and the role's model was built like that mapped instance, losing the caller's key and endpoint. The overlay now remembers what the caller declared for every llm it built, and a role key is built from that declaration. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(llm): model keys read a provider's other names; a LiteLLM choice survives a missing SDK - The router's provider aliases are now one table, `crewai.llm.PROVIDER_ALIASES`, and `llm_overlay` compares model names through it: `google/x` and `gemini/x` are one model whether the llm is built in the block or was built before it (a prebuilt instance records `gemini`). An exact key still wins, and an aggregator's route is still compared whole. - When the declared model's SDK is missing, a caller's explicit `is_litellm=True` is kept for the mapped model instead of dropping to a native route. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(deploy): a git create sends the project id once, at the top level AMP reads project_id at the top level on every deploy route, so the git create no longer repeats it inside `deploy`. The redeploy docstring records why its optional body is safe on an AMP that predates project ids. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |