fix(cli): prevent paste detection from destroying multi-line input - #84
Merged
teknium1 merged 1 commit intoFeb 27, 2026
Merged
Conversation
The _on_text_changed handler collapsed buffer contents into a file reference whenever the buffer had 5+ newlines, regardless of how those lines were entered. This meant manually typing with Alt+Enter would trigger the paste heuristic and silently replace the user's carefully typed input. Track the previous buffer length and only treat a change as a paste when more than one character is added at once (real pastes insert many characters in a single event, while typing adds one at a time).
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…n-false-positive fix(cli): prevent paste detection from destroying multi-line input
dizhaky
referenced
this pull request
in dizhaky/hermes-agent
Jun 23, 2026
…AN-1385) (#26) baileys 7.0.0-rc.9->rc13 (clears #43 critical) + protobufjs 7.6.4 (#59,#58) in whatsapp-bridge; esbuild+tsx (#46,#61) in ui-tui; @babel/core (#84) in web; joi+http-proxy-middleware (#51,#89) in website. js-yaml #86 accepted (no in-range fix via gray-matter). Bridge startup verified. #93/#94 (code fixes) separate. Co-Authored-By: Claude <noreply@anthropic.com>
Meraniya
pushed a commit
to Meraniya/hermes-agent
that referenced
this pull request
Aug 6, 2026
sijav
added a commit
to sijav/sijav-agent
that referenced
this pull request
Aug 7, 2026
…n region 2401-3999 (rc-slice-B) + revert 2 defeated pragmas
Slice B: 52 tests, 0 missing lines / 0 missing branches across the assigned
region. Independent roast NOT-PASSed the first cut (8.9/8.5/9.2) and defeated
two of the pragmas with empirical receipts; this commit fixes all of it.
Reverted pragmas (the guards are REACHABLE, now covered by real tests):
* 3576 api_messages re-sanitize — _sync_failover_system_message (988-992)
rewrites api_messages[0] from the still-dirty _cached_system_prompt/
ephemeral_system_prompt INSIDE the retry loop (2146), which never re-runs
the proactive walk at ~1832 (that walk belongs to the OUTER loop, 1415).
* 3584 api_kwargs re-sanitize — nothing sanitizes agent.tools and build_kwargs
stores it BY REFERENCE, so a surrogate in a tool-schema description reaches
api_kwargs (MCP descriptions come from json.loads, which materializes
\ud800 escapes as real lone surrogates).
Both replaced with source comments explaining the reachability, plus a third
vector found while closing the region: prefill_messages are spliced as shallow
copies (1776) so the SOURCE list stays dirty. Product gap filed (NousResearch#85).
Strengthened three line-hit-only tests exposed by surviving mutants:
* MoA reference-usage fold — now asserts the enqueued totals (110/55) via
queue_token_counts.call_args, so gutting the fold fails.
* content-filter rollback — now asserts the partial continuation text
(part1/part2) does not survive into the fallback's history.
* codex incomplete — the mapping at 2766-2774 is dead-in-effect (filed NousResearch#84);
the docstring now states that honestly and a new test drives the real
continuation via the transport's normalize result.
Corrected two false docstrings that claimed arcs which do not fire.
Bugs filed from this pass: NousResearch#83 (mixed return arity landmine), NousResearch#84 (codex
incomplete mapping overwritten before its only consumer), NousResearch#85 (three
un-sanitized surrogate surfaces costing a wasted API call per turn).
Full tests/run_agent suite: 1704 passed, 4 skipped.
sijav
added a commit
to sijav/sijav-agent
that referenced
this pull request
Aug 7, 2026
…esearch#84) The comment claimed this assignment routes Codex incomplete turns away from the generic chat-completions length rollback and into the Codex continuation. It does neither. Re-traced independently: the value set here governs only the window ending at the unconditional `finish_reason = normalized.finish_reason`, and inside that window finish_reason is compared ONLY against "content_filter" and "length". "incomplete" matches neither, making this arm behaviourally identical to the `else: "stop"` beneath it. What actually keeps Codex out of the length rollback is that this block never produces "length" at all. The continuation that consumes "incomplete" runs AFTER the overwrite and is driven by the transport's own normalize result (the Responses adapter derives it from response.status). Independently corroborated by a surviving mutation: removing "length" from the trigger set changes no observable behaviour — a true equivalent mutant rather than a weak test, which is why it went unnoticed. Kept rather than deleted: it is a correct, harmless pre-set that keeps the branch's intent legible and stays right if the overwrite is ever narrowed. The comment now states the honest scope and warns to verify against the overwrite before changing anything here. Comment-only, no behaviour change.
5 tasks
This was referenced Aug 10, 2026
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.
Summary
_on_text_changedtriggers whenever the buffer has 5+ newlines, regardless of how those lines were enteredReproduction
python cli.py)[Pasted text #1: 6 lines → ~/.hermes/pastes/...]