Commit Graph

2236 Commits

Author SHA1 Message Date
Greyson LaLonde
167b609365 fix: restore event scope stack from checkpoint event record
Replay the event record during _restore_runtime to rebuild
_event_id_stack with correct event IDs. Remove manual push_event_scope
calls from task and crew resume paths that used task UUIDs instead
of event IDs.
2026-04-04 23:18:23 +08:00
Greyson LaLonde
b46e96532e fix: return state messages by reference, not copy 2026-04-04 23:06:07 +08:00
Greyson LaLonde
5c243b72a8 fix: skip adding crew-owned agents as top-level RuntimeState entities 2026-04-04 23:03:50 +08:00
Greyson LaLonde
055d1469a0 fix: resolve mypy errors from openai 2.x type changes 2026-04-04 23:00:49 +08:00
Greyson LaLonde
6e7afb732f fix: avoid duplicating LLM hooks on checkpoint restore 2026-04-04 22:41:59 +08:00
Greyson LaLonde
e0fc32144c fix: return 0 instead of None when checkpoint resumes from first task 2026-04-04 22:37:42 +08:00
Greyson LaLonde
0c228b45b7 fix: seed _registered_entity_ids from restored RuntimeState 2026-04-04 22:31:39 +08:00
Greyson LaLonde
3f447f21d0 cleanup: remove redundant _registered_entity_ids class annotation 2026-04-04 22:27:32 +08:00
Greyson LaLonde
da5a890eae fix: share event metadata setup between emit and aemit
Extract _prepare_event to set previous_event_id, triggered_by_event_id,
emission_sequence, parent/child scoping, and event_record tracking.
Both emit and aemit now call it, fixing aemit's missing metadata.
2026-04-04 22:24:58 +08:00
Greyson LaLonde
0079c70dda ci: bump uv from 0.8.4 to 0.11.3 in all workflows 2026-04-04 22:18:53 +08:00
Greyson LaLonde
686cff6514 fix: register entities in aemit like emit does 2026-04-04 22:12:19 +08:00
Greyson LaLonde
fac186a931 fix: handle unhashable partial handlers in param count cache 2026-04-04 22:10:09 +08:00
Greyson LaLonde
70fc701941 fix: bump litellm to ~=1.83.0 and openai to ~=2.30.0
litellm 1.83.0 fixes CVE-2026-35029 (proxy config privilege escalation)
and CVE-2026-35030 (proxy JWT auth bypass), and is the first release
after the supply chain incident. Bump openai to 2.x to satisfy litellm's
dependency.
2026-04-04 22:04:16 +08:00
Greyson LaLonde
c4bbb039da refactor: use lru_cache for handler param count 2026-04-04 21:35:00 +08:00
Greyson LaLonde
88d9984178 Merge branch 'chore/runtime-state-event-bus' of https://github.com/crewAIInc/crewAI into chore/runtime-state-event-bus 2026-04-04 21:31:47 +08:00
Greyson LaLonde
d769469ff6 fix: restore checkpoint_train flag during checkpoint resume 2026-04-04 21:30:36 +08:00
Greyson LaLonde
ebb58a237e fix: bump uv-pre-commit to 0.11.3, distinguish checkpoint resume
- Bump uv-pre-commit from 0.9.3 to 0.11.3 to support relative
  exclude-newer values in pyproject.toml
- Use checkpoint_kickoff_event_id to detect resume, preventing
  second kickoff() from skipping tasks or suppressing events
2026-04-04 21:29:30 +08:00
Greyson LaLonde
dc2904d00c Merge branch 'main' into chore/runtime-state-event-bus 2026-04-04 04:12:18 +08:00
Greyson LaLonde
b882988128 fix: checkpoint resume bugs and handler signature caching
- Return len(tasks) from _get_execution_start_index when all tasks
  complete, preventing full re-execution of finished checkpoints
- Add _get_execution_start_index call to _aexecute_tasks so async
  resume skips completed tasks like the sync path does
- Cache inspect.signature results per handler to avoid repeated
  introspection on every event emission
