Skip to content

macOS engine: an inputSourceChanged stop reports fewer characters than the field holds (67 reported, 70 landed) #616

Done

Description

@SSFSKIM

Problem

When the input source changes in the middle of a keyed type_text, cua's macOS engine stops with inputSourceChanged and reports how many characters were entered. That number can be lower than what the field actually holds.

In #117 M5's full sitting C, run 46204340204 (feat ff1920e, engine 0.3.3), in the unicode cell textedit/midSwitch/typeText.long, run 2 sample 2 (cua ran first):

  • The engine answered "The input source changed after 67 of 1079 characters were entered", with entered 67.
  • TextEdit's field read back 70 characters; exact and sentenceAgrees were both false.

Three characters landed beyond the count, so a model that resumes from 67 types them twice. Samples 1 and 3 passed, and the earlier run (d) had 3/3, so the failure is intermittent. The judge compares the field's own hash against the text's prefix, so the harness is not the cause.

The count comes from checkInputSource(initial, entered:total:) in Input.swift. That is the source check run before every event and after the last, called from keyTextReadBack's checkSource. Events posted before the switch was detected can commit after the count was taken.

Wanted (ruling 1291)

  • On an inputSourceChanged stop, the count cua reports is what the field shows, by readback, wherever a readback is possible.
  • Where a readback isn't possible, the answer states a range, e.g. "between 67 and 70 characters may have been entered; read the field before continuing". Never a single number cua can't stand behind.
  • Do not simply count every unit posted. That trades over-delivery for under-delivery: a model resuming from 70 when only 67 committed drops 3 characters.
  • On the secret route, check every sentence the engine's count feeds. None may say fewer were entered than may have been (ruling 1247(d)'s direction).

Tests

  • A switch landing between a post and the count, with a readback and without one.
  • The secret route's sentences under both cases.

Board

Bug, P2. Parent #117. Blocks #506.

Sminos-Session: cursor235#b93055dd (cua on macbook)

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Nov 29, 2026
  2. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 29, 2026
  3. SSFSKIM commented on Nov 29, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: cursor235 taking under ruling 1291

  4. 11 remaining items

  5. added
    status:in-review
    and removed
    status:in-progress
    on Nov 29, 2026
  6. SSFSKIM commented on Nov 29, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #619; 1299 fallback applied, no round 6 (ruling 1300)

  7. removed
    status:in-review
    on Nov 29, 2026
  8. SSFSKIM commented on Nov 29, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #619 (1326898, cua 0.31.2, engine 0.2.5).

  9. SSFSKIM commented on Nov 29, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: merged in #619

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions