Integrate autocomplete improvements while preserving upstream lifecycle - #832
Open
mc-hamster wants to merge 58 commits into
Open
mc-hamster wants to merge 58 commits into
mc-hamster wants to merge 58 commits into
Conversation
Reworks the local llama runtime to support token-healing replay, operation-scoped cancellation, and cache restoration based on actual native restore success instead of model-family blacklisting. Prompt/request shaping now preserves exact caret whitespace, keeps multiline seam behavior intact, and adds bounded trailing-text context only for local engines (not endpoint payloads). Adds debug-only first-presentation timing, new runtime/streaming/scoring tests, a full typing-session eval suite, and docs/scripts for reproducible eval runs and local CotabbyInference workspace overrides.
This patch upgrades local visual context from a single field capture to a slow refresh loop with field identity checks, engine-specific context limits, and safer prompt budgets. It adds VisualContextExcerptSelector for nearby OCR selection and preserves larger local excerpts without broadening endpoint privacy. It also adds a fixed phrase-prediction benchmark and scoring harness plus coverage tests for screenshot capture, refresh behavior, and request construction.
Upgrade the phrase benchmark from plain next-word replay to 1,337 contextual writing scenarios with synthetic screen/OCR fixtures. The eval now runs paired screen vs. no-screen conditions, records prompt and visual excerpts, reports context lift/regressions, and validates that answers do not leak into context. Also extend the Python runner with balanced sampling, context selection, progress reporting, and updated compare logic, while refreshing docs/tests and ignoring Python cache artifacts.
Adds a new `Cotabby 3.xcodeproj` with shared `Cotabby` and `Cotabby Dev` schemes/workspace metadata. Extends `scripts/phrase_eval.py` with `save-baseline` export support, stronger run validation, safer child-process shutdown handling, and model-name comparison that ignores path differences. Updates phrase-eval docs, adds benchmark baseline documentation, includes a tracked smoke baseline artifact set, and expands CLI tests for baseline export and progress behavior.
Add the Codex Electron bundle identifier to the browser app detector so focus tracking and editor recovery treat the ChatGPT/Codex desktop app like other Chromium-based editors. This keeps accessibility focus detection working for Codex's composer without relying on display-name matching.
Check in new Xcode project files for the CoHamster and Cotabby app variants, including workspace metadata and shared schemes for the main, dev, and McHamster builds. This captures the full target, package, resource, and test wiring so the apps can be opened and built from Xcode with the expected configurations.
Update all GitHub workflows to the newer pinned `actions/checkout` release. Redraw the menu bar hamster as a dedicated 18pt template glyph, regenerate its assets, and adjust the status view to use the native-sized icon with an accessibility label. The asset generator now treats the menu bar icon separately from the full-color brand artwork and supports `--menu-bar-only` for faster iteration.
Debug/Release now use a single CoHamster app identity and scheme setup (with regenerated Xcode project metadata), while debug overlays became a separate development setting from `-cotabby-debug` logging. The suggestion pipeline was hardened to prevent cross-conversation leakage by introducing session identity checks (URL/title/placeholder-aware), replacing process-only matching, removing stale surface caching, and tightening speculative/streamed/acceptance validation. Visual context now expires and invalidates active suggestions safely, and new tests cover conversation isolation, polling signatures, context generation, and settings behavior.
Restart unseen Apple predictions immediately when typing advances, while preserving llama catch-up behavior. Repair missing separators only between known words with a confirmed misspelled join. Add regression coverage and record live TextEdit measurements: matched median latency 513 to 424 ms and prediction coverage 6/10 to 10/10. Validation: 79 targeted and 757 regression tests passed; build-for-testing succeeded.
Read Debug, Release, and packaging versions from Config/Version.xcconfig. Reject conflicting release arguments and verify the archived bundle version. Include 0.6.5 release notes for the measured prediction improvements.
Introduce automated GGUF qualification tooling, including bounded Hugging Face discovery, staged model screening, and a runner for evaluating installed catalog models through the real Swift replay pipeline. The eval harness now supports custom corpora, prompt/profile variants, runtime checks, signed staged XCTest hosts, and records the effective word-count preset so latency and quality comparisons stay honest. Also adds regression fixtures, tests, documentation, and retained evidence from the 2026-09-25 supported-model usability investigation.
Expand llama token healing from a single token to a bounded word-fragment replay by adding `TokenHealingPlan` and wiring it into `LlamaRuntimeCore`. Update the native inference patch to prefer tokens that cover the full typed prefix, keep single-line replay safe, and preserve exact editor bytes. Add Swift/C++ regression tests, project wiring, and benchmark artifacts documenting the before/after usability gains.
Preserve CoHamster publishing workflow removals and settings search coverage. Regenerate CoHamster project references for the imported font registry and scale tracker. Validation: build-for-testing passed; 292 selected tests executed with 5 skips and zero failures. SwiftLint unavailable locally.
Fix coordinator test teardown crash and strict lint failures
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Integrates autocomplete continuity, native inference updates, focus/visual-context handling, settings, CI workspace preparation, licensing, and evaluation evidence while preserving Cotabby’s upstream lifecycle and identities.
Changes:
- Adds prediction-ahead, typing continuity, word completion, correction, and presentation-timing behavior.
- Adds native runtime/token-healing integration with reproducible workspace preparation.
- Updates visual context, accessibility support, settings, documentation, packaging, CI, and benchmarks.
| File | Description |
|---|---|
| THIRD_PARTY_LICENSES.md | Updated as part of this pull request. |
| scripts/tests/test_build_and_run.py | Updated as part of this pull request. |
| scripts/prepare_cotabby_workspace.sh | Updated as part of this pull request. |
| scripts/dev-setup.sh | Updated as part of this pull request. |
| scripts/create-inference-workspace.py | Updated as part of this pull request. |
| scripts/build_test_dmg.sh | Updated as part of this pull request. |
| releases/README.md | Updated as part of this pull request. |
| releases/mchamster-0.6.2.3.md | Updated as part of this pull request. |
| releases/cohamster-0.6.7-beta.1.md | Updated as part of this pull request. |
| releases/cohamster-0.6.6.md | Updated as part of this pull request. |
| releases/cohamster-0.6.5.md | Updated as part of this pull request. |
| releases/cohamster-0.6.4.md | Updated as part of this pull request. |
| releases/cohamster-0.6.3.md | Updated as part of this pull request. |
| README.md | Updated as part of this pull request. |
| project.yml | Updated as part of this pull request. |
| FAQ.md | Updated as part of this pull request. |
| CotabbyTests/UI/SettingsIndexTests.swift | Updated as part of this pull request. |
| CotabbyTests/TestSupport/CotabbyTestFixtures.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Suggestion/Streaming/TypingCadenceTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Suggestion/Streaming/SuggestionStreamingStateTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Suggestion/Streaming/SuggestionPresentationTimingTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Suggestion/Session/SuggestionDismissalMemoryTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Suggestion/Request/CaretWordContextTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Spelling/WordPrefixIndexTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Spelling/TypoGateTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Runtime/BundledRuntimeLocatorTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Prompting/PromptSectionBudgetTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Prompting/PromptPolicyTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Onboarding/OnboardingTemplateRecommenderTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Onboarding/OnboardingTemplateFeatureListTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Input/MarkerSelectionSynthesizerTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Focus/FocusedInputPollingSignatureTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Focus/Applications/BrowserAppDetectorTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Context/PromptContextSanitizerTests.swift | Updated as part of this pull request. |
| CotabbyTests/Support/Accessibility/AXHelperTests.swift | Updated as part of this pull request. |
| CotabbyTests/Services/Visual/ScreenshotContextGeneratorTests.swift | Updated as part of this pull request. |
| CotabbyTests/Services/Suggestion/State/ContextBufferNavigationTests.swift | Updated as part of this pull request. |
| CotabbyTests/Models/Suggestion/SuggestionQualityMetricsStoreTests.swift | Updated as part of this pull request. |
| CotabbyTests/Models/Settings/SuggestionSettingsDomainTests.swift | Updated as part of this pull request. |
| CotabbyTests/Models/Settings/ShortcutConflictTests.swift | Updated as part of this pull request. |
| CotabbyTests/Models/Focus/FocusTrackingModelTests.swift | Updated as part of this pull request. |
| CotabbyTests/App/Coordinators/Suggestion/SuggestionCoordinatorPredictionTests.swift | Updated as part of this pull request. |
| CotabbyTests/App/Coordinators/Suggestion/SuggestionCoordinatorAcceptanceTests.swift | Updated as part of this pull request. |
| Cotabby/UI/Settings/Panes/WritingPaneView.swift | Updated as part of this pull request. |
| Cotabby/UI/Settings/Panes/ShortcutsPaneView.swift | Updated as part of this pull request. |
| Cotabby/UI/Settings/Panes/PermissionsPaneView.swift | Updated as part of this pull request. |
| Cotabby/UI/Settings/Panes/HomePaneView.swift | Updated as part of this pull request. |
| Cotabby/UI/Settings/Panes/ContextPaneView.swift | Updated as part of this pull request. |
| Cotabby/UI/Settings/Panes/About/AcknowledgementsView.swift | Updated as part of this pull request. |
| Cotabby/UI/Settings/Panes/About/AboutPaneView.swift | Updated as part of this pull request. |
| Cotabby/UI/Onboarding/Welcome/WelcomeView.swift | Updated as part of this pull request. |
| Cotabby/UI/Onboarding/Welcome/WelcomePermissionStepView.swift | Updated as part of this pull request. |
| Cotabby/UI/MenuBar/MenuBarStatusLabelView.swift | Updated as part of this pull request. |
| Cotabby/Support/Suggestion/Streaming/TypingCadence.swift | Updated as part of this pull request. |
| Cotabby/Support/Suggestion/Streaming/SuggestionPresentationTiming.swift | Updated as part of this pull request. |
| Cotabby/Support/Suggestion/Streaming/StreamedGhostTextPolicy.swift | Updated as part of this pull request. |
| Cotabby/Support/Suggestion/Session/SuggestionDismissalMemory.swift | Updated as part of this pull request. |
| Cotabby/Support/Suggestion/Session/SpeculativeAcceptanceContext.swift | Updated as part of this pull request. |
| Cotabby/Support/Suggestion/Output/SuggestionTextNormalizer.swift | Updated as part of this pull request. |
| Cotabby/Support/Spelling/TypoGate.swift | Updated as part of this pull request. |
| Cotabby/Support/Spelling/CurrentWordExtractor.swift | Updated as part of this pull request. |
| Cotabby/Support/Runtime/TokenHealingPlan.swift | Updated as part of this pull request. |
| Cotabby/Support/Runtime/BundledRuntimeLocator.swift | Updated as part of this pull request. |
| Cotabby/Support/Prompting/PromptSectionBudget.swift | Updated as part of this pull request. |
| Cotabby/Support/Prompting/FoundationModelPromptRenderer.swift | Updated as part of this pull request. |
| Cotabby/Support/Presentation/Geometry/SuggestionAnchorCache.swift | Updated as part of this pull request. |
| Cotabby/Support/Onboarding/OnboardingTemplateFeatureList.swift | Updated as part of this pull request. |
| Cotabby/Support/Logging/CotabbyDebugOptions.swift | Updated as part of this pull request. |
| Cotabby/Support/Input/MarkerSelectionSynthesizer.swift | Updated as part of this pull request. |
| Cotabby/Support/Focus/FocusedInputPollingSignature.swift | Updated as part of this pull request. |
| Cotabby/Support/Focus/Applications/BrowserAppDetector.swift | Updated as part of this pull request. |
| Cotabby/Support/Context/PromptContextSanitizer.swift | Updated as part of this pull request. |
| Cotabby/Support/Context/OCRTextHygiene.swift | Updated as part of this pull request. |
| Cotabby/Services/Visual/ScreenTextExtractor.swift | Updated as part of this pull request. |
| Cotabby/Services/Suggestion/State/ContextBuffer.swift | Updated as part of this pull request. |
| Cotabby/Services/Spelling/SymSpellCorrector.swift | Updated as part of this pull request. |
| Cotabby/Services/Runtime/Llama/LlamaSuggestionEngine.swift | Updated as part of this pull request. |
| Cotabby/Services/Presentation/FocusDebugOverlayController.swift | Updated as part of this pull request. |
| Cotabby/Services/Focus/Chromium/ChromiumAccessibilityEnabler.swift | Updated as part of this pull request. |
| Cotabby/Services/Focus/Caching/SurfaceContextCache.swift | Updated as part of this pull request. |
| Cotabby/Resources/ThirdPartyLicenses/SwiftLog-NOTICE.txt | Updated as part of this pull request. |
| Cotabby/Resources/ThirdPartyLicenses/SOURCES.md | Updated as part of this pull request. |
| Cotabby/Resources/ThirdPartyLicenses/Llama.cpp-MIT.txt | Updated as part of this pull request. |
| Cotabby/Resources/ThirdPartyLicenses/LaunchAtLogin-MIT.txt | Updated as part of this pull request. |
| Cotabby/Resources/ThirdPartyLicenses/Gemoji-MIT.txt | Updated as part of this pull request. |
| Cotabby/Resources/ThirdPartyLicenses/CotabbyInference-MIT.txt | Updated as part of this pull request. |
| Cotabby/Models/Suggestion/SuggestionSubsystemContracts.swift | Updated as part of this pull request. |
| Cotabby/Models/Suggestion/SuggestionQualityMetricsStore.swift | Updated as part of this pull request. |
| Cotabby/Models/Suggestion/SuggestionEngineModels.swift | Updated as part of this pull request. |
| Cotabby/Models/Suggestion/Result/SuggestionResult.swift | Updated as part of this pull request. |
| Cotabby/Models/Suggestion/Request/SuggestionConfiguration.swift | Updated as part of this pull request. |
| Cotabby/Models/Suggestion/Request/FocusedInputContext.swift | Updated as part of this pull request. |
| Cotabby/Models/Settings/SuggestionSettingsData.swift | Updated as part of this pull request. |
| Cotabby/Models/Runtime/LlamaRuntimeModels.swift | Updated as part of this pull request. |
| Cotabby/Models/Onboarding/OnboardingTemplate.swift | Updated as part of this pull request. |
| Cotabby/Models/Focus/FocusTrackingModel.swift | Updated as part of this pull request. |
| Cotabby/Models/Context/VisualContextModels.swift | Updated as part of this pull request. |
| Cotabby/App/Core/CotabbyAppEnvironment.swift | Updated as part of this pull request. |
| Cotabby/App/Core/CotabbyApp.swift | Updated as part of this pull request. |
| Cotabby/App/Core/AppDelegate.swift | Updated as part of this pull request. |
| Cotabby/App/Coordinators/Suggestion/SuggestionCoordinator+Lifecycle.swift | Updated as part of this pull request. |
| Config/Package.resolved | Updated as part of this pull request. |
| benchmarks/phrase-prediction/smoke-14-qwen35-0.8b-q6/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/smoke-14-qwen35-0.8b-q6/manifest.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/RUN_TABLE.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/FULL42_ANALYSIS.md | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/CANDIDATE_PATCHES.md | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-screen42/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-screen42/resolution.log | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-screen42/resolution-inputs.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-screen42/metadata.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-full42/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-full42/resolution.log | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-full42/resolution-inputs.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/baseline-full42/metadata.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/B-screen42/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/B-screen42/resolution.log | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/B-screen42/resolution-inputs.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/B-screen42/metadata.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-screen42/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-screen42/resolution.log | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-screen42/resolution-inputs.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-screen42/metadata.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-full42/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-full42/resolution.log | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-full42/resolution-inputs.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/AB-full42/metadata.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/A-screen42/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/A-screen42/resolution.log | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/A-screen42/resolution-inputs.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round3/A-screen42/metadata.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round2/CLOSURE.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/validation-window-plan.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/source-prerequisites/Package.resolved | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/round.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/round-completion.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/registered-decision-criteria.md | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/plot-requirements.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/p2-prompt-delta-audit.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/local-path-repeatability.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/local-execution-migration.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/isolation-source-manifest.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/heldout-baseline-repeatability.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/full42-repeatability.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/final-source-verification.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/criteria-snapshot.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/cleanup.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/round1-20260917/character150-plan.json | Updated as part of this pull request. |
| benchmarks/phrase-prediction/README.md | Updated as part of this pull request. |
| benchmarks/phrase-prediction/baseline-v1/summary.txt | Updated as part of this pull request. |
| benchmarks/phrase-prediction/1337-full-20260925/summary.txt | Updated as part of this pull request. |
| benchmarks/model-usability/2026-09-25/evidence.sha256 | Updated as part of this pull request. |
| benchmarks/model-usability/2026-09-25-token-healing/release-build.json | Updated as part of this pull request. |
| benchmarks/model-usability/2026-09-25-token-healing/evidence.sha256 | Updated as part of this pull request. |
| benchmarks/live-typing/2026-09-24-apple-intelligence/README.md | Updated as part of this pull request. |
| benchmarks/live-typing/2026-09-24-apple-intelligence/manifest.json | Updated as part of this pull request. |
| .gitignore | Updated as part of this pull request. |
| .github/workflows/tests.yml | Updated as part of this pull request. |
| .github/workflows/release.yml | Updated as part of this pull request. |
| .github/workflows/build.yml | Updated as part of this pull request. |
| .github/PULL_REQUEST_TEMPLATE.md | Updated as part of this pull request. |
| .github/FUNDING.yml | Updated as part of this pull request. |
| .codex/environments/environment.toml | Updated as part of this pull request. |
| .claude/skills/ship/SKILL.md | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mc-hamster
marked this pull request as draft
September 26, 2026 19:58
Once the exact accepted edit publishes, the host-publish poll stands down and the prepared continuation alone owns the next prediction. Three paths could then drop it silently when the editor changed again without a key event: - the queued apply found the target gone and returned (review P1); - a continuation finishing after that change stayed buffered and unused; - a failed continuation waited for yet another edit, then abandoned the field at the correction timeout. Each now falls back to an ordinary prediction for the live text. A field that AX briefly stops reporting is polled until it returns instead of disabling suggestions on one transient read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Live testing with Apple Intelligence returned `we've decided to move forward` directly after "...let you know that". Separator repair only accepted plain-letter words, so the apostrophe made `thatwe've` a plain seam misspelling and the whole prediction was suppressed. Treat a token as a whole word when its apostrophes or hyphens sit between letters (`we've`, `it's`). A connector at either edge (`'t`, `don'`) is still a fragment of the word being spelled, so `don` + `'t` is never split, and streaming still waits for the complete word. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR corrected the Context pane's "How this is used" bullet to say an endpoint receives the text, but the live preview footer above it still promised "Nothing here is saved or shared; it only exercises the on-device model." The preview runs the real pipeline, so with an OpenAI-compatible endpoint selected (which may be on the LAN or the internet) typed text is sent there. Keep the on-device wording for Apple Intelligence and Open Source, and say the text goes to the configured endpoint when one is selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a final-chunk or correction accept, a second quick Tab is held until the continuation appears, then accepts its first word. The window only ended when the overlay hid, but with no session and an idle state, typing never hides anything. A Tab pressed before "I" was flushed into the suggestion for "...I" once it arrived, inserting words the user never saw. Release the window on every text-changing, navigation, or dismissal key. A held Tab now only accepts the continuation of the text it was pressed on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Predict-ahead keeps a request alive through matching keys, then shifts its
answer past the typed letters. That shifted text reached presentation without
the checks a fresh request at the new caret gets:
- whitespace alone ("you " after typing "you") became an invisible ready
session with no request left, so nothing appeared until the next key;
- words that already follow the caret were offered again, and Tab
duplicated them;
- with "Suggest while typing a word" off, a new offer appeared mid-word.
Final answers that fail these checks now restart the normal pipeline, and
matching partials are skipped. A suggestion already on screen still follows
the user's typing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FocusTracker bumps the focus sequence whenever the polling signature changes, and that signature includes the field's rounded frame. On main a bump only restarted screen capture, because suggestion identity compared the process alone. This branch compares the full session identity, sequence included, so every line wrap in a self-growing composer (chat apps, ChatGPT, long documents) now counted as navigation: it hid the ghost text, cleared the anchor cache, reset the model cache, and turned off Tab interception. A field whose frame changes only by resizing in place (same left edge and width, with its top or bottom edge unchanged) is now the same field. Distinct fields stacked in one column still differ at both edges, and the URL, title, and placeholder navigation facts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two paths could run automatic correction on text outside the current edit: - After a replacement, the publication poll must wait for new text so stale AX cannot correct the same word twice. Selection changes were excluded, but a recycled Chromium AX wrapper still counted, so the typo gate ran on the unpublished word and turned "word " into "wword " (reachable when no prepared continuation is waiting, e.g. with an endpoint engine). - A focus change during an in-flight generation scheduled a prediction for whatever field gained focus. Clicking into another field could then replace an old typo there, which the adjacent comment says must not happen. Only a text change now ends a post-replacement poll. After a focus change, lookahead resumes only when the same writing continues (same text around the caret); another field waits for real input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Focus capture keeps only the last 4096 UTF-16 units before the caret, so an edit that changes length slides that window. A prepared continuation's target was the source window plus the edit, compared by exact content signature, so in long documents it never matched. The publication poll then ignored every change until its 400 ms ceiling: accepted word endings waited the full ceiling for their next words, and accepted corrections ended with no suggestion at all. Also accept the slid window when one window ends with the other, the live window is at least as long as the source, and the text after the caret is unchanged. Field identity, selection, and secure-field checks are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the caret sits inside a word ("the|me"), Cotabby asks llama to forbid a
whitespace-leading first token so the insertion joins both halves. Token
healing now replays the whole last word, and the runtime disabled that mask
whenever a healed prefix existed. The native engine lifts the mask during the
replay and never restores it for the next token, so the suggestion could
begin with " meeting" and render as "the meetingme".
Skip healing only when mid-word continuation is forced. Those requests keep
the pre-healing behavior; ordinary end-of-word prompts still heal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build_and_run.sh: - Build into a private DerivedData directory. The EXIT trap removed the shared build/DerivedData on every run, including early failures, deleting products that tests, evals, or another build were using. - Accept an ad-hoc signed installed app. Without an Apple Development certificate codesign prints no Authority and an implicit cdhash requirement, so every run after the first stopped with "Cannot determine installed app signing identity". - Stage the runnable app under the dev app's "Cotabby Dev" support folder instead of the production app's "Cotabby" folder. prepare_cotabby_workspace.sh: - Pin the diff format so settings such as diff.noprefix or an external diff cannot make a pristine checkout look modified. - Explain a stale checkout (a bumped revision or edited patch) instead of exiting silently under set -e; it is still never reset automatically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without --workspace the phrase eval built Cotabby.xcodeproj, which resolves the remote CotabbyInference. The app now calls APIs that exist only in the pinned, patched checkout, so the documented commands failed to compile. Default to build/cotabby-dependencies/Cotabby.xcworkspace, as the supported model eval already does, and point to the prepare script when it is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The long-field match accepted any live text that ended with the prepared target (or vice versa). That also applied to fields that fit entirely in the capture window, where the host adding or removing text before the edit is a real change: a continuation prepared for the old text could still be shown. Only accept a slid window when both the source and the live window were cut to the capture limit, so any remaining difference lies before both windows, in text the prepared request never saw. Shorter fields keep the exact signature check. The limit now lives on FocusedInputSnapshot so the pure plan does not reach into the focus resolver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Nothing here is saved" read as a promise about the configured server too, which Cotabby cannot make. Say that Cotabby doesn't save the preview text, and that the endpoint receiving it may keep it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This PR brings the CoHamster autocomplete improvements back into Cotabby while retaining upstream’s production/dev app identities, signing defaults, Sparkle updater, and development/release lifecycle. The main behavior change is continuity: predictions can stay useful while the user types, accepts a word ending, or commits a correction, rather than repeatedly disappearing and starting over.
It also contributes the native-runtime integration, focus and visual-context fixes, evaluation infrastructure, and recorded experiment evidence used to develop those changes. The PR remains a draft while dependency integration, CI, and release validation are completed.
Prediction, acceptance, and typing continuity
Native inference and prompt construction
The native APIs are contributed separately in CotabbyInference PR #14. Until that lands, this PR pins the native source revision, applies
patches/cotabbyinference-upstream-pending.patch, and uses an ignored workspace containing the matching package.Focus, editor compatibility, and conversation isolation
Visual context and settings
Evaluation tooling, fixtures, and evidence
Upstream lifecycle, packaging, and documentation
Cotabbyand isolatedCotabby Devtargets, bundle identifiers, signing-team defaults and local overrides, model-storage conventions, dev icon, and updater-disable compilation flag.Validation
Local validation of the restored lifecycle and integrated app:
Cotabby Devbuild passed; its separate bundle identity andCOTABBY_DEVflag were verified.At app head
f46b0fe, Tests, Lint, and XcodeGen passed; Build failed because workspace dependency resolution omitted the required scheme. Commit6cbf853adds the scheme and checkout-scoped DerivedData path to both Build and Release resolution steps. The exact corrected command passes locally. All four checks on6cbf853now pass: Build, Tests, Lint, and XcodeGen.Remaining integration work
6cbf853. Re-run checks after subsequent integration changes.No new blocking issue was established in the changes since the previous review.
Summary
The PR integrates autocomplete continuity, native inference, focus and visual-context changes, evaluation tooling, and workspace-based build and release preparation. Since the previous review, it tightens prepared-continuation matching at the capture-window boundary and clarifies the endpoint preview’s privacy wording.
Reviews (6) · Last reviewed commit: "Speak only for Cotabby's storage in the ..."