2026-04-04 04:11:34 +08:00
iris-clawd
d039a075aa docs: add AMP Training Tab guide (#5083)
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* docs: add AMP Training Tab guide for enterprise deployments

* docs: add training guide translations for ar, ko, pt-BR

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Alex <alex@crewai.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-03 17:09:31 -03:00
Greyson LaLonde
81e51f058a Merge branch 'main' into chore/runtime-state-event-bus 2026-04-04 04:01:50 +08:00
Greyson LaLonde
e72b08ec49 fix: resolve mypy errors from optional executor fields
- Disable union-attr/arg-type at file level in the two executor files
  where agent/task/crew are always set at runtime but typed as optional
- Fix Liskov override in OpenAICompletion: use BaseAgent instead of Agent
- Remove stale type: ignore comments now covered by file-level disables
2026-04-04 03:57:39 +08:00
Greyson LaLonde
c1f9d9270b fix: assign mocks post-init for remaining executor tests
Remove spec= from mocks and construct executors with defaults, then
assign mock agent/task/crew after init to avoid pydantic validation.
2026-04-04 03:38:46 +08:00
Greyson LaLonde
a94c2bf786 fix: bypass pydantic validation for mocks in BaseAgentExecutor tests
After model_rebuild, BaseAgentExecutor rejects plain MagicMock for
typed fields. Construct with defaults then assign mocks post-init.
Also guard RuntimeState tests for environments where model_rebuild fails.
2026-04-04 03:33:07 +08:00
Greyson LaLonde
206259b537 fix: add spec= to remaining mocks passed to pydantic models 2026-04-04 03:12:21 +08:00
Greyson LaLonde
a3d25c661a fix: register RuntimeState in Flow.from_checkpoint
Crew.from_checkpoint called set_runtime_state but Flow.from_checkpoint
did not, leaving the event bus without the restored state.
2026-04-04 03:09:57 +08:00
Greyson LaLonde
7f24d74795 fix: use real pydantic instances in executor tests, preserve cache handler across re-validation
- Replace MagicMock fixtures with real Agent/Task instances in
  test_async_agent_executor.py so pydantic validation passes
- Guard CacheHandler creation in Crew.set_private_attrs to avoid
  replacing an existing handler when the model validator re-runs
  during RuntimeState registration
2026-04-04 03:05:06 +08:00
Greyson LaLonde
fba56056c0 fix: use spec= on mocks for typed executor fields 2026-04-04 02:16:34 +08:00
Greyson LaLonde
f9d58d4d32 fix: add BaseAgentExecutor to model_rebuild chain 2026-04-04 02:11:48 +08:00
Greyson LaLonde
fb8b59d001 fix: guard register_entity when RuntimeState is None 2026-04-04 02:07:48 +08:00
Greyson LaLonde
ce99312db1 chore: add exclude-newer = 3 days to all pyproject.toml files 2026-04-04 02:02:58 +08:00
Greyson LaLonde
c571620f8c fix: remove seo indexing field causing Arabic page rendering
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
2026-04-04 01:34:23 +08:00
Greyson LaLonde
191053c41b refactor: generic from_checkpoint with provider, full LLM serialization 2026-04-04 01:25:31 +08:00
Greyson LaLonde
6dc9f462f9 feat: mid-task checkpoint resume and executor refactor 2026-04-04 01:07:45 +08:00
Greyson LaLonde
5ace0bfe4a fix: suppress duplicate lifecycle events on checkpoint resume 2026-04-03 23:02:16 +08:00
Greyson LaLonde
c653d41b89 feat: add EventRecord to RuntimeState checkpoints 2026-04-03 22:31:36 +08:00
Greyson LaLonde
de9300705d refactor: move RuntimeState to state/, add async checkpoint with provider pattern
- Move runtime_state.py to state/runtime.py
- Add acheckpoint async method using aiofiles
- Introduce BaseProvider protocol and JsonProvider for pluggable storage
- Add aiofiles dependency to crewai package
- Use PrivateAttr for provider on RootModel
2026-04-03 21:29:27 +08:00
Greyson LaLonde
1ed6646eae refactor: move RuntimeState to runtime_state.py, type _runtime_state on event bus 2026-04-03 20:36:57 +08:00
Greyson LaLonde
2e1525f69a fix: mypy errors in streaming.py and core.py 2026-04-03 19:32:29 +08:00
Greyson LaLonde
caaccd748d fix: validate entity_type tag before auto-registering in emit() 2026-04-03 18:49:23 +08:00
Greyson LaLonde
3a08e954e7 fix: replace object.__new__ and MinimalExecutor subclass with proper construction 2026-04-03 18:42:31 +08:00
Greyson LaLonde
0b980db1e9 fix: use spec= on test mocks for typed executor fields 2026-04-03 17:42:47 +08:00
Greyson LaLonde
de9f121cf7 fix: type remaining Any fields on CrewAgentExecutor 2026-04-03 17:32:00 +08:00
Greyson LaLonde
78fbe455b9 fix: TokenCalcHandler hashability, test MinimalExecutor as instance 2026-04-03 17:25:51 +08:00
Greyson LaLonde
6504e39d47 feat: type executor fields, auto-register entities in event bus, convert TokenProcess to BaseModel 2026-04-03 17:12:41 +08:00
Greyson LaLonde
2c4914b0d0 Merge branch 'main' into chore/runtime-state-event-bus 2026-04-03 12:46:00 +08:00
iris-clawd
931f3556cf ci: add vulnerability scanning with pip-audit and Snyk (#5242)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* ci: add vulnerability scanning with pip-audit and Snyk

Add a new GitHub Actions workflow that runs on PRs, pushes to main, and weekly:

- pip-audit: scans all Python dependencies (direct + transitive) against
  PyPI Advisory DB and OSV for known CVEs. Outputs JSON report as artifact
  and posts results to the job summary.
- Snyk: optional enterprise-grade scanning (gated behind SNYK_ENABLED
  repo variable and SNYK_TOKEN secret). Runs on high+ severity and
  monitors main branch.

This addresses the need for automated pre-release vulnerability scanning
to catch dependency CVEs before cutting releases.

* ci: pin Snyk action to @v1 tag and remove continue-on-error

- Pin snyk/actions/python from @master to @v1 to prevent supply chain
  risk from mutable branch references (matches convention of other
  actions in the repo using versioned tags)
- Remove continue-on-error on the Snyk check step so high+ severity
  vulnerabilities actually fail the build

* ci: fail build when pip-audit crashes without producing a report

If pip-audit exits abnormally without writing pip-audit-report.json,
the Display Results step now emits an error annotation and exits 1
instead of silently passing.

* ci: fix pip-audit failing on local packages

Replace --strict with --skip-editable to avoid pip-audit failing when
it encounters local/private packages (e.g. crewai-devtools) that are
not published on PyPI. The --skip-editable flag tells pip-audit to
skip packages installed in editable/development mode while still
auditing all published dependencies.

* fix: bump vulnerable dependencies and ignore unfixable CVEs

Dependency upgrades (via uv lock --upgrade-package):
- aiohttp 3.13.3 → 3.13.5 (fixes 10 CVEs)
- cryptography 46.0.5 → 46.0.6 (fixes CVE-2026-34073)
- pygments 2.19.2 → 2.20.0 (fixes CVE-2026-4539)
- onnx 1.20.1 → 1.21.0 (fixes 6 CVEs)
- couchbase 4.5.0 → 4.6.0 (fixes PYSEC-2023-235)

Temporarily ignored CVEs (cannot be fixed without upstream changes):
- CVE-2025-69872 (diskcache): no fix available, latest version
- CVE-2026-25645 (requests): needs 2.33.0, blocked by crewai-tools pin
- CVE-2026-27448/27459 (pyopenssl): needs 26.0.0, blocked by
  snowflake-connector-python pin
- PYSEC-2023-235 (couchbase): advisory not yet updated for 4.6.0

* chore: remove accidentally committed egg-info files

* ci: remove Snyk job, pip-audit is sufficient

pip-audit covers Python dependency CVE scanning against PyPI Advisory DB
and OSV, which is all we need for pre-release checks. Snyk adds
complexity (account setup, token management) without meaningful
additional coverage for this use case.

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-04-03 01:44:44 -03:00
Greyson LaLonde
5179b411cd Merge branch 'main' into chore/runtime-state-event-bus 2026-04-03 12:43:14 +08:00
Greyson LaLonde
9ab85e642c refactor: make CrewAgentExecutorMixin a proper base class with Fields instead of PrivateAttr properties 2026-04-03 12:41:13 +08:00
Greyson LaLonde
743ebedd1b fix: preserve kickoff_event_id on resume, verbose already works 2026-04-03 12:21:05 +08:00