Skip to content

Revert #383: restore host-AX-publish ceiling to 400ms#384

Merged
FuJacob merged 1 commit into
mainfrom
revert/lower-ax-publish-delay
May 28, 2026
Merged

Revert #383: restore host-AX-publish ceiling to 400ms#384
FuJacob merged 1 commit into
mainfrom
revert/lower-ax-publish-delay

Conversation

@FuJacob

@FuJacob FuJacob commented May 28, 2026

Copy link
Copy Markdown
Owner

60ms was too tight in practice — rolled back to the 400ms ceiling. The fail-open accept tap in #382 remains as the swallow fix.

Greptile Summary

Reverts the hostPublishWaitCeilingMs constant from 60ms (introduced in #383) back to 400ms, and replaces the doc comment with an empirical rationale. The #382 fail-open accept-tap fix is unaffected.

Confidence Score: 5/5

Safe to merge — single-constant revert with no logic changes.

The only change is restoring a timeout constant from 60ms to 400ms and refreshing the accompanying doc comment. The polling logic (pollForHostPublish) is untouched; the fail-open accept tap from #382 is untouched. No new code paths are introduced.

No files require special attention.

Important Files Changed

Filename Overview
Cotabby/App/Coordinators/SuggestionCoordinator+Input.swift Reverts hostPublishWaitCeilingMs from 60ms back to 400ms and updates the doc comment to reflect the empirical rationale; no logic changes.

Sequence Diagram

sequenceDiagram
    participant CGEvent as CGEvent Tap
    participant SuggC as SuggestionCoordinator
    participant FocusM as FocusModel (AX)
    participant Predict as Prediction Pipeline

    CGEvent->>SuggC: keystroke captured
    SuggC->>SuggC: schedulePredictionAfterHostPublishDelay()
    SuggC->>FocusM: refreshNow() (snapshot baseline)

    loop Poll every 30ms, up to ~370ms (ceiling 400ms)
        SuggC->>FocusM: refreshNow()
        alt AX state changed (text / element / selection)
            SuggC->>Predict: schedulePrediction()
        else "Ceiling reached (nextElapsed >= 400ms)"
            SuggC->>Predict: schedulePrediction() [fallback]
        else Still waiting
            SuggC->>SuggC: asyncAfter(30ms) → pollForHostPublish
        end
    end
Loading

Reviews (1): Last reviewed commit: "Revert "Drop host-AX-publish ceiling to ..." | Re-trigger Greptile

@FuJacob FuJacob merged commit 0945aac into main May 28, 2026
4 checks passed
@FuJacob FuJacob deleted the revert/lower-ax-publish-delay branch May 28, 2026 16:23
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.

1 participant