Skip to content

Collapse large pastes; remove stale queued-message notice - #7

Open
MathiTz wants to merge 2 commits into
mainfrom
fix/tool-loop-tag-leaks-and-message-queue
Open

Collapse large pastes; remove stale queued-message notice#7
MathiTz wants to merge 2 commits into
mainfrom
fix/tool-loop-tag-leaks-and-message-queue

Conversation

@MathiTz

@MathiTz MathiTz commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #6 (already merged): two small composer/queueing UX fixes that landed on the same branch after that PR was merged, so they need their own PR.

Changes

  • Paste collapse (ui/tui.py): pasting more than 100 characters into the chat composer now collapses to a [LINES N] placeholder instead of dumping the raw text inline. The real content is tracked internally and substituted back in on submit, so the model still receives the full text. Duplicate same-line-count pastes in one draft get distinct placeholders ([LINES N], [LINES N#2], ...).
  • Queued-notice cleanup (ui/tui.py): the "📥 Queued (#N) — will run once the current task finishes" notice now gets removed from the chat log once that queued message is dequeued and starts running (or discarded, with its notice removed, if the run is cancelled). Previously it stayed in the log indefinitely even after being consumed.

Testing

Full test suite passes locally: PYTHONPATH=. .venv/bin/pytest tests/ -q → 70 passed.

Co-Authored-By: Warp agent@warp.dev

MathiTz and others added 2 commits August 23, 2026 01:45
Pasting something long (e.g. a stack trace, file content, or diff) used to
dump the entire text inline into the composer, making it unreadable and
pushing the actual prompt out of view.

- ChatComposer.on_paste: pastes over PASTE_COLLAPSE_THRESHOLD (100 chars)
  are collapsed to a "[LINES N]" placeholder instead of being inserted
  verbatim; shorter pastes are inserted as before.
- The real pasted text is tracked internally and substituted back in when
  the message is submitted (Enter/Ctrl+S), so the model still receives the
  full original content - only the on-screen composer is compressed.
- Same-line-count pastes within one draft get distinct placeholders
  (`[LINES N]`, `[LINES N#2]`, ...) so each expands back to its own text.
- Added tests in tests/test_composer.py covering collapse, the threshold
  boundary, expansion on submit, and disambiguation of duplicate placeholders.

Co-Authored-By: Warp <agent@warp.dev>
ChatPane now tracks each "📥 Queued (#N)" SystemMessage widget in
self._queued_notices, parallel to self.state.message_queue. When a queued
prompt is dequeued and starts its turn, the matching notice is removed from
the chat log instead of staying there indefinitely. Notices for prompts
discarded on cancellation are removed the same way.

Co-Authored-By: Warp <agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant