Skip to content

Fix seven reproducible issues from automated triage - #918

Closed
1jehuang wants to merge 7 commits into
masterfrom
agent/triage-safe-fixes-20260813
Closed

1jehuang wants to merge 7 commits into
masterfrom
agent/triage-safe-fixes-20260813

Conversation

@1jehuang

Copy link
Copy Markdown
Owner

Summary

  • add explicit shared-server build promotion and native Windows self-dev Cargo execution
  • expand repeated paste placeholders and repair idle-animation buffer reseeding
  • deduplicate home/project AGENTS.md, clip skill descriptions safely, and preserve orphaned OpenRouter tool outputs

Fixes #908
Fixes #910
Fixes #911
Fixes #913
Fixes #914
Fixes #916
Fixes #917

Verification

  • cargo test -p jcode-build-support
  • cargo test -p jcode-base prompt
  • cargo test -p jcode-provider-openrouter
  • focused paste and idle-animation regression suites
  • cargo test -p jcode --lib server_promote_parses_default_and_explicit_version
  • cargo check -p jcode-build-support --target x86_64-pc-windows-gnu
  • git diff --check origin/master..HEAD

--- — Jcode agent (automated triage), on behalf of @1jehuang

@greptile-apps

greptile-apps Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This change adds repeat handling for large pasted text. A reproduced input-editing failure remains: after deleting a generated placeholder and typing the same text literally, repeating the original paste overwrites that user-authored text and discards the saved paste content.

Confidence Score: 4/5

The multiline paste workflow can overwrite user-authored input and lose the saved paste content.

One reproduced non-security functional failure remains in the paste-repeat behavior.

Files Needing Attention: crates/jcode-tui/src/tui/app/input.rs

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced a proof for a posted P1 finding about the focused multiline-paste literal replacement.
  • T-Rex produced a second proof for another posted P1 finding related to the same multiline-paste scenario.
  • The focused Rust test for multiline-paste literal replacement passed: 1 passed, 0 failed, and the related test source and output artifacts were prepared for review.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 Literal placeholder is indistinguishable from a deleted generated placeholder

    • Bug
      • The exact input path replaces a user-typed [pasted 5 lines] literal with the original five-line paste and deletes the matching item from pasted_contents.
    • Cause
      • expand_matching_paste uses only placeholder occurrence counts and placeholder text shape; after the original placeholder is deleted, a newly typed identical literal restores matching counts and is treated as the stored placeholder.
    • Fix
      • Track placeholder identity/ranges separately from rendered input text, or retain deletion-aware metadata so text typed after a placeholder deletion cannot be selected as that placeholder.

    T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
### Issue 1
crates/jcode-tui/src/tui/app/input.rs:830-835
**Retyped placeholder loses ownership**

Deleting a generated paste placeholder and then typing the same placeholder text literally restores the rendered/stored count equality that this guard relies on. Re-pasting the original multiline text then replaces the user-entered literal and removes its stored paste entry. Placeholder ownership needs to be tracked independently of its rendered text, or deletion must invalidate the associated stored placeholder.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (3): Last reviewed commit: "fix: avoid ambiguous paste placeholder e..." | Re-trigger Greptile

Comment thread crates/jcode-tui/src/tui/app/input.rs Resolved
@pradfer123

Copy link
Copy Markdown

May I fix

Comment on lines +830 to +835
let rendered_placeholder_count = app.input.match_indices(placeholder.as_str()).count();
// Placeholder text can also be typed by the user. If the rendered and
// stored counts differ, there is no reliable way to identify which
// occurrence belongs to this paste, so preserve both the input and store.
if rendered_placeholder_count != stored_placeholder_count {
return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Retyped placeholder loses ownership

Deleting a generated paste placeholder and then typing the same placeholder text literally restores the rendered/stored count equality that this guard relies on. Re-pasting the original multiline text then replaces the user-entered literal and removes its stored paste entry. Placeholder ownership needs to be tracked independently of its rendered text, or deletion must invalidate the associated stored placeholder.

Artifacts

Focused Rust test source for literal multiline-paste placeholder replacement

  • This authored test drives the initial five-line paste, backspace deletion, literal placeholder typing, and original-text re-paste path, demonstrating the exact behavior under test.

Focused multiline-paste literal replacement test output

  • This command output records the executed focused test, its exit code 0, and the before/after input and pasted-content states, confirming the literal was replaced and stored content removed.

View artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-tui/src/tui/app/input.rs
Line: 830-835

Comment:
**Retyped placeholder loses ownership**

Deleting a generated paste placeholder and then typing the same placeholder text literally restores the rendered/stored count equality that this guard relies on. Re-pasting the original multiline text then replaces the user-entered literal and removes its stored paste entry. Placeholder ownership needs to be tracked independently of its rendered text, or deletion must invalidate the associated stored placeholder.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@1jehuang

Copy link
Copy Markdown
Owner Author

Closing as superseded by the equivalent fixes already landed on master. I also re-reviewed the remaining paste-repeat delta: Greptile reproduced a case where deleting the generated placeholder and typing the same literal still lets repeat-paste overwrite user-authored text, so this branch is not safe to merge as-is. The focused follow-up should track placeholder identity rather than infer it from rendered text.

@1jehuang 1jehuang closed this Aug 17, 2026
@pradfer123

pradfer123 commented Aug 19, 2026 via email

Copy link
Copy Markdown

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