Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Changelog

## Unreleased
## 0.4.26.2 (2026-04-24)

<<<<<<< HEAD
Parity catch-up with upstream `4.26.0`. No upstream version change.

### New public APIs
Expand Down Expand Up @@ -78,7 +77,7 @@ Parity catch-up with upstream `4.26.0`. No upstream version change.

### Fixes

- **`Plan.update_task(input)` / `StreamingPlan.update_task(input)` now honor `input.id`** — previously only worked on the last in-progress task; with `id` set, targets that specific task and returns `None` for unknown IDs. Matches upstream `UpdateTaskInput` semantics.
- **`Plan.update_task(input)` now honors `input.id`** — previously only worked on the last in-progress task; with `id` set, targets that specific task and returns `None` for unknown IDs. Matches upstream `UpdateTaskInput` semantics.
- **`Plan.add_task()` / `update_task()` now propagate `adapter.edit_object` errors** — previously swallowed and logged; upstream returns the chained promise so callers see failures.
- **Plan edit queue is now actually sequential under concurrency** — previously racy under `asyncio.gather`; rewrote `_enqueue_edit` to build the chain synchronously before awaiting, matching upstream TS's `.then`-based chain. Fixes out-of-order edits when multiple `add_task`/`update_task` calls interleave.
- **`StreamingPlan` options now wired through `Thread.post()`** — the Python
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "chat-sdk"
version = "0.4.26.1"
version = "0.4.26.2"
description = "Multi-platform async chat SDK for Python — port of Vercel Chat"
readme = "README.md"
license = {text = "MIT"}
Expand Down
3 changes: 3 additions & 0 deletions src/chat_sdk/adapters/slack/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,9 @@ async def _handle_block_suggestion(
# Use asyncio.shield so the orphaned task still runs (and logs errors)
# if we time out. `wait_for` cancels the awaitable on timeout; shielding
# prevents that cancellation from propagating into the handler task.
# Use asyncio.ensure_future — process_options_load is typed as returning
# Awaitable (matching sibling process_* methods on the ChatInstance
# Protocol); create_task() would require narrowing to Coroutine.
load_task = asyncio.ensure_future(self._chat.process_options_load(event, options))

try:
Expand Down
17 changes: 5 additions & 12 deletions tests/test_thread_faithful.py
Original file line number Diff line number Diff line change
Expand Up @@ -1747,18 +1747,11 @@ class TestPostWithPlan:

Ported from TS thread.test.ts to close the fidelity gap tracked in #55.

Note: a few tests in this block expose known behavior gaps between the
current Python ``Plan`` implementation and the upstream TS version:

* ``UpdateTaskInput`` in ``plan.py`` has no ``id`` field, so looking up
a task by id via ``update_task({"id": ...})`` is not supported.
* ``_enqueue_edit`` swallows adapter errors instead of propagating them
to the caller (upstream returns the chained promise, which rejects).
* The edit chain is rebuilt post-await rather than synchronously, which
does not preserve strict ordering under ``asyncio.gather``.

Those tests are skipped with a pointer back here so the gaps remain
visible for a follow-up fix rather than silently drifting.
All 20 tests port their upstream ``thread.test.ts`` counterparts
1:1. The three behavior gaps that originally surfaced during the
port — ``UpdateTaskInput.id``, ``_enqueue_edit`` error propagation,
and synchronous chain registration under ``asyncio.gather`` — have
all been fixed in ``plan.py`` as part of this PR (#75).
"""

# it("should post fallback text when adapter does not support plans")
Expand Down
Loading