feat(cli,sdk): compaction hook - #1420
Merged
Merged
Conversation
ccurme (ccurme)
left a comment
Contributor
There was a problem hiding this comment.
Do we provide any feedback to the model as to the percent of token budget used?
Might be worth an experiment, even without a working tool implementation, to see how / when it elects to compact.
ccurme (ccurme)
approved these changes
Feb 27, 2026
ccurme (ccurme)
left a comment
Contributor
There was a problem hiding this comment.
Excluded SummarizationToolMiddleware from default middleware stack until 0.5 release (needs testing in AB frontend).
james8814
pushed a commit
to james8814/deepagents
that referenced
this pull request
Mar 1, 2026
Mason Daugherty (mdrxy)
added a commit
that referenced
this pull request
Mar 2, 2026
Mason Daugherty (mdrxy)
added a commit
that referenced
this pull request
Mar 3, 2026
🤖 I have created a release *beep* *boop* --- ## [0.0.26](deepagents-cli==0.0.25...deepagents-cli==0.0.26) (2026-03-03) ### Features * Compaction hook ([#1420](#1420)) ([e87cdad](e87cdad)) * `/compact` command ([#1579](#1579)) ([46e9e95](46e9e95)) * Add `--profile-override` CLI flag ([#1605](#1605)) ([1984099](1984099)) * Add model profile overrides to config ([#1603](#1603)) ([d3d6899](d3d6899)) * Show summarization status and notification ([#919](#919)) ([2e3cb74](2e3cb74)) ### Bug Fixes * Fix image path pasting qualms ([#1560](#1560)) ([8caaf3e](8caaf3e)) * Load `.agents` skill alias directories at interactive startup ([#1556](#1556)) ([af0a759](af0a759)) * Coerce execute timeout to int before formatting tool display ([#1588](#1588)) ([04b8c72](04b8c72)), closes [#1586](#1586) * Add missing flags to help screen ([#1619](#1619)) ([6067749](6067749)) * Align compaction messaging across `/compact` and `compact_conversation` ([#1583](#1583)) ([d455a6b](d455a6b)) * Apply profile overrides in `/compact` ([#1612](#1612)) ([a9dc2c5](a9dc2c5)) * Disambiguate `/tokens` vs `/compact` token reporting ([#1618](#1618)) ([51c3347](51c3347)) * Make LangSmith URL lookups non-blocking ([#1595](#1595)) ([572eaee](572eaee)) * Only exit input mode on backspace, not text clear ([#1479](#1479)) ([da0965e](da0965e)) * Retry langsmith project url lookup until project exists ([#1562](#1562)) ([e137a63](e137a63)) * Show model info in `/tokens` before first usage ([#1607](#1607)) ([7b01ae7](7b01ae7)) * Support `timeout=0` for sandbox `execute()` ([#1558](#1558)) ([ed14443](ed14443)) * Unreachable `except` block ([#1535](#1535)) ([0e17e35](0e17e35)) ### Performance Improvements * Optimize thread resume path with prefetch and batched hydration ([#1561](#1561)) ([068d112](068d112)) * Parallelize detection scripts for faster first-turn ([#1541](#1541)) ([dad8b6e](dad8b6e)) * Speed up `/threads` first-open ([#1481](#1481)) ([b248b15](b248b15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mason Daugherty <github@mdrxy.com>
james8814
pushed a commit
to james8814/deepagents
that referenced
this pull request
Mar 6, 2026
🤖 I have created a release *beep* *boop* --- ## [0.0.26](langchain-ai/deepagents@deepagents-cli==0.0.25...deepagents-cli==0.0.26) (2026-03-03) ### Features * Compaction hook ([langchain-ai#1420](langchain-ai#1420)) ([e87cdad](langchain-ai@e87cdad)) * `/compact` command ([langchain-ai#1579](langchain-ai#1579)) ([46e9e95](langchain-ai@46e9e95)) * Add `--profile-override` CLI flag ([langchain-ai#1605](langchain-ai#1605)) ([1984099](langchain-ai@1984099)) * Add model profile overrides to config ([langchain-ai#1603](langchain-ai#1603)) ([d3d6899](langchain-ai@d3d6899)) * Show summarization status and notification ([langchain-ai#919](langchain-ai#919)) ([2e3cb74](langchain-ai@2e3cb74)) ### Bug Fixes * Fix image path pasting qualms ([langchain-ai#1560](langchain-ai#1560)) ([8caaf3e](langchain-ai@8caaf3e)) * Load `.agents` skill alias directories at interactive startup ([langchain-ai#1556](langchain-ai#1556)) ([af0a759](langchain-ai@af0a759)) * Coerce execute timeout to int before formatting tool display ([langchain-ai#1588](langchain-ai#1588)) ([04b8c72](langchain-ai@04b8c72)), closes [langchain-ai#1586](langchain-ai#1586) * Add missing flags to help screen ([langchain-ai#1619](langchain-ai#1619)) ([6067749](langchain-ai@6067749)) * Align compaction messaging across `/compact` and `compact_conversation` ([langchain-ai#1583](langchain-ai#1583)) ([d455a6b](langchain-ai@d455a6b)) * Apply profile overrides in `/compact` ([langchain-ai#1612](langchain-ai#1612)) ([a9dc2c5](langchain-ai@a9dc2c5)) * Disambiguate `/tokens` vs `/compact` token reporting ([langchain-ai#1618](langchain-ai#1618)) ([51c3347](langchain-ai@51c3347)) * Make LangSmith URL lookups non-blocking ([langchain-ai#1595](langchain-ai#1595)) ([572eaee](langchain-ai@572eaee)) * Only exit input mode on backspace, not text clear ([langchain-ai#1479](langchain-ai#1479)) ([da0965e](langchain-ai@da0965e)) * Retry langsmith project url lookup until project exists ([langchain-ai#1562](langchain-ai#1562)) ([e137a63](langchain-ai@e137a63)) * Show model info in `/tokens` before first usage ([langchain-ai#1607](langchain-ai#1607)) ([7b01ae7](langchain-ai@7b01ae7)) * Support `timeout=0` for sandbox `execute()` ([langchain-ai#1558](langchain-ai#1558)) ([ed14443](langchain-ai@ed14443)) * Unreachable `except` block ([langchain-ai#1535](langchain-ai#1535)) ([0e17e35](langchain-ai@0e17e35)) ### Performance Improvements * Optimize thread resume path with prefetch and batched hydration ([langchain-ai#1561](langchain-ai#1561)) ([068d112](langchain-ai@068d112)) * Parallelize detection scripts for faster first-turn ([langchain-ai#1541](langchain-ai#1541)) ([dad8b6e](langchain-ai@dad8b6e)) * Speed up `/threads` first-open ([langchain-ai#1481](langchain-ai#1481)) ([b248b15](langchain-ai@b248b15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mason Daugherty <github@mdrxy.com>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
Closes langchain-ai#1073 Finishes work started in langchain-ai#1420 ---
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
🤖 I have created a release *beep* *boop* --- ## [0.0.26](langchain-ai/deepagents@deepagents-cli==0.0.25...deepagents-cli==0.0.26) (2026-03-03) ### Features * Compaction hook ([langchain-ai#1420](langchain-ai#1420)) ([e87cdad](langchain-ai@e87cdad)) * `/compact` command ([langchain-ai#1579](langchain-ai#1579)) ([46e9e95](langchain-ai@46e9e95)) * Add `--profile-override` CLI flag ([langchain-ai#1605](langchain-ai#1605)) ([1984099](langchain-ai@1984099)) * Add model profile overrides to config ([langchain-ai#1603](langchain-ai#1603)) ([d3d6899](langchain-ai@d3d6899)) * Show summarization status and notification ([langchain-ai#919](langchain-ai#919)) ([2e3cb74](langchain-ai@2e3cb74)) ### Bug Fixes * Fix image path pasting qualms ([langchain-ai#1560](langchain-ai#1560)) ([8caaf3e](langchain-ai@8caaf3e)) * Load `.agents` skill alias directories at interactive startup ([langchain-ai#1556](langchain-ai#1556)) ([af0a759](langchain-ai@af0a759)) * Coerce execute timeout to int before formatting tool display ([langchain-ai#1588](langchain-ai#1588)) ([04b8c72](langchain-ai@04b8c72)), closes [langchain-ai#1586](langchain-ai#1586) * Add missing flags to help screen ([langchain-ai#1619](langchain-ai#1619)) ([6067749](langchain-ai@6067749)) * Align compaction messaging across `/compact` and `compact_conversation` ([langchain-ai#1583](langchain-ai#1583)) ([d455a6b](langchain-ai@d455a6b)) * Apply profile overrides in `/compact` ([langchain-ai#1612](langchain-ai#1612)) ([a9dc2c5](langchain-ai@a9dc2c5)) * Disambiguate `/tokens` vs `/compact` token reporting ([langchain-ai#1618](langchain-ai#1618)) ([51c3347](langchain-ai@51c3347)) * Make LangSmith URL lookups non-blocking ([langchain-ai#1595](langchain-ai#1595)) ([572eaee](langchain-ai@572eaee)) * Only exit input mode on backspace, not text clear ([langchain-ai#1479](langchain-ai#1479)) ([da0965e](langchain-ai@da0965e)) * Retry langsmith project url lookup until project exists ([langchain-ai#1562](langchain-ai#1562)) ([e137a63](langchain-ai@e137a63)) * Show model info in `/tokens` before first usage ([langchain-ai#1607](langchain-ai#1607)) ([7b01ae7](langchain-ai@7b01ae7)) * Support `timeout=0` for sandbox `execute()` ([langchain-ai#1558](langchain-ai#1558)) ([ed14443](langchain-ai@ed14443)) * Unreachable `except` block ([langchain-ai#1535](langchain-ai#1535)) ([0e17e35](langchain-ai@0e17e35)) ### Performance Improvements * Optimize thread resume path with prefetch and batched hydration ([langchain-ai#1561](langchain-ai#1561)) ([068d112](langchain-ai@068d112)) * Parallelize detection scripts for faster first-turn ([langchain-ai#1541](langchain-ai#1541)) ([dad8b6e](langchain-ai@dad8b6e)) * Speed up `/threads` first-open ([langchain-ai#1481](langchain-ai#1481)) ([b248b15](langchain-ai@b248b15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mason Daugherty <github@mdrxy.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add two paths for conversation compaction — a
compact_conversationtool that the agent can invoke proactively, and a/compactslash command for manual use.Both operate using
SummarizationMiddlewareinternals, writing a summarization event into checkpointed state so older messages are virtually hidden without deletion.Full history is written to backend storage before compaction (when possible).