feat: expose compression no-op status - #309
stephenschoettler merged 4 commits into
Conversation
ec6e942 to
c82d228
Compare
|
Thanks for the PR. Could you update the description to match the repo template before I review? Please add:
The code can stay as-is. This just makes review, release notes, and future archaeology easier. |
|
@TurgutKural @stephenschoettler I checked this against current My read: this is a legit small contract fix, not placebo. The underlying no-op state already exists and is already set by LCM in the relevant paths ( That is in line with the goal of LCM: the engine owns deterministic context-boundary decisions, and the host should be able to observe whether a compaction boundary was real or intentionally skipped without poking private implementation state. It does not change compression behavior or make LCM semantically smarter; it just makes the existing decision inspectable by host/runtime code. Validation I ran on
One process note: the PR body still uses |
|
@Tosko4 @stephenschoettler updated. |
|
@TurgutKural thanks, confirmed the PR description is updated. One clarification for review: the code head for this PR is still The actual host-side bug fix for “plugin no-op should not be treated as a successful compression boundary / session split” is the linked Hermes Agent PR: NousResearch/hermes-agent#58495. So my read is:
@stephenschoettler flagging that distinction explicitly so the LCM-side review stays scoped correctly. |
|
Please rebase this onto current main and rerun the focused validation. I want to review this on a current branch before deciding whether it is merge-ready. |
|
@codex review Current head: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fb3d9e922
ℹ️ 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".
| def last_compression_was_noop(self) -> bool: | ||
| """Whether the most recent compression/preflight decision was a no-op.""" | ||
| return self._last_compression_status == "noop" |
There was a problem hiding this comment.
Reset stale no-op status before positive preflights
If a session first hits a preflight no-op (for example, only the fresh tail is over threshold) and a later call to should_compress_preflight(...) becomes eligible, this property still reports True because the positive preflight paths return without clearing _last_compression_status or the no-op reason. A host using the new public flag immediately after preflight can therefore misclassify the next real compaction boundary as an LCM no-op until compress() starts. Please clear or update the status/reason on positive preflight decisions before exposing this flag.
Useful? React with 👍 / 👎.
stephenschoettler
left a comment
There was a problem hiding this comment.
Approved for merge under Stephen approval: reviewer gate t_9eb57f4e passed final head and verified the stale no-op blocker is fixed; CI is green. The remaining Codex thread is stale/non-material against this head.
Summary
last_compression_status,last_compression_noop_reason, andlast_compression_was_noopproperties._last_compression_*fields.Why
Validation
PYTHONPATH=/path/to/Hermes-Agent python3 -m pytest tests/test_lcm_engine.py::test_lcm_tool_status_includes_optional_cache_usage_metrics tests/test_lcm_engine.py::TestEngineABC::test_preflight_does_not_request_compaction_when_only_fresh_tail_is_over_threshold -q->2 passedpytest tests/test_lcm_core.py tests/test_lcm_engine.py tests/test_packaging_install.py -qpytest -qbash -lc 'ulimit -n 1024 && pytest -q'python -m compileall -q .python -m py_compile scripts/import_lossless_claw.pybash -n scripts/install.sh scripts/update.shgit diff --check-> cleanNotes
Refs #