Skip to content

fix(gateway): make compress responses truthful - #6277

Closed
bobashopcashier wants to merge 1 commit into
NousResearch:mainfrom
bobashopcashier:fix/compress-response-truthfulness
Closed

fix(gateway): make compress responses truthful#6277
bobashopcashier wants to merge 1 commit into
NousResearch:mainfrom
bobashopcashier:fix/compress-response-truthfulness

Conversation

@bobashopcashier

@bobashopcashier bobashopcashier commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make /compress detect when the transcript is still fully protected and return a truthful no-op message instead of reporting fake success
  • relabel the success token line as a rough transcript estimate so it is not presented like a real pressure or provider-usage metric
  • add focused gateway tests for the no-op and successful compression paths

Related

Why

  • /compress could report success even when no middle segment was actually compressible
  • the success response implied the rough transcript heuristic was a real token/pressure measurement
  • this PR checks compressibility before calling _compress_context(), so the no-op path does not split sessions, rewrite transcripts, or reset stored token counts

Notes On Related PR

Testing

  • source .venv/bin/activate && pytest tests/gateway/test_compress_command.py -q

Notes

  • left unrelated local worktree changes out of this PR

@bobashopcashier
bobashopcashier marked this pull request as ready for review April 8, 2026 20:25
@bobashopcashier
bobashopcashier force-pushed the fix/compress-response-truthfulness branch from ba6a9bf to b8afcc1 Compare April 9, 2026 22:05
@bobashopcashier

Copy link
Copy Markdown
Contributor Author

Closing to reopen as a refreshed PR that follows the current contributing guide and PR template.

@bobashopcashier

Copy link
Copy Markdown
Contributor Author

Superseded by #6944, reopened on a fresh branch with the current contributing-guide/template format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant