Skip to content

Update README.md#11

Merged
akshaynarisetti merged 1 commit into
mainfrom
Bentlybro-patch-1
Mar 29, 2024
Merged

Update README.md#11
akshaynarisetti merged 1 commit into
mainfrom
Bentlybro-patch-1

Conversation

@Bentlybro
Copy link
Copy Markdown
Contributor

@Bentlybro Bentlybro commented Mar 29, 2024

image

Copy link
Copy Markdown
Contributor

@akshaynarisetti akshaynarisetti left a comment

Choose a reason for hiding this comment

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

Much clearer now, thanks!

@akshaynarisetti akshaynarisetti merged commit 6e3fd36 into main Mar 29, 2024
mdmohsin7 added a commit that referenced this pull request Oct 18, 2025
closes #3241

before:


https://github.com/user-attachments/assets/d00d815c-8419-4c1b-96fb-ec20365fba44

logs:

```
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: Bad state: No element
flutter: 
#0      ListBase.firstWhere (dart:collection/list.dart:132:5)
#1      SharedPreferencesUtil.disableApp (package:omi/backend/preferences.dart:255:22)
#2      _AppDetailPageState._toggleApp (package:omi/pages/apps/app_detail/app_detail.dart:1129:13)
#3      _AppDetailPageState.build.<anonymous closure> (package:omi/pages/apps/app_detail/app_detail.dart:576:48)
#4      _AnimatedLoadingButtonState._handleOnPressed (package:omi/widgets/animated_loading_button.dart:38:27)
#5      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1204:21)
#6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:345:24)
#7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:758:11)
#8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:383:5)
#9      BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:353:7)
#10     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:173:27)
#11
```

after:


https://github.com/user-attachments/assets/26ea5c91-e73a-44f4-ba76-4b804876c5df

<img width="1032" height="257" alt="Screenshot 2025-10-18 at 11 15
52 PM"
src="https://github.com/user-attachments/assets/44e4e46b-b654-4599-84ee-8ee0920b1cd3"
/>
@ellaaicare
Copy link
Copy Markdown

iOS Investigation - Root Cause Analysis

After investigating the iOS codebase and backend integration:

iOS Side (Not the issue)

  • getConversations() in lib/backend/http/api/conversations.dart does NOT filter by source
  • Queries /v1/conversations?include_discarded=true&limit=50&offset=0&statuses=processing,completed
  • Uses ServerConversation.fromJson() which should handle any valid conversation

Backend Side (Likely issue)

The V2 pipeline stores conversations via FirestoreClient.store_voice_conversation() which writes directly to Firestore:

# Path: users/{uid}/conversations/{session_id}
conversation_data = {
    'id': session_id,
    'uid': uid,
    'created_at': datetime.utcnow(),  # ⚠️ Using naive datetime
    'transcript': transcript,
    'transcript_segments': segments,
    'source': source,
    'status': 'completed',
    'discarded': False,
    'is_voice_conversation': True,
    'turn_count': len(segments),
}

Potential Issues Found:

  1. Timezone-naive datetimes: V2 uses datetime.utcnow() which creates timezone-naive datetimes. The get_conversations() query may fail with created_at comparisons. Should use datetime.now(timezone.utc).

  2. Missing required fields: The normal conversation flow uses upsert_conversation() which includes many more fields:

    • language
    • structured (with title, overview, emoji, category, etc.)
    • started_at / finished_at
    • plugins_results
    • geolocation
  3. No encryption: Normal conversations use _prepare_conversation_for_write() which handles encryption. V2 bypasses this.

  4. Firestore composite index: The query uses (discarded, status, created_at DESC) - if V2 conversations have incompatible field types, they may be silently excluded.

Recommended Backend Fix:

V2 should use the same upsert_conversation() function from database/conversations.py instead of direct Firestore writes. This ensures consistent field structure, encryption, and indexing.

Quick Test:

Check if the V2 conversations appear with this query (bypasses REST API):

# In Firebase console, query:
# users/{uid}/conversations where source == 'voice_mode_v2_manual'

If they exist there but not via API, it's a query/field mismatch issue.

This is a backend issue, not iOS.

m13v pushed a commit that referenced this pull request Feb 26, 2026
…symlink)

## Root Cause

After `xcrun swift build --arch arm64`, `Desktop/.build/release/Omi Computer`
does NOT exist (the `release/` symlink is not updated). The `cp` fails silently,
leaving `/tmp/OmiComputer-arm64` empty. The echo showed a false-positive
`arm64 binary: arm64` because `file /tmp/OmiComputer-arm64` (non-existent)
outputs the filepath which contains "arm64", and grep -oE matched it.

## Fix

Use explicit arch-specific output paths throughout:
- arm64: `Desktop/.build/arm64-apple-macosx/release/$BINARY_NAME`
- x86_64: `Desktop/.build/x86_64-apple-macosx/release/$BINARY_NAME`
- Sparkle: x86_64 arch path, fallback to arm64
- SWIFT_BUILD_DIR: x86_64 arch path, fallback to arm64

The `release/` symlink is never used. Both arch dirs exist after build #11
confirmed that --arch x86_64 (run after arm64) creates x86_64-apple-macosx/.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
m13v pushed a commit that referenced this pull request Feb 26, 2026
…symlink)

## Root Cause

After `xcrun swift build --arch arm64`, `Desktop/.build/release/Omi Computer`
does NOT exist (the `release/` symlink is not updated). The `cp` fails silently,
leaving `/tmp/OmiComputer-arm64` empty. The echo showed a false-positive
`arm64 binary: arm64` because `file /tmp/OmiComputer-arm64` (non-existent)
outputs the filepath which contains "arm64", and grep -oE matched it.

## Fix

Use explicit arch-specific output paths throughout:
- arm64: `Desktop/.build/arm64-apple-macosx/release/$BINARY_NAME`
- x86_64: `Desktop/.build/x86_64-apple-macosx/release/$BINARY_NAME`
- Sparkle: x86_64 arch path, fallback to arm64
- SWIFT_BUILD_DIR: x86_64 arch path, fallback to arm64

The `release/` symlink is never used. Both arch dirs exist after build #11
confirmed that --arch x86_64 (run after arm64) creates x86_64-apple-macosx/.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
m13v added a commit that referenced this pull request Feb 26, 2026
…symlink) (#5165)

## Root Cause

After `xcrun swift build --arch arm64`, `Desktop/.build/release/Omi
Computer` does NOT exist (the `release/` symlink is not updated by
`--arch` on Codemagic M2). The `cp` failed silently. The echo showed a
**false-positive** `arm64 binary: arm64` because `file
/tmp/OmiComputer-arm64` (non-existent file) outputs the filepath which
contains "arm64", and `grep -oE` matched it.

Build log evidence (build `69a065cb5f240a649219ee41`):
- Line 200: `cp: Desktop/.build/release/Omi Computer: No such file or
directory`
- Line 201: `arm64 binary: arm64` ← false positive from filename match,
not real binary

## Fix

Use explicit arch-specific output paths throughout (never use `release/`
symlink):
- arm64 binary: `Desktop/.build/arm64-apple-macosx/release/$BINARY_NAME`
- x86_64 binary:
`Desktop/.build/x86_64-apple-macosx/release/$BINARY_NAME`
- Sparkle: x86_64 arch path, fallback to arm64
- SWIFT_BUILD_DIR: x86_64 arch path, fallback to arm64

Both arch dirs confirmed to exist in build #11 (x86_64-apple-macosx/
created when --arch x86_64 runs after arm64).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
m13v added a commit that referenced this pull request Feb 26, 2026
## Problem

Build #12 failed at \"Build Swift app (arm64 + x86_64)\" on a fresh
Codemagic Mac mini M2:

```
ERROR: arm64 binary not found at Desktop/.build/arm64-apple-macosx/release/Omi Computer
artifacts
checkouts
repositories
workspace-state.json
```

Root cause: SPM needs to download ~673MB of binary artifacts (Firebase,
Sentry, Sparkle xcframeworks) on a fresh machine. When `xcrun swift
build --arch arm64` runs, it tries to download everything **and
compile** in a single step. The download failed/aborted mid-way (375MB
of 673MB downloaded), leaving no `arm64-apple-macosx/` directory — so
compilation never started. Without `set -e`, the script continued to the
binary existence check and exited with 1.

Build #11 succeeded only because that machine had a warm SPM cache from
previous builds.

## Fix

