feat: /compress with focus topic in Web UI (replace /compact, add transcript-aware UX) - #619
franksong2702 wants to merge 14 commits into
Conversation
27be242 to
a7169f7
Compare
|
Looping in @aronprins here as well since a big part of this PR is the transcript-side UX for manual |
a7169f7 to
474a321
Compare
|
@franksong2702 looking good! For the compression complete message ,can you do it similar to a "thinking" card but colored green (not sure if there is a success state yet, if not add it based on existing color schemes) so that it too collapses once completed? |
yeah I see what u mean……working on it |
|
@aronprins implemented this direction on the compress flow:\n\n- the completion state now uses the transcript-style card treatment instead of a one-off toast\n- it has the green success styling and collapsible behavior like the thinking card pattern\n- the running state was also aligned to the transcript dot treatment so the whole manual flow reads consistently in the timeline\n\nThe updated UX is now part of the draft PR and matches the transcript redesign much more closely. |
|
@aronprins implemented this direction on the compress flow:
The updated UX is now part of the draft PR and matches the transcript redesign much more closely. |
Review:
|
|
I agree to merge this PR as-is from an overall UX/behavior perspective. I’m taking the follow-up correction items into issue #629 (including any remaining styling/polish items like spacing/consistency and theme/color variable follow-up) rather than expanding scope here. So this PR can be merged. |
|
@franksong2702 — confirmed. The condition from my earlier review ("ready to merge once the margin polish question is resolved or confirmed as tracked in #629") is now met. #629 is filed and you've acknowledged it. PR #619 is merge-ready. ✅ |
|
New commit ( PR #619 remains merge-ready. ✅ The density alignment commit is a welcome polish addition. |
|
Added the requested follow-up note in documenting that the fallback uses word-count approximation (not true BPE token count) and is intentional for resilience. commit: b338189 on codex/issue-469-compress |
|
Done on the same 619 branch (commit b338189): added an explicit note on _fallback_estimate_messages_tokens_rough that the fallback uses word-count as a rough heuristic and is intentionally approximate (non-BPE / not exact token counting), for resilience when metadata helpers are unavailable. |
|
Update: PR #619 now also includes the reference-card fallback recovery for compression completion. Merged on this branch:
So the polish and the small robustness fix stay together on the same PR chain, and #629 is treated as a closed follow-up once this lands. |
|
Parameter diff:
So the screenshot diff is intentionally subtle: slightly looser spacing and a lighter command card weight to better match the running/completion/reference cards. |
|
@nesquena @aronprins PR #619 now includes the #629 polish fixes as well, including the reference-card fallback recovery. If everything looks good on your side, please review this one PR and we can merge it in one shot. |
|
Re-reviewing after the latest commits (b338189, d986f6f, 015a66a). What's been added since my last pass
OverallAll three open points from the review thread are now addressed in-PR:
PR #619 is ready to merge. ✅ The decision to land #629 fixes directly here rather than as a follow-up is the right call — keeps the feature cohesive. |
Independent End-to-End Review — PR #619Independent fourth-pass review after the three prior approvals. Feature PR, 1249 additions across 10 files. Parallelized security audit and test run; found one minor hardening that I pushed. TL;DRMerge-ready after rebase onto current master. Feature is well-scoped, tests green, security clean. Pushed one small defensive cap on Test results ✅
Security audit ✅Traced every user-input and rendering path. Clean.
Follow-up pushed (
|
| Aspect | Status |
|---|---|
| Tests | ✅ 1322 passed, 0 failed (3 new sprint46 tests) |
| Security | ✅ Clean (focus_topic cap added as minor hardening) |
| Auth/CSRF | ✅ Inherited correctly |
| XSS in new card rendering | ✅ All user input escaped |
| Session metadata persistence | ✅ Bounds-checked on read |
| Prior review items (fallback docs, density, reference fallback) | ✅ All addressed in commits b338189, 015a66a, d986f6f |
| Rebase on master | ⏳ Needed before merge |
| CHANGELOG + version bump | ⏳ Add after rebase (v0.50.81 suggested) |
Merge-ready pending rebase. The feature is cohesive, well-tested, and the prior reviewers' feedback is all addressed. Thanks @franksong2702 for the thorough UX iteration and @aronprins for the card-design feedback. Great collaboration pattern in this PR.
Review — merge-ready after one CSS fixFull end-to-end review complete. The feature is well-implemented. One bug required a fix before merge: Bug:
Fixed by replacing Also added: CHANGELOG entry for v0.50.82 describing the What looks good:
Minor items tracked in #629 (not blocking this PR):
Test results: 4 failed (pre-existing test_sprint34.py), 1372 passed. Clean. The fix commit is on the integration branch. This PR is ready for independent review and merge. |
…469 (PR #619) POST /api/session/compress runs real compression via the agent's context_compressor. Accepts optional focus_topic (capped at 500 chars). Replaces the old /compact agent-message hack with a proper transcript-inline UX: command card (gold), running card (blue, animated), collapsible complete card (green, shows delta), reference card (full compaction summary). /compact is kept as an alias. Fallback token estimation uses word-count (intentional, for resilience). Fix (review): var(--green) was undefined on all themes — replaced with #4ec984. Fix (review): focus_topic capped at 500 chars (fc0ec04 by @nesquena). Co-Authored-By: franksong2702 <138988108+franksong2702@users.noreply.github.com> Co-Authored-By: Nathan Esquenazi <nesquena@gmail.com>
…469 (PR #619 by @franksong2702) POST /api/session/compress with optional focus_topic. Transcript-inline cards: command, running, complete (collapsible green), reference. /compact alias kept. Fixes: var(--green) undefined color, focus_topic 500-char cap. Independent review by @nesquena (4 passes).
|
Merged via integration branch #663 as commit b49de92 (v0.50.82). Full attribution to @franksong2702 for this substantial feature PR — the /compress flow, transcript cards, and /compact alias are all working. Thanks also to @aronprins for the UX feedback on the completion card styling. |
…esquena#469 (PR nesquena#619 by @franksong2702) POST /api/session/compress with optional focus_topic. Transcript-inline cards: command, running, complete (collapsible green), reference. /compact alias kept. Fixes: var(--green) undefined color, focus_topic 500-char cap. Independent review by @nesquena (4 passes).
…esquena#469 (PR nesquena#619 by @franksong2702) POST /api/session/compress with optional focus_topic. Transcript-inline cards: command, running, complete (collapsible green), reference. /compact alias kept. Fixes: var(--green) undefined color, focus_topic 500-char cap. Independent review by @nesquena (4 passes).














Thinking Path
/compress [focus topic]as the canonical manual compression entry point, with/compactkept only as a compatibility alias.What Changed
Command behavior
/compress [focus topic]as the primary manual compression command./compactas a legacy alias for compatibility./compressmatches CLI wording and/compactis clearly labeled as the old alias.Manual compression UX
CommandCompressingCompression completeContext compaction / Reference only/compressis sent.Transcript anchoring / persistence
Reference onlycard persists.Backend integration
POST /api/session/compresspath.focus_topicis passed through to the context compressor.Why It Matters
This makes manual compression feel like a first-class interaction rather than a hidden backend action.
Users now get:
That brings the WebUI much closer to the intended CLI-style manual compression workflow.
Verification
Automated
node --check static/ui.jsnode --check static/commands.jsnode --check static/messages.jsuv run --with pytest --with requests --with pyyaml pytest tests/test_sprint46.py -qManual
Verified in the browser that:
/compressshows immediate running feedback/compress [focus topic]preserves focus-topic context/compactstill works as a compatibility aliasReference onlycard is collapsed by default, expandable, and copyableRisks / Follow-ups
Model Used
Images
This is a net-new interaction rather than a replacement of an existing UI flow, so the attached images show the main states of the feature rather than a traditional before/after pair:
(Images to be attached in the GitHub UI.)