Skip to content

Experimental/1.1.8#16

Merged
jolovicdev merged 3 commits intomasterfrom
experimental/1.1.8
Feb 20, 2026
Merged

Experimental/1.1.8#16
jolovicdev merged 3 commits intomasterfrom
experimental/1.1.8

Conversation

@jolovicdev
Copy link
Copy Markdown
Owner

Summary

This PR ships the 1.1.8 runtime refactor focused on faster execution paths, cleaner sync/async ergonomics, and stronger correctness around pause/resume and event delivery.

What changed

  • Added Desk.aresume() for async resume flows across workers, workforces, and flows.
  • Reworked WorkerSession.stream_run() and WorkerSession.astream_run() to stream events in real time and persist session history safely on completion.
  • Refactored tool execution internals to remove sync/async duplication while keeping retries, timeout/cancel behavior, and pre/post hooks consistent.
  • Upgraded EventBus with:
  • wildcard subscriptions via *
  • unsubscribe(...)
  • aemit(...) parity for wildcard handlers
  • pending async handler drain support (await_pending())
  • Added collaborate-mode parallel execution for safe cases (tool-less workers) to reduce latency.
  • Strengthened workforce correctness:
  • managed mode no longer falls through into collaborate logic
  • parallelization is now job-aware (tools_override) to prevent unsafe pause/resume behavior
  • sync parallel path now guards running event loops with actionable errors
  • sync parallel path drains async event handlers before loop teardown (prevents dropped events)
  • Improved SQLite run store event path with buffered flush primitives while preserving immediate durability semantics for add_event(...).
  • Updated docs and coding-agent example to match new event/session/workforce behavior.
  • Updated dependencies/version for release:
  • blackgeorge -> 1.1.8
  • litellm minimum -> >=1.81.13

Why

  • Lower collaborate latency without sacrificing deterministic behavior.
  • Make async resume a first-class API.
  • Eliminate subtle regressions around event delivery and resume state.
  • Keep session streaming predictable and production-safe.

Verification

  • uv run ruff check .
  • uv run mypy src
  • uv run pytest -q
  • Final result: 204 passed

Notes

  • This PR adds a lot of regression coverage (especially workforce/session/store paths), so net LOC increased primarily due to tests and safety guards.
  • No intended breaking API changes; this extends behavior and hardens existing semantics.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7465e00ede

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +406 to +409
if self._can_parallelize_collaborate(job):
_ensure_not_running_loop("run", "arun")
report, parallel_state = asyncio.run(
self._arun_collaborate_parallel(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve sync adapter compatibility in collaborate run

This branch routes synchronous run() through _arun_collaborate_parallel, which in turn uses _arun_worker/worker.arun and therefore adapter.acomplete; as a result, sync collaborate runs now depend on async adapter methods. Any BaseModelAdapter implementation that only supports complete(...) (previously sufficient for sync entrypoints) will now fail in this common path, turning successful sync workloads into failures. Keep the existing sync worker path as a fallback when async completion is not implemented.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex In async worker execution, WorkerRunner explicitly falls back from adapter.acomplete(...) to adapter.complete(...) on NotImplementedError:
- src/blackgeorge/worker_runner.py:233
- src/blackgeorge/worker_runner.py:246

  • Same fallback exists for streaming path:
    • src/blackgeorge/worker_runner.py:289
    • src/blackgeorge/worker_runner.py:302
      false positive 99%

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Added a new SyncOnlyAdapter test double that implements only complete(...) (no acomplete(...)) to model backward-compatible sync-only adapters explicitly. tests/test_workforce.pyL182-L203
  • Added a regression test test_workforce_sync_parallel_supports_sync_only_adapter to verify Desk.run() in collaborate-mode parallel execution still succeeds and uses the sync adapter path correctly. tests/test_workforce.pyL269-L281
  • Committed the change as test: add sync-only adapter coverage for collaborate parallel run and created a follow-up PR message via the make_pr tool.

Testing

  • uv run pytest tests/test_workforce.py::test_workforce_sync_parallel_supports_sync_only_adapter -v
  • uv run pytest tests/test_workforce.py::test_workforce_sync_parallel_drains_async_event_handlers tests/test_workforce.py::test_workforce_sync_parallel_supports_sync_only_adapter -v
  • uv run ruff check tests/test_workforce.py

View task →

@jolovicdev jolovicdev merged commit cc0ebdd into master Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant