Skip to content

feat: chat-first UI for canonical memory users#10171

Draft
Git-on-my-level wants to merge 38 commits into
mainfrom
codex/chat-first-ui-plan
Draft

feat: chat-first UI for canonical memory users#10171
Git-on-my-level wants to merge 38 commits into
mainfrom
codex/chat-first-ui-plan

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Gate the complete Chat-first experience from the existing canonical-memory whitelist, preserving the legacy experience for every non-member.
  • Render canonical tasks, goals, conversations, memories, and privacy-gated Rewind evidence as typed, interactive Chat blocks.
  • Add the canonical goal-list route and generated clients without changing the legacy goals endpoint.
  • Harden Omi-device capture detail boundaries and persist local Rewind evidence without syncing raw paths or evidence metadata to the model/backend.
  • Make pre-push failures actionable by reporting the child exit status or signal and the last executed phase.

Verification

  • make preflight
  • cd backend && .venv/bin/pytest tests/unit/test_chat_first_blocks.py tests/unit/test_workstream_router_contract.py -q (33 passed)
  • cd desktop/macos/agent && npm run build && npm test -- --run tests/omi-tool-manifest.test.ts tests/chat-first-capability-projection.test.ts tests/surface-session.test.ts tests/conversation-journal.test.ts (99 passed)
  • cd desktop/macos/Desktop && swift test --filter ChatFirstRichBlockTests (8 passed)
  • python3 .github/scripts/test_pr_preflight.py (22 passed)
  • Normal pre-push gate (passed; 35 preflight checks, full desktop Swift compile, launcher tests, tool-surface tests, and formatter checks)

Product invariants

INV-AGENT-*, INV-AUTH-1, INV-CHAT-1, INV-VOICE-1, INV-MEM-1, INV-MEM-3

Failure-Class: none

Review in cubic

@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 21, 2026, 1:55 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟡 Building Jul 21, 2026, 1:54 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@Git-on-my-level
Git-on-my-level marked this pull request as ready for review July 21, 2026 06:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d082a9fe7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return MemorySystem.LEGACY

return MemorySystem.CANONICAL
return MemorySystem.CANONICAL if canonical_memory_cohort.is_canonical_memory_user(uid) else MemorySystem.LEGACY

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve canonical selection for local memory fixtures

In the local/offline dev harness, seed-memory-scenario still writes Alice/Bob as canonical_users and child_env_for exports that selection as MEMORY_CANONICAL_USERS, but this resolver now ignores both db_client and the harness env/manifest and only checks the static production/E2E whitelist. After seeding the documented happy_path, alice therefore resolves LEGACY and /v3/memories/run-canonical-promotion no longer exercise the canonical memory path the fixture advertises.

Useful? React with 👍 / 👎.

