Skip to content

Fix Linux IBus reset recovery and duplicate-event boundary - #14

Merged
RMANOV merged 1 commit into
masterfrom
codex/reset-recovery-20261009
Oct 9, 2026
Merged

RMANOV merged 1 commit into
masterfrom
codex/reset-recovery-20261009

Conversation

@RMANOV

@RMANOV RMANOV commented Oct 9, 2026

Copy link
Copy Markdown
Owner

When a native-core reset fails, acknowledge the fallback reset before processing normal input and clear the duplicate-event boundary. This preserves recovery behavior without carrying stale reset or deduplication state into the next key event.

Changes are limited to the Linux IBus adapter and its focused regression tests. Validation includes the prior 110-test source acceptance, 13 native tests and 119 adapter tests, and a real private IBus run covering a synthetic document, privacy boundaries and reset recovery. Independent review accepted the exact source candidate d1ceb1d1bf4a830a3c903b38423e4b286fda23d4.

The private IBus result does not establish deployment or acceptance in the user's active desktop. This PR does not install or switch the live keyboard engine and is separate from Windows packaging PR #13.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 18:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T18:56:32.489781Z d1ceb1d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It alters the password/sensitive-field kill-switch behavior, a security-critical privacy boundary that warrants final human review despite being small and well-tested.

0 open findings

What changed in this PR

This PR hardens the Linux IBus adapter's sensitive-field "kill switch" so that a failed native-core reset() no longer leaks protection. Previously, leaving a sensitive field flipped _sensitive off and discarded composition state even if the core reset threw; now the flag stays armed throughout the reset in both directions and is released only after an explicit ordinary declaration whose reset actually succeeds, while adapter-side cleanup (preedit, buffers, in-flight key counter, surrounding text) still runs after a refusal. It fits into the engine's documented privacy boundary for password/unknown content types.

Changes:

  • _reset_for_sensitive_switch returns whether the core reset succeeded.
  • do_set_content_type keeps _sensitive armed during the reset and only clears it on a successful reset when leaving a sensitive field; trace now reports the effective post-reset state.
  • Added focused regression tests covering reset-refusal recovery, staying sensitive during the reset, and adapter-state cleanup after a refusal (including a refusing preedit takedown).
File Description
ibus/​smartkey_engine.py Returns reset-success from _reset_for_sensitive_switch; keeps the sensitive kill switch armed across a failed reset and only releases it on a successful ordinary-declaration reset; trace reflects effective state.
ibus/​test_input_safety.py Adds regression tests for reset-refusal recovery, remaining sensitive during the reset, and adapter-state cleanup after refusal.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@RMANOV
RMANOV merged commit eb08fef into master Oct 9, 2026
8 checks passed
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.

2 participants