Commit 33d323c
authored
fix(code): thread
Fix `ty` failures in `deepagents-code` after the SDK's `summarization`
flow added a required `session_id: str` parameter in #5470 (`fix(sdk):
offload conversation history to distinct session ID when summarizing`).
The forced-compaction fork in `offload_middleware` mirrors the SDK's
`_run_compact`/`_arun_compact` step sequence, but still called
`_offload_to_backend` / `_aoffload_to_backend` / `_build_compact_result`
without the new argument, producing 5 `error[missing-argument]`
diagnostics under `make -C libs/code lint`. The fork now computes
`session_id = summarization._get_session_id(runtime.state)` — placed
after the cutoff-0 early return, exactly where the SDK computes it — and
threads it through both calls, in sync and async paths alike. A side
benefit: repeated `/offload` calls now reuse the persisted
`_summarization_session_id`, so history appends to one file per session
instead of fragmenting across thread-id-named files.
The `sdk_offload` wrapper in
`test_read_failure_never_reaches_truncating_archive_write` gains the
matching parameter; the rest of the test file only touches mocks or
existence guards, so no other call sites needed updating.
**Release note:** this change must not ship against `deepagents==0.7.5`.
It calls private SDK methods with the new `session_id` signature
introduced after 0.7.5, so the `deepagents-code` release must wait until
the SDK releases (pending `fix(sdk):` commit on `main`) and the pin in
`pyproject.toml` is bumped to that version in a separate `chore(deps):`
PR.session_id through forced-compaction fork (#5492)1 parent fa55c52 commit 33d323c
3 files changed
Lines changed: 16 additions & 9 deletions
File tree
- libs/code
- deepagents_code
- tests/unit_tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| 708 | + | |
708 | 709 | | |
709 | 710 | | |
710 | 711 | | |
711 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
712 | 715 | | |
713 | 716 | | |
714 | 717 | | |
715 | 718 | | |
716 | 719 | | |
717 | 720 | | |
718 | | - | |
| 721 | + | |
719 | 722 | | |
720 | 723 | | |
721 | 724 | | |
| |||
740 | 743 | | |
741 | 744 | | |
742 | 745 | | |
| 746 | + | |
743 | 747 | | |
744 | 748 | | |
745 | 749 | | |
746 | | - | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
747 | 753 | | |
748 | 754 | | |
749 | 755 | | |
750 | | - | |
| 756 | + | |
751 | 757 | | |
752 | 758 | | |
753 | 759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
540 | | - | |
| 540 | + | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| |||
0 commit comments