Adds the server-owned, fail-closed chat_first_ui capability and operator guardrails, plus the singleton source filter and Firestore indexes required for the Omi capture archive. Regenerates all affected app clients.\n\nVerification:\n- BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-chat-first-backend-tests.txt bash backend/test.sh\n- backend/scripts/openapi_runner.sh scripts/export_openapi.py --surface app-client --check ../docs/api-reference/app-client-openapi.json\n- Python Swift/TypeScript OpenAPI generator freshness checks\n- app-client OpenAPI compatibility against origin/main\n- Black and git diff --check\n- fresh Sol pre-commit review
Projects the server-owned Chat-first capability through the desktop agent runtime and adds a main-Chat-only structured block tool. The backend validates canonical references; the local journal atomically binds receipts to the producing assistant turn. Legacy surfaces keep the unchanged base manifest and render new block cases inert.\n\nVerification:\n- backend focused chat-first capability/block suite (64 tests)\n- desktop agent focused journal/manifest/session suite (103 tests)\n- desktop agent build and tool-surface generator check\n- desktop Swift debug build and agent-logic harness\n- app-client OpenAPI export, generator freshness, compatibility, Black, desktop test-quality, and git diff checks\n- fresh Sol review-and-fix gate
Keep the generation-fenced main-Chat capability when an accepted run inherits its context snapshot, while reapplying the destination surface gate so non-main sessions remain off.\n\nVerification:\n- 55 focused agent capability/context/history/manifest tests\n- desktop agent TypeScript build\n- fresh Sol regression review and diff check
Adds the capability-gated main-Chat search_chat_history tool. The stdio child relays only after normal authorization; the parent kernel searches the caller's current-generation journal with strict ownership, date, excerpt, and 500-turn bounds.\n\nVerification:\n- 65 focused journal/search/manifest tests\n- desktop agent TypeScript build and tool-surface generator check\n- fresh Sol review: 69 focused tests and tool-surface contract suite\n- shared full agent harness deferred until concurrent T06 Swift compile completes
Adds fail-closed server-owned proactive intent, deferral, budget, receipt, and materialization-fetch contracts. It reserves budget before any judge call, emits no feature work for capability-off users, and never writes a chat transcript.\n\nVerification:\n- 35 focused T04 backend/API/generator tests (plus 11 generator tests)\n- app-client OpenAPI export, TS/Swift generation, and compatibility checks\n- Black and git diff checks\n- fresh Sol review-and-fix gate\n\nDeferred: source-owner wake hooks, real grounded judge binding, kernel materialization, and UI rendering.
Adds a server-sampled, fail-closed parallel shell with Chat as home, typed primary/More navigation, and capability projection before chat warmup. More→Dashboard routes to the one Chat rather than embedding an inline second composer; legacy shell behavior is preserved.\n\nVerification:\n- ChatFirstShell XCTest suite (including stable goals automation route)\n- Swift debug build and desktop test-quality check\n- agent-logic Swift gate: 438 focused lifecycle/state tests\n- agent runtime/node harness: 104 + 104 tests\n- named omi-chat-first-t06 bundle: signed/launched, healthy runtime, capability-off legacy shell and legacy Chat/Tasks/Conversations routes verified\n- fresh Sol review-and-fix gate\n\nEnabled live shell was not exercised because the server-authoritative dev control returned off for the seeded account; no local override was used.
Add the cohort-gated rich main-chat block renderer and an Omi-hardware capture archive with source-safe cache queries, typed discuss-in-chat routing, and honest playback states.\n\nVerification: git diff --check and desktop test-quality static check passed. Runtime Swift builds/tests are intentionally deferred to the final consolidated verification pass at user direction; no queued results are claimed.
Make question suggestions durable, one-tap normal chat interactions with tail-only controls, restart recovery, and a separate capability-gated deferral outbox. Add the cohort-only shared-store Tasks workspace with owner-fenced rollback behavior and source-safe capture links.\n\nVerification: static diff checks and independent Sol review/fix gates completed. Runtime builds, test suites, harness, and UI exercise are intentionally deferred to the single final verification pass at user direction.
Add the cohort-gated foreground Chat materializer, receipt-safe ordered kernel batch, and normal journal reconciliation for server-owned proactive intents.\n\nVerification: static diff checks plus a fresh Sol review/fix gate completed. Runtime builds, suites, harness, and UI exercise remain deferred to the single final verification pass at user direction.
Add the cohort-scoped canonical Goals surface and a generation-bound rich/sparse cold-start path. Cold-start delivery remains receipt-backed, and sparse-sequence terminal state now lifts proactive suppression through a durable journal receipt.\n\nVerification: static diff checks and fresh Sol review/fix gates completed. Runtime builds, suites, harness, and UI exercise remain intentionally deferred to the final consolidated verification pass at user direction.
Add shape-only Chat-first analytics, local-only focus acknowledgement evidence, and non-production fixture contracts for cohort-negative validation.\n\nVerification: static diff checks plus fresh Sol review/fix gate completed. The consolidated runtime, manifest-byte, and named-bundle verification pass begins next.
Repair Swift runtime, wire, and view integration faults surfaced by the consolidated desktop compile.\n\nVerification: static parse/diff checks and a fresh Sol repair review passed; focused Swift runtime verification resumes next.
Repair actor-isolated analytics injection, materialization driver capture, and explicit shared task-store ownership.\n\nVerification: static parse/diff checks and fresh Sol review passed; focused Swift verification resumes next.
Add an explicit JournalOperationResult initializer for materialization fields and repair async archive assertions.\n\nVerification: focused desktop compile and 39 Chat-first/capture tests passed; fresh Sol review passed.
Project immutable journal revisions correctly and reclaim expired deferral leases without allowing stale delivery settlement.\n\nVerification: focused journal suite passes 54/54; fresh Sol review passed.
Git-on-my-level and others added 15 commits July 21, 2026 16:24
…flight

Backend unit suite: update test fixtures to use the canonical-memory cohort
selector instead of the retired TaskWorkflowMode gating model. The PR rewrote
conversation_capture.py and candidates.py to gate on is_canonical_memory_user
rather than workflow_mode, but existing tests still mocked the old model.

