DatabaseService gains a testable init(dbQueue:) plus a makeInMemory()
convenience and schema-introspection helpers (tableExists/columnNames),
so migration tests don't need the test target to import GRDB directly.
ContextSelectionService now takes an injected DatabaseService (defaults
to .shared) and its DB-coupled methods (smartSelection,
getSummariesForExcludedRange, isMessageStarred) are bumped to internal.
No logic changes to existing call sites.
The oAITests PBXNativeTarget (PBXContainerItemProxy, PBXTargetDependency,
XCBuildConfiguration with TEST_HOST/BUNDLE_LOADER, the "recommended
settings" changes accepted when the target was created -- DEAD_CODE_STRIPPING,
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, STRING_CATALOG_GENERATE_SYMBOLS,
DEVELOPMENT_TEAM moved to project-level inheritance) was somehow never
actually staged in the very first "Add real oAITests target" commit
(8c7fb59) despite every xcodebuild test run since then depending on it
being present on disk. Every subsequent commit this session only staged
specific file paths (never oAI.xcodeproj again), so the gap went
unnoticed until a full `git status` review here.
Without this, anyone else pulling the branch (or a truly clean checkout
on this machine) would have all the .swift test files but no target to
compile them into -- xcodebuild test would fail to find oAITests at all.
Confirmed the diff is exactly the expected target-wiring content, nothing
unrelated or corrupted, before committing.
66 new tests across 8 files (93 total in the suite now):
- GitSyncServiceTests: convertToSSH/injectCredentials/sanitizeFilename/
detectSecretsInText, including a below-threshold false-positive check
on the secret regex.
- ChatViewModelPureLogicTests: detectGoodbyePhrase, inferProvider,
calculateCost -- including the cache-read (0.1x) / cache-write (1.25x)
pricing multipliers, which is real billing-affecting logic.
- EmbeddingServiceTests / ContextSelectionServiceTests: embedding
(de)serialization round-trip, importance-score weighting, and the
token-estimate fallback (content.count / 4) when no real count exists.
- OpenRouterProviderTests / OllamaProviderTests / OpenAIProviderTests /
AnthropicProviderTests: request-building (attachments, online mode,
cache_control breakpoints, o1/o3 temperature omission, tool schema
conversion) and response-parsing (text, tool_use blocks, empty-choices
fallback behavior) for all four providers, with no network involved.
Also marks calculateCost/inferProvider/detectGoodbyePhrase (ChatViewModel)
and serializeEmbedding/deserializeEmbedding (EmbeddingService) as
`nonisolated` -- discovered via the actual test failures, not
speculation: the project's `SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor`
setting isolates the classes that carry an explicit `@MainActor`
(ChatViewModel), so calling their static members from a plain
synchronous @Test needs the pure ones marked `nonisolated`. Matches
the existing convention already used elsewhere in EmbeddingService
(cosineSimilarity was already nonisolated before this change).
Phase 2 of the test-suite rollout plan (peaceful-baking-kurzweil).
Every change here is either dropping `private` (still invisible
outside the module, @testable import just needs internal-or-wider)
or converting a self-independent instance method to `static func`
(ChatViewModel.inferProvider/calculateCost/detectGoodbyePhrase --
none of the three ever touched `self`, and constructing a real
ChatViewModel triggers a real network call in init, so static-ifying
them sidesteps that entirely rather than fighting it). Call sites
updated to `Self.foo(...)` where the static conversion required it.
Touches: GitSyncService's URL/secret-scanning helpers,
EmbeddingService's embedding (de)serialization, ContextSelectionService's
importance scoring, and the request-building/response-parsing helpers
on all four providers (OpenRouter, Ollama, OpenAI, Anthropic) -- the
core AI request/response layer, previously 100% untested.
Verified: full existing test suite (27 tests) still green, no
regressions. Tests for these functions land in the next commit.
Phase 2 of the test-suite rollout plan (peaceful-baking-kurzweil).
27 tests across 4 files, all targeting code that was already testable
the moment the target existed -- no visibility bumps, no refactors:
- GitignoreParserTests: MCPService.GitignoreParser's glob-to-regex
matching (wildcards, **, directory anchors, negation, comments).
- OpenRouterModelsTests: the string-vs-content-block-array decoders
on both the request side (APIMessage.MessageContent/ContentItem)
and response side (Choice.MessageContent, StreamChoice.Delta),
including image extraction from content blocks.
- AIProviderTests: ChatResponse/Usage decoding, with an explicit
regression guard that Usage.rawCostUSD always decodes to nil (it's
only ever set programmatically, never from API JSON).
- MessageCodableTests: confirms Message's transient fields
(isStreaming, isStarred, generatedImages, toolCalls,
thinkingContent) don't survive an encode/decode round-trip, and
documents that its custom == deliberately ignores role/timestamp/
attachments/modelId -- a real but non-obvious behavior worth
locking in with a test.
Removed the placeholder oAITests.swift example test now that there's
real coverage. Phase 1 of the test-suite rollout plan
(peaceful-baking-kurzweil).
The old Tests/oAITests/oAITests.swift + root Package.swift/Sources/
were a swift package init stub that @testable imported a fake empty
oAI module, completely disconnected from the real ~31K-line app
(built only via oAI.xcodeproj). Running `swift test` there would
have silently "passed" while testing nothing.
oAITests is a proper Unit Testing Bundle target added via Xcode's
target editor, wired into the app's scheme (TestAction references
oAITests.xctest). Verified with `xcodebuild test` before and after
removing the dead scaffold.
First phase of the test-suite rollout plan (peaceful-baking-kurzweil).
A search box above the Contents list filters TOC entries by each
linked section's full text content (not just the link title), so
e.g. searching "european" surfaces "Slash Commands" via its command
history date-format note. Pure vanilla JS/CSS, no dependencies --
the page is a static file opened directly in the default browser.
Tested interactively in Safari Technology Preview: filtering,
no-results state, reset, and click-through navigation all verified
working, in both the matched and empty-query cases.
Contacts was never actually broken by an Apple/OS bug -- it was a
wrong entitlement key in oAI.entitlements, now fixed (abf25bd). No
functional change here: the flag was already false in both places
this session, so behavior is identical; this just removes the
now-pointless beta-badge/conditional-row scaffolding built around it.
Confirmed root cause via tccd's own log output: the hardened-runtime
hardened-runtime prompting policy checks for
com.apple.security.personal-information.addressbook (the Contacts
framework's TCC service is still internally named kTCCServiceAddressBook,
a holdover from the old AddressBook framework), not
com.apple.security.personal-information.contacts as the entitlements
file had. With the correct key, tccd allows the prompt and access is
now granted correctly on both macOS 27 beta and 26.5.1 stable — this
was never an OS bug, notarization requirement, or beta-only issue.
Also keeps the fuller CNError domain/code/userInfo logging added while
diagnosing this, in case Contacts TCC issues resurface.
isContactsHiddenPendingAppleFix was flipped true on beta 2 after
CNContactStore.requestAccess returned instant "Access Denied" under
hardened runtime, while Calendar/Reminders/Location worked fine.
Rune just installed beta 4 and wants to retest.
Two machines that already had favorites before this sync feature
shipped will both have an empty favoriteModelsUpdatedAt, so the
first sync between them ties. Previously that meant the second
machine silently kept only its own set; now tied timestamps merge
via union and re-push, so no pre-existing favorites are lost.
Favorites now push/pull through a small oai_favorites.json file in the
same iCloud Drive folder used by Settings > Backup, reconciled by
last-write-wins timestamp on launch and app-become-active. Also adds
an Off/Daily/Weekly frequency picker so the full settings backup can
run itself (checked at launch and hourly) instead of requiring a
manual "Back Up Now" click every time.
Per Rune: the NSHelpManager-based Cmd+? fix from the last few commits
technically worked (registration was correct) but opened Apple's
broken generic Tips landing page instead of oAI's own content on the
macOS 27 beta this is built against — worse than the original
browser-tab behavior. Revisit at macOS 27 RC1 (see CLAUDE.md).
- openHelp() reverts to NSWorkspace.open() on index.html directly.
- Removed the "In-App Help" Ctrl+Cmd+H menu item entirely — HelpView's
panel (search already fully working) is reachable only via /help
from the input field now, by design.
- Renamed the custom CommandMenu("View") to CommandMenu("Chat") — it
was colliding with the "View" menu macOS auto-adds for
NavigationSplitView (Enter Full Screen, etc.), producing two
identically-titled top-level menus in the menu bar.
Cmd+/ was never reaching the "In-App Help" menu item — AppKit
auto-reserves Cmd+/ to open/focus the app's own Help menu (same
mechanism as Cmd+?), silently pre-empting any custom binding on that
combo, exactly like the earlier Cmd+H (Hide Application) conflict.
Verified live with computer-use before landing on Ctrl+Cmd+H:
Option+Cmd+/ has unpredictable menu-glyph rendering and didn't fire;
Option+Cmd+H is macOS's reserved "Hide Others" shortcut (visibly hid
other app windows when tested). Ctrl+Cmd+H showed no OS-level effect
and correctly opens the panel.
HelpView's search bar was already fully implemented and working —
this was purely a matter of the shortcut never reaching it.
GENERATE_INFOPLIST_FILE = YES with no INFOPLIST_FILE meant Xcode
synthesized Info.plist purely from INFOPLIST_KEY_* build settings and
silently ignored oAI/Info.plist on disk — so CFBundleHelpBookName/
CFBundleHelpBookFolder never made it into the built app. NSHelpManager
therefore couldn't resolve the book and macOS showed the generic Help
Center instead of oAI's help content (previous commit 74c8be8 fixed
openHelp() to call NSHelpManager, but that call had nothing to find).
Fix: point INFOPLIST_FILE at oAI/Info.plist so Xcode merges its extra
keys into the generated Info.plist, and add a synchronized-group
membership exception so Info.plist isn't also copied into Resources
(would otherwise produce a duplicate-file build warning).
openHelp() always found the bundled oAI.help folder, so it always took
the NSWorkspace.open(index.html) branch — handing the page to the
default web browser. The NSHelpManager branch, which launches the
native Help Viewer (with its built-in full-text search), was
unreachable dead code. Now always routes through NSHelpManager.
- ContentView now reads/writes SettingsService.sidebarVisible so the
NavigationSplitView sidebar's shown/hidden state survives relaunch,
matching the existing window size/position persistence.
- Default system prompt gains a rule: always reply in the user's
language, even for requests (e.g. translation) targeting another one.
Consolidates the mac.oai.pm subdomain references (introduced in the
PolyForm Noncommercial relicense) to the root oai.pm domain, across
the LICENSE file, README, and all Swift source file headers.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Switches the project from AGPL to a source-available license that
restricts commercial use — selling oAI or any part of it, standalone
or bundled into another product/service, now requires a separate
commercial license from the copyright holder. Noncommercial use,
study, modification, and sharing remain fully permitted.
Updates: LICENSE (canonical PolyForm Noncommercial 1.0.0 text +
commercial licensing contact note), SPDX headers and file-header
boilerplate across all Swift source files, the in-app About dialog's
license link (+ its localization catalog entry), README.md and
DEVELOPMENT.md license sections.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
⌘H is reserved by macOS for "Hide Application" and pre-empts app-level
menu bindings before they ever fire, so the Command History shortcut
never actually worked. Moved to ⇧⌘H and updated all references (in-app
help, macOS Help Book, README).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds three new Help sections covering the 2.4.1 features: connecting
external stdio MCP servers, Calendar/Reminders/Location access with
its approval flow, and parallel read-only research sub-agents. Also
notes French as a supported language and that OpenRouter's dedicated
image models are merged into the model picker automatically. Cleans
up a stray misplaced HTML comment above the Anytype section.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two contributing layout issues in the chat message bubble:
1. MessageRow's content VStack (icon + text HStack) had no
.frame(maxWidth: .infinity), so it sized to its content's ideal
width instead of the space actually available.
2. swift-markdown-ui renders paragraphs with mixed inline styling
(bold/italic runs next to plain text) as concatenated Text(+)
segments, which on macOS report their ideal unwrapped single-line
size for height purposes instead of wrapping — truncating with "…"
regardless of window width. Plain single-style paragraphs (a single
Text) weren't affected, which is why some lines wrapped fine and
others didn't.
Fixed by adding .frame(maxWidth: .infinity, alignment: .leading) to
the MessageRow content stack, and .fixedSize(horizontal: false,
vertical: true) to the markdown paragraph label so height is
recomputed for the width actually given instead of the ideal width.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The tool loop's max-iterations and empty-response fallbacks were showing
placeholder assistant bubbles ("[Tool loop reached maximum iterations]",
"[No response from the model — retrying]") followed by a "↩ Continuing…"
system message before silently re-running. None of that added anything
for the user, so the auto-continue now happens without any visible
message when there's no real content to show; genuine partial content
is still displayed as before, and usage/cost tracking is unaffected.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Lets the AI connect to any external stdio MCP server (e.g. safaridriver
--mcp) configured in Settings, with tools auto-discovered and prefixed
by server slug. Includes crash detection with backoff restart (5s/15s/30s)
and a Settings UI to add/enable/disable/remove servers.
Fixes the temp-dir allowlist in MCPService.isPathAllowed to also match
/tmp and /private/tmp (not just NSTemporaryDirectory(), which resolves
to a different per-user Darwin temp dir) so the MCP file tools can
actually read files external servers and image generation write there.
Also switches the Add Server sheet's argument parsing to a quote-aware
tokenizer so args containing spaces survive intact.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Fetches /api/v1/images/models in parallel with /models and merges results
into the model picker. Image-only models (e.g. Sourceful, Seedream, Flux
via this endpoint) were previously invisible since they don't appear in the
standard /models endpoint.
Models from the images API get usesImagesAPI=true and route through a new
generateImageAPIResponse() path in ChatViewModel that POSTs to /api/v1/images
with {model, prompt} instead of the chat completions endpoint. The response's
b64_json data is decoded and displayed via the existing GeneratedImagesView.
Cost is taken directly from the usage.cost field in the images API response
(USD per image) via a new rawCostUSD field on ChatResponse.Usage, bypassing
the token-based calculateCost() path used for chat models.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Personal Data Tools: native Calendar, Reminders, Contacts (hidden pending
Apple TCC fix in beta), and Location & Maps access via EventKit, Contacts
framework, and MapKit. Write actions (create event/reminder, complete
reminder) gate through an approval sheet. Four hardened-runtime entitlements
added to oAI.entitlements; Info.plist usage strings added for all services.
Personal Data section shows a β badge while Contacts is hidden.
2nd Brain always-trust: inline toggle on the Agent Skills row for the skill
named "2nd Brain" skips the bash approval dialog when the command contains
.brain_helper.py, gated by three runtime checks in MCPService.
Research agents: spawn_research_agents tool runs up to 5 concurrent read-only
sub-agents (read_file, list_directory, search_files, web_search — no write,
no bash, no nesting). Bounded by maxConcurrentAgents setting (default 3) and
a hard ceiling of 8 tasks. Added items field to Tool.Function.Parameters.Property
for JSON Schema array support; wired into AnthropicProvider.convertParametersToDict.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document Jarvis integration, Combine Conversations, model category
filter, sidebar navigation, prompt caching, and the 2nd Brain trust
toggle. Clarify that localization is AI/machine-translated rather than
reviewed by native speakers. Normalize all em-dashes to plain hyphens.
MACOSX_DEPLOYMENT_TARGET was silently bumped 26.2 -> 27.0 in commit
8451db1, most likely by Xcode beta auto-updating it when the project
was opened/built with the macOS 27 beta SDK. This shipped in the public
v2.4 release, meaning the app refused to launch on anything older than
macOS 27 beta. No code in the project actually requires macOS 27 APIs.
French (fr) added as a 5th supported language; full catalog translated.
Also caught up nb/sv/da/de for ~300 strings added since the last
localization pass (Jarvis, Anytype, model categories, reasoning effort,
Combine Conversations) plus Button/Toggle/Menu/CommandMenu titles and
custom sectionHeader/row helpers in Settings that were never extracted
by prior tooling, leaving Settings and the View menu English-only
regardless of locale.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Caches the system prompt/tools and growing conversation history via
cache_control breakpoints, cutting cost and latency on repeated turns.
Covers both the regular chat path and the tool-calling loop
(chatWithToolMessages), which has its own request-building code and was
initially missed. Cost calculation now accounts for cache write/read
pricing instead of treating all input tokens as full price. Verified
live: cache reads grow turn-over-turn in oAI.log.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Build settings referenced ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
= AccentColor but no such color set existed in Assets.xcassets, causing
a build warning. Added it using the app's existing blue accent (#0a7aca,
same as Color.oaiAccent) for consistency.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
primaryModel was being set to the model that performed the merge (or,
in AI mode, stamped onto every synthesized message). It should instead
be the most recently used model among the source conversations being
combined.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Auto-generated by Xcode/xcodebuild when no shared scheme exists yet;
not meant to be tracked.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Lets users multi-select 2+ saved conversations and merge them into one,
either by chronological concatenation or by having the default model
synthesize a single coherent conversation from the source transcripts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Message, Conversation, EmailLog: add nonisolated to inits — plain value
types have no actor isolation, but the macOS 27 SDK was inferring it
- EncryptionService: replace lazy var encryptionKey (which mutates self and
gets inferred as @MainActor) with an eagerly-initialized let in init()
- FileLogger: add nonisolated to shared, write, and minimumLevel so they
are callable from nonisolated AppLogger methods without warnings
- LogLevel.<: add nonisolated to the Comparable conformance method
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The save indicator was sitting in the bottom-right corner of the footer.
Moved it to the center of the header bar, where macOS apps conventionally
show the document/conversation title. An orange dot appears when there are
unsaved changes; clicking saves. Removed the indicator from the footer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace TextEditor with NativeTextEditor (NSViewRepresentable) so plain
Enter sends the message and Shift/Cmd+Enter inserts a newline. The old
TextEditor passed bare Return directly to NSTextView before SwiftUI's
onKeyPress could intercept it, accidentally making Cmd+Enter send instead.
- Add More…/Less toggle in ModelInfoView for descriptions longer than 250
characters, with smooth expand/collapse animation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New AppleFoundationProvider using FoundationModels framework (macOS 27+)
- Streaming via streamResponse(to:) → ResponseStream<String> snapshot deltas
- Session built with system prompt + conversation history injected as instructions text
- Full error mapping: context exceeded, guardrail violation, rate limit, availability states
- Settings.Provider.appleOnDevice case wired through ProviderRegistry, Color+Extensions, CreditsView
- inferProvider() detects "apple-" prefix model IDs
- Settings → General: Apple Intelligence section with live availability badge and deep link to System Settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace root VStack with NavigationSplitView (2-column, collapsible sidebar)
- Add SidebarView: new chat button, conversation search, list with swipe actions
- Slim HeaderView to text-only (provider + model + star); remove all icon rows
- Move status pills (Online, MCP, Synced) to footer right side
- Remove version number and shortcut hints from footer
- Add resizable InputBar with drag handle (persisted height) and globe/network.slash online toggle
- Fix Norwegian menu appearing on English systems (CFBundleLocalizations in Info.plist)
- Add View menu (Model Info, History, Stats, Credits, Online Mode toggle ⌘⇧O)
- Add ⌘L as alias for Search Conversations (muscle memory for /load users)
- Add Check for Updates to Help menu with download URL from Gitea API
- Add one-time Intel/Rosetta deprecation warning on first launch
- Swift 6: fix self.Self.isoString() call sites in DatabaseService
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Jarvis integration: manage oAI-Web agents and usage from inside the app (/jarvis command, Settings tab 11)
- Model category filter: keyword-based categorisation with popover picker in model selector
- Categories shown in ModelInfoView with coloured chips; dot indicators on model rows
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>