Repository navigation
docs(design): record clipboard helper ownership evidence and the open #231 decision - #386
Conversation
…ship (#231) Issue #231 is that a helper still running at the 150 ms fail-fast deadline is reported as a successful copy. The only sound facts a helper provides are exit 0 (accepted) and nonzero (failed); "still running" is unknown, and the resident-helper case on a healthy Linux desktop never produces an exit. There is no honest mapping of that unknown into a `bool`. Records the verified starting state (HEAD 63d49fa, parent and live origin/master ac34906, clean tree, PR #228 open), the exact defect site, all eight call sites that consume the boolean, the existing status-notice and handle_tick plumbing that a late correction would use, and the three candidate contracts. Recommends a deferred-notice contract plus optional read-back verification as the only genuine observation of "what does paste give me". Does not change production code: every candidate contract needs a product decision on what the UI shows while a copy is unconfirmed, and the only honest resolution (read-back) cannot be measured here because the module is Linux-only while this workstation is macOS and the build host is Windows/MSYS. Blockers B1 (unconfirmed-copy wording), B2 (read-back in scope?), B3 (no Linux desktop to validate real helper behaviour), B4 (depends on PR #228's parameterised window), B5 (image copy paths share the defect). tx-agent: jcode tx-validated: none tx-scope: docs/design/clipboard-helper-ownership.md tx-intent: give issue #231 a decision-ready, evidence-backed design without shipping a time-based success claim
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
| 6. **Call sites**: each replaces its `if success { set_status_notice(..) } else | ||
| { .. }` with a single `self.request_copy(text, success_text, failure_text)`. |
There was a problem hiding this comment.
Suggestion: The conversion only defers notices; cut_input_line_to_clipboard_with also records undo and clears input only on success, but the planned async request carries no such transition.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Incomplete implementation
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** docs/design/clipboard-helper-ownership.md
**Line:** 220:221
**Comment:**
*Incomplete Implementation: The conversion only defers notices; `cut_input_line_to_clipboard_with` also records undo and clears input only on success, but the planned async request carries no such transition.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
|
| `copy_to_clipboard` (`helpers.rs:386`) returns `bool`; every caller turns that | ||
| `bool` into a status notice immediately. | ||
|
|
||
| Call sites that depend on the boolean (8): |
There was a problem hiding this comment.
WARNING: Incorrect count — table shows 9 call sites, not 8
The text says "Call sites that depend on the boolean (8):" but the table below lists 9 entries (viewport, selection, drag-copy, copy badge, image label cycle, badge click, coverage report, onboarding, device code). Update the number to 9.
| change shape. | ||
|
|
||
| Contract C still needs an answer for state 3 *when read-back is unavailable or | ||
| unconclusive*: the honest answer is "unconfirmed", which is a third UI state |
There was a problem hiding this comment.
SUGGESTION: Typo — "unconclusive" should be "inconclusive"
| unconclusive*: the honest answer is "unconfirmed", which is a third UI state | |
| unconclusive*: the honest answer is "unconfirmed", which is a third UI state |
| | `copy_selection.rs:372-390` selection | `Copied selection` | `Failed to copy selection` | | ||
| | `copy_selection.rs:~400-420` drag-copy | `Copied selection · highlight remains visible` | `Failed to copy selection` | | ||
| | `input.rs:2543-2552` copy badge | `target.copied_notice` | `Failed to copy {kind}` | | ||
| | `navigation.rs:194-211` image label cycle | `Image size: {size} · Mermaid code copied` / `· Image copied` | `… · Could not copy …` | |
There was a problem hiding this comment.
SUGGESTION: Table cell shows two success messages separated by / — inconsistent with other rows
The "Notice on true" column for navigation.rs:194-211 shows Image size: {size} · Mermaid code copied / · Image copied. Other rows show a single message. Consider splitting into two rows or clarifying this is two cases.
| | `navigation.rs:1782-1790` badge click | `target.copied_notice` | `Failed to copy {kind}` | | ||
| | `misc_ui.rs:551-558` coverage report | `Copied provider test coverage report` | `Failed to copy …` | | ||
| | `onboarding_flow_control.rs:1684-1691` | `onboarding_repair::repair_brief_status(agent, true)` | `… (clipboard unavailable)` | | ||
| | `auth.rs:1692-1696` device code | `" (copied to clipboard - just paste it!)"` | `""` | |
There was a problem hiding this comment.
WARNING: Table shows a function call, not a notice string
The "Notice on true" for onboarding_flow_control.rs:1684-1691 shows onboarding_repair::repair_brief_status(agent, true) which is a function call, not the actual notice text displayed to the user. This makes the table misleading for understanding user-visible behavior.
| ## 8. Why no code change in this branch | ||
|
|
||
| Each of the three contracts requires the B1 decision, and the only mechanism | ||
| that can honestly resolve the ambiguous state (read-back) cannot be measured in |
There was a problem hiding this comment.
WARNING: Potential contradiction with Section 4 on Contract C wording
Section 8 says Contract C would "silently pick new user-facing wording", but Section 4 (lines 163-164) states Contract C uses "existing success_text / failure_text pairs... unchanged". Which is correct? If Contract C reuses existing wording, the Section 8 claim is wrong.
| ## 6. Deterministic test plan | ||
|
|
||
| Runnable only on Linux (`cargo test -p jcode-tui --target x86_64-unknown-linux-gnu` | ||
| locally cannot execute; the target *is* installed so `cargo check --target |
There was a problem hiding this comment.
SUGGESTION: Odd italic emphasis on "is"
| locally cannot execute; the target *is* installed so `cargo check --target | |
| locally cannot execute; the target is installed so `cargo check --target |
Code Review SummaryStatus: 6 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Additional Concerns (require code verification)The following technical claims in the document should be verified against the actual implementation:
These are not flagged as inline comments because they require reading the source code to verify, but they are noted in the CodeAnt AI nitpicks on this PR and should be investigated. Files Reviewed (1 file)
Fix these issues in Kilo Cloud Reviewed by free · Input: 117.9K · Output: 9K · Cached: 407.7K |



User description
What this adds
docs/design/clipboard-helper-ownership.md(314 lines): the evidence, the designoptions, and the explicit blocker for issue #231 — what a clipboard helper's
exit 0actually proves, and what the UI may claim while a write is still pending.
Design only. No production change in this branch. The one open question is a
product/UX contract decision, and every candidate answer changes user-visible behaviour
on the default Linux copy path, so it is recorded rather than assumed.
Provenance
Salvage of branch
design/clipboard-helper-ownership-231, tipf41eab091803.The branch-retirement sweep classed this
SUPERSEDED_UNPROVENby an automated pass; themeasurement says otherwise: the document is absent from
master's entire history(additive 1/1, an addition) and
git merge-tree --write-tree master <tip>isrc=0.Why a doc PR and not "just delete it"
The blocker it describes is still live: #231 is open and the pending-write state is
still unconfirmed in the UI except where the code PR fixes wording. Landing the written
decision means the next person does not re-derive it, and it stops being a ref that
conflicts six months from now.
CodeAnt-AI Description
Document clipboard helper uncertainty and copy-confirmation choices
What Changed
Impact
✅ Clipboard behavior remains unchanged✅ Copy-confirmation options documented✅ Linux validation needs identified💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.