Desktop Swift: move the chatFirst capability validation before the manifest
digest check so an invalid capability surfaces as .invalidChatFirstCapability
rather than a misleading .staleManifest from the digest comparison.

PR Metadata Preflight: fix the invariant ID from INV-AGENT-1 to INV-AGENT-*
to match the registry wildcard.
@Git-on-my-level

Copy link
Copy Markdown
Collaborator Author

Monitor follow-up:

  • Fixed and pushed the deferral payload bug: Question now encodes type: "questionCard", and ChatFirstDeferralOutboxDriverTests asserts the discriminator in the wire JSON.
  • Resolved the addressed deferral discriminator review thread.
  • Applied the pinned Swift formatter to ChatBubble.swift after local preflight found formatting drift.

Verification:

  • xcrun swift test --package-path Desktop --filter ChatFirstDeferralOutboxDriverTests — 3 passed.
  • desktop/macos/scripts/swift-format-wrapper.sh lint-scope — clean.
  • scripts/pr-preflight --pr-body-file /tmp/omi-pr-10171-body.md — 35 checks passed locally.
  • Backend pyright through backend/.venv — 0 errors.

Left unresolved intentionally:

  • Thread PRRT_kwDOLkKqys6Sel1i / comment 3619886339: I did not change the local fixture resolver. The PR’s stated design is a single code-owned canonical-memory entitlement (CANONICAL_MEMORY_USERS), and the previous resolver did not consume MEMORY_CANONICAL_USERS either; it still required static whitelist membership before rollout env could select canonical. So treating Alice/Bob harness env as entitlement would reintroduce a second selector, contrary to the PR’s spirit.

…moval

Upstream commit 4a82447 ('remove typing from the floating bar') replaced
the inline follow-up text field with a 'Continue in Omi' affordance and
moved continueAgent/archiveCurrentExchange calls out of the view. The
static-contract tests (source-inspection assertions) were not updated in
that commit because the Swift test suite was skipped (no Swift file
changes detected by the path filter).

This PR touches Swift files, causing the full Swift test suite to run and
exposing the stale assertions. Additionally, this PR renamed
'prompt: trimmedText' to 'prompt: effectivePrompt' to support
question-card continuation flows.

Updated assertions:
- FloatingBarTimingSignalTests: isFollowUpFocused → Continue in Omi
- AgentPillLifecycleTests: manager.continueAgent → Continue in Omi (x2)
- AgentPillLifecycleTests: archiveCurrentExchange(using:) now absent
- DesktopCoordinatorServiceTests: prompt: trimmedText → effectivePrompt
@Git-on-my-level

Copy link
Copy Markdown
Collaborator Author

Monitor follow-up: fixed three failing Desktop Swift static-contract test suites.

Root cause: upstream commit 4a82447 ("remove typing from the floating bar") replaced the inline follow-up text field with a "Continue in Omi" affordance and moved continueAgent / archiveCurrentExchange calls out of the view. The source-inspection tests were not updated in that commit because the Swift test suite was skipped (path filter detected no Swift changes). This PR touches Swift files, causing the full Swift suite to run and exposing the stale assertions.

Changes (3 test files, no production code):

  • FloatingBarTimingSignalTests.testFollowUpFocusUsesViewLifecycle: isFollowUpFocused = trueContinue in Omi (follow-up text field was replaced).
  • AgentPillLifecycleTests.testProviderRequestsStayInTheModelLoop: manager.continueAgent(from: pill, ...)Continue in Omi (call moved into AgentPillsManager).
  • AgentPillLifecycleTests.testSubagentComposerOnlyContinuesItsCanonicalSession: same stale assertion.
  • AgentPillLifecycleTests.testTypedSendDelegatesResponseSizingToWindow: state.archiveCurrentExchange(using: floatingChatProvider)XCTAssertFalse (moved to window).
  • DesktopCoordinatorServiceTests.testMainChatSendsRawUserTextToKernel: prompt: trimmedTextprompt: effectivePrompt (PR-caused: supports question-card continuation flows).

Verification:

  • xcrun swiftc -parse on all three modified test files — clean.
  • All assertions verified against current source via grep (each expected string confirmed present/absent as required).
  • Pre-push gate: 35 checks passed (193s) with the live PR body.

Note: the PR remains DIRTY (mergeable=CONFLICTING) due to a rebase conflict at commit 26/37 that predates this fix. The test assertion fixes will take effect once the rebase is resolved and CI re-runs.

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