Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change limits Unicode payloads to key-down events to address duplicate text. The live Electron composer was not rechecked, but synthetic input remains explicitly unverified and no concrete merge blocker is established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change preserves existing focus checks, typing authority, and key-release behavior. No new security exposure was demonstrated, but compatibility with external applications and callers of the new helper remains incompletely verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 1 | ❌ 4❌ Failed checks (4 warnings)
✅ Passed checks (1 passed)
Full details: Description checkExplanation The description explains the problem, implementation, scope, trade-offs, linked issue, and test results. It does not follow the required template and omits the required Visual Proof section, checklist status, cross-platform and compatibility notes, review section, and Agent skill upstream boundary section. Resolution Rewrite the description using the repository template. Add the required headings, mark Visual Proof as N/A with a reason or provide evidence, complete the Testing checklist, address cross-platform and compatibility considerations, and complete the remaining checklist sections. Full details: Linked Issues checkExplanation Issue Resolution Add pre-post confirmation for the target PID, window, and focused receiver. Read the exact value from the same receiver after typing. Return
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. Comment |
|
There was a problem hiding this comment.
Important
The change is safe and matches the reporter's suggested fix, but it is unverified against the receiver it targets, and the new comment's stated mechanism is contradicted by current Chromium source. Since the PR is written as Fixes #17942 (which auto-closes), please confirm the live repro and correct the rationale before merging.
Reviewed changes
- Key-up no longer carries a character —
typeTextattaches the Unicode payload only to the key-downCGEvent; the key-up is still posted but empty (main.swift:2666). - Policy extracted to Core —
KeyboardInputSafety.unicodeUnitCount(forKeyDown:)returns1for key-down and0for key-up (KeyboardInputSafety.swift:16), with a unit test pinning the two values (KeyboardInputSafetyTests.swift:24).
⚠️ The fix is not verified against the reported receiver
The only evidence is a unit test of a one-line helper plus a successful compile; the PR body states the live Electron composer was not rechecked. The macOS type-text e2e (tests/e2e/computer-mac.e2e.ts) is opt-in (ORCA_COMPUTER_E2E=1), is not run on PR (.github/workflows/computer-e2e.yml only runs the native-smoke jobs on PRs), and asserts toContain(marker), which would pass even if the text were duplicated. Because Fixes #17942 auto-closes the issue, verify the exact repro on an Electron contentEditable composer first, or scope the claim down.
Technical details
# Verify against the real receiver before claiming the fix
## Affected sites
- `native/computer-use-macos/Sources/OrcaComputerUseMacOS/main.swift:2658-2677` — the changed `typeText` path.
- `tests/e2e/computer-mac.e2e.ts:50-76` — `toContain(marker)` only; no assertion of a single occurrence.
- `.github/workflows/computer-e2e.yml` — PR triggers do not run `computer-mac.e2e.ts`; `native-smoke` runs on ubuntu/windows, `mac-native-owner-smoke` runs `pnpm verify:computer-native` (Swift tests).
## Required outcome
- Evidence the reported duplication is gone on an Electron/React `contentEditable` composer (or a clear statement narrowing what the PR fixes).
- If verification is not possible in this PR, avoid an auto-closing `Fixes #17942` until it is.ℹ️ Nitpicks
main.swift:2671-2673:if upUnits > 0 { up.keyboardSetUnicodeString(...) }is now unreachable —unicodeUnitCount(forKeyDown: false)is always0. Dropping the guard (or the helper entirely) would make the key-up omission explicit.- Pre-existing, but directly in this loop: iterating
text.utf16one code unit at a time splits non-BMP characters (emoji) into lone surrogate events. Other macOS type-string tools coalesce surrogate pairs into a single 2-unit event; worth a follow-up if emoji input matters.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Electron contentEditable inserts the Unicode payload of both the keyDown and keyUp events. The keyUp event now carries no character. Fixes stablyai#17942
Key-down is the insertion path. Chromium forwards key-up without interpretKeyEvents, and the comment no longer says Electron inserts the payload of both events. The construction test reads the Unicode string on the events that typeText posts.
bf10533 to
537593a
Compare
Sync update (
|
There was a problem hiding this comment.
ℹ️ No critical issues — prior feedback addressed cleanly; one minor API-surface suggestion inline.
Reviewed changes — re-reviewed the two commits pushed since the prior pullfrog review (bf10533).
- Corrected the key-up rationale — the comment now explains Chromium's key-down insertion path (key-up only dispatches a DOM
keyup) instead of the inaccurate "Electron inserts the payload of both events" claim. - Extracted the per-character event mutation —
typeTextnow callsKeyboardInputSafety.attachCharacter(_:keyDown:keyUp:), removing the unreachable key-up guard the prior review flagged. - Added event-level coverage — a test constructs a real key-down/key-up
CGEventpair and asserts the key-up carries no character, so it fails if a character is re-attached to key-up.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The executable only calls attachCharacter. The unit count and the Unicode reader are for that module and its testable tests, so they do not need to be public.
Sync update (
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — re-reviewed the commit pushed since the prior pullfrog review (537593a), a one-line-range visibility change that is a pure API-surface tightening.
- Tightened helper visibility —
KeyboardInputSafety.unicodeUnitCount(forKeyDown:)andunicodeUnits(of:)are nowinternalinstead ofpublic. The only readers are the@testabletest target, andattachCharacter(the sole symbol the executable calls) stayspublic, so the Core module no longer exposes test-only helpers.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Description
orca computer type-textposted each character on both the key-down and key-up events. Electron contentEditable composers insert both payloads, so the text appeared twice with the placeholder between the copies.Focused fix
In:
Out:
Preserves
Apps that already inserted on key-down still receive one character. The key-up event remains, so key state does not stay logically down. Synthetic typing stays unverified; this does not claim a read-back.
Evidence
swift test --filter KeyboardInputSafetyTestsinnative/computer-use-macos.KeyboardInputSafetyTestspassed, includingtestSyntheticUnicodeIsAttachedOnlyToKeyDown.swift buildcompiledmain.swift.A live Electron composer was not rechecked.
User-regression-tradeoffs
Receivers that inserted only from the key-up Unicode payload will stop receiving text. The reported composer inserted both, and key-down is the event that carries typed text.
Fixes #17942