1. **New \"Resolve SPM packages\" step** — runs `xcrun swift package
resolve` before building, with a 3-attempt retry loop. This
pre-downloads all binary artifacts. If the first attempt fails partway,
the second attempt resumes from where it left off (SPM checkpoints
downloads).

2. **`--triple` instead of `--arch`** — switches from `xcrun swift build
--arch arm64` to `--triple arm64-apple-macosx`. This matches the local
`release.sh` behavior and ensures the output binary **always** lands in
`.build/arm64-apple-macosx/release/` regardless of the machine's native
architecture (on native M2, `--arch arm64` may use the `release/`
symlink path).

3. **SPM cache** — adds `~/Library/Caches/org.swift.swiftpm` to
Codemagic's build cache so binary xcframeworks are not re-downloaded on
every subsequent build.

## Result

- Fresh machine: resolve step downloads packages with retry, then both
builds compile using already-cached artifacts
- Warm machine: resolve is instant (already cached), builds proceed
normally

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
closes BasedHardware#3241

before:


https://github.com/user-attachments/assets/d00d815c-8419-4c1b-96fb-ec20365fba44

logs:

```
flutter: ----------------FIREBASE CRASHLYTICS----------------
flutter: Bad state: No element
flutter: 
#0      ListBase.firstWhere (dart:collection/list.dart:132:5)
BasedHardware#1      SharedPreferencesUtil.disableApp (package:omi/backend/preferences.dart:255:22)
BasedHardware#2      _AppDetailPageState._toggleApp (package:omi/pages/apps/app_detail/app_detail.dart:1129:13)
BasedHardware#3      _AppDetailPageState.build.<anonymous closure> (package:omi/pages/apps/app_detail/app_detail.dart:576:48)
BasedHardware#4      _AnimatedLoadingButtonState._handleOnPressed (package:omi/widgets/animated_loading_button.dart:38:27)
BasedHardware#5      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1204:21)
BasedHardware#6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:345:24)
BasedHardware#7      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:758:11)
BasedHardware#8      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:383:5)
BasedHardware#9      BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:353:7)
BasedHardware#10     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:173:27)
BasedHardware#11
```

after:


https://github.com/user-attachments/assets/26ea5c91-e73a-44f4-ba76-4b804876c5df

<img width="1032" height="257" alt="Screenshot 2025-10-18 at 11 15
52 PM"
src="https://github.com/user-attachments/assets/44e4e46b-b654-4599-84ee-8ee0920b1cd3"
/>
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…symlink)

## Root Cause

After `xcrun swift build --arch arm64`, `Desktop/.build/release/Omi Computer`
does NOT exist (the `release/` symlink is not updated). The `cp` fails silently,
leaving `/tmp/OmiComputer-arm64` empty. The echo showed a false-positive
`arm64 binary: arm64` because `file /tmp/OmiComputer-arm64` (non-existent)
outputs the filepath which contains "arm64", and grep -oE matched it.

## Fix

Use explicit arch-specific output paths throughout:
- arm64: `Desktop/.build/arm64-apple-macosx/release/$BINARY_NAME`
- x86_64: `Desktop/.build/x86_64-apple-macosx/release/$BINARY_NAME`
- Sparkle: x86_64 arch path, fallback to arm64
- SWIFT_BUILD_DIR: x86_64 arch path, fallback to arm64

The `release/` symlink is never used. Both arch dirs exist after build BasedHardware#11
confirmed that --arch x86_64 (run after arm64) creates x86_64-apple-macosx/.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…symlink) (BasedHardware#5165)

## Root Cause

After `xcrun swift build --arch arm64`, `Desktop/.build/release/Omi
Computer` does NOT exist (the `release/` symlink is not updated by
`--arch` on Codemagic M2). The `cp` failed silently. The echo showed a
**false-positive** `arm64 binary: arm64` because `file
/tmp/OmiComputer-arm64` (non-existent file) outputs the filepath which
contains "arm64", and `grep -oE` matched it.

Build log evidence (build `69a065cb5f240a649219ee41`):
- Line 200: `cp: Desktop/.build/release/Omi Computer: No such file or
directory`
- Line 201: `arm64 binary: arm64` ← false positive from filename match,
not real binary

## Fix

Use explicit arch-specific output paths throughout (never use `release/`
symlink):
- arm64 binary: `Desktop/.build/arm64-apple-macosx/release/$BINARY_NAME`
- x86_64 binary:
`Desktop/.build/x86_64-apple-macosx/release/$BINARY_NAME`
- Sparkle: x86_64 arch path, fallback to arm64
- SWIFT_BUILD_DIR: x86_64 arch path, fallback to arm64

Both arch dirs confirmed to exist in build BasedHardware#11 (x86_64-apple-macosx/
created when --arch x86_64 runs after arm64).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
…Hardware#5166)

## Problem

Build BasedHardware#12 failed at \"Build Swift app (arm64 + x86_64)\" on a fresh
Codemagic Mac mini M2:

```
ERROR: arm64 binary not found at Desktop/.build/arm64-apple-macosx/release/Omi Computer
artifacts
checkouts
repositories
workspace-state.json
```

Root cause: SPM needs to download ~673MB of binary artifacts (Firebase,
Sentry, Sparkle xcframeworks) on a fresh machine. When `xcrun swift
build --arch arm64` runs, it tries to download everything **and
compile** in a single step. The download failed/aborted mid-way (375MB
of 673MB downloaded), leaving no `arm64-apple-macosx/` directory — so
compilation never started. Without `set -e`, the script continued to the
binary existence check and exited with 1.

Build BasedHardware#11 succeeded only because that machine had a warm SPM cache from
previous builds.

## Fix

1. **New \"Resolve SPM packages\" step** — runs `xcrun swift package
resolve` before building, with a 3-attempt retry loop. This
pre-downloads all binary artifacts. If the first attempt fails partway,
the second attempt resumes from where it left off (SPM checkpoints
downloads).

2. **`--triple` instead of `--arch`** — switches from `xcrun swift build
--arch arm64` to `--triple arm64-apple-macosx`. This matches the local
`release.sh` behavior and ensures the output binary **always** lands in
`.build/arm64-apple-macosx/release/` regardless of the machine's native
architecture (on native M2, `--arch arm64` may use the `release/`
symlink path).

3. **SPM cache** — adds `~/Library/Caches/org.swift.swiftpm` to
Codemagic's build cache so binary xcframeworks are not re-downloaded on
every subsequent build.

## Result

- Fresh machine: resolve step downloads packages with retry, then both
builds compile using already-cached artifacts
- Warm machine: resolve is instant (already cached), builds proceed
normally

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

3 participants