Skip to content

fix: restore Codex app-server compatibility and mobile containment - #33

Merged
nonnil merged 10 commits into
mainfrom
cc/fix-codex-model-efforts
Jul 26, 2026
Merged

fix: restore Codex app-server compatibility and mobile containment#33
nonnil merged 10 commits into
mainfrom
cc/fix-codex-model-efforts

Conversation

@nonnil

@nonnil nonnil commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • accept current Codex app-server model catalogs, including max and ultra reasoning efforts
  • isolate E2E auth/model discovery from the user live app-server socket
  • contain Settings and long Moment rows at phone widths, with regression coverage and updated verification docs
  • update audited transitive dependencies and preserve minimatch compatibility through a documented Bun patch
  • stabilize the cross-process migration integration test under full-suite load

Verification

  • GIT_CONFIG_GLOBAL=/dev/null mise exec -- bun run verify (178 files, 1767 tests, production build)
  • GIT_CONFIG_GLOBAL=/dev/null mise exec -- bun run test:e2e (123 passed)
  • mise exec -- bun install --frozen-lockfile
  • mise exec -- bun run audit
  • git diff --check
  • live launchd TRAUMA: root, Codex auth, and Codex model catalog endpoints return 200; app-server 0.145.0 reports running

Summary by CodeRabbit

  • New Features
    • Added support for “max” and “ultra” reasoning effort options.
    • Updated the visible model catalog with the latest available model information.
  • Bug Fixes
    • Improved mobile layouts for Moments and Settings, preventing horizontal overflow.
    • Long source URLs now remain within the phone viewport while scrolling independently.
  • Documentation
    • Expanded browser verification guidance for mobile coverage and added an explicit note for the dependency security-review override rationale.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nonnil, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 64d3d1af-8f1d-4249-9bfe-6a0875b4c195

📥 Commits

Reviewing files that changed from the base of the PR and between 142c8c8 and d02f4dc.

📒 Files selected for processing (5)
  • src/server/db/schema.ts
  • tests/fixtures/runtime/output-sequence-worker.ts
  • tests/server/db/schema.test.ts
  • tests/server/runtime/process-lease-overlap.test.ts
  • tests/server/runtime/runtime-lease-test-helpers.ts
📝 Walkthrough

Walkthrough

The PR adds mobile overflow checks and layout constraints for Moments and Settings, isolates E2E app-server state, patches dependency exports, expands Codex reasoning-effort values, adds migration 0022, and improves runtime and backup test synchronization.

Changes

Responsive verification

Layer / File(s) Summary
Mobile layout and fixture coverage
src/server/e2e/fixture-reader.ts, src/components/moments/MomentBrowse.tsx, src/components/settings/SettingsPage.tsx
Long reader URLs are used by fixtures, while Moment and Settings layouts constrain content within narrow viewports.
Mobile browser checks
e2e/cross-device-responsive.spec.ts, e2e/reader.spec.ts, e2e/settings.spec.ts, docs/references/design-system/verification.md
Browser tests and verification guidance cover mobile overflow, long URLs, and long labels.
E2E isolation and test reliability
playwright.config.ts, tests/server/runtime/runtime-lease-test-helpers.ts, tests/server/runtime/process-lease-overlap.test.ts
E2E uses an isolated app-server socket, while worker output handling and migration overlap timing are made explicit.

Dependency compatibility

Layer / File(s) Summary
Dependency overrides and module exports
package.json, patches/brace-expansion@5.0.8.patch, docs/quality/verification.md
Dependency pins and a brace-expansion patch preserve callable CommonJS, default ESM, and named exports.

Codex persistence and model capabilities

Layer / File(s) Summary
Reasoning-effort contract and schema
src/server/translation/types.ts, src/server/db/schema.ts
Reasoning efforts include max and ultra, with centralized SQL literals used by database checks.
Migration 0022 and schema history
drizzle/0022_calm_speed.sql, drizzle/meta/*, src/server/db/bundled-migrations.ts
Migration 0022 replaces settings and translation-job tables, adds constraints and indexes, and is included in migration metadata and bundling.
Reasoning-effort migration validation
tests/server/db/schema.test.ts, tests/server/translation/codex-app-server.test.ts
Tests verify migration behavior and update the visible model catalog to gpt-5.6-sol with expanded reasoning capabilities.

Runtime and backup reliability

Layer / File(s) Summary
Migration lease waiting
src/server/runtime/runtime-lease-coordinator.ts
The migration lease wait window increases to 30 seconds.
Backup replay completion
tests/server/psychiatrist/api-routes.test.ts
Backup-related test completion predicates now require the after_finalizer phase.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant E2EFixture
  participant Browser
  participant MomentsPage
  participant SettingsPage
  E2EFixture->>Browser: materialize long URL fixtures
  Browser->>MomentsPage: load mobile /moments
  MomentsPage->>Browser: render constrained Moment row
  Browser->>SettingsPage: load mobile /settings
  SettingsPage->>Browser: render constrained model selector
  Browser->>Browser: measure horizontal overflow
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main themes of the PR: Codex app-server compatibility and mobile layout containment.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cc/fix-codex-model-efforts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/cross-device-responsive.spec.ts`:
- Around line 44-58: Update the test "keeps long Moment rows within the phone
viewport" to assert that the fixture’s long Moment content, specifically the
target READER_URL or corresponding Moment row, is visible after navigating to
/moments and before measuring document scrollWidth; retain the existing heading
and overflow assertions.

In `@e2e/settings.spec.ts`:
- Around line 12-50: Update the fixture in the settings viewport test around the
mocked codex model and selection to use a deliberately long, unbreakable model
identifier or displayName that exceeds the phone viewport’s native select width.
Ensure the model option and model.selectOption call both use this same long
value, while preserving the existing overflow assertion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a79e6869-bb72-438b-b47f-ab9baf9acbdb

📥 Commits

Reviewing files that changed from the base of the PR and between 8b13bee and 65b4ef2.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • docs/quality/verification.md
  • docs/references/design-system/verification.md
  • e2e/cross-device-responsive.spec.ts
  • e2e/reader.spec.ts
  • e2e/settings.spec.ts
  • package.json
  • patches/brace-expansion@5.0.8.patch
  • playwright.config.ts
  • src/components/moments/MomentBrowse.tsx
  • src/components/settings/SettingsPage.tsx
  • src/server/e2e/fixture-reader.ts
  • src/server/translation/types.ts
  • tests/server/runtime/process-lease-overlap.test.ts
  • tests/server/translation/codex-app-server.test.ts

Comment thread e2e/cross-device-responsive.spec.ts
Comment thread e2e/settings.spec.ts

@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: 65b4ef28fc

ℹ️ 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".

Comment thread src/server/translation/types.ts
Comment thread playwright.config.ts
@nonnil

nonnil commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

Review trace for the two top-level review bodies:

Validation: bun run audit passed; bun run verify passed with 178 files / 1768 tests plus production build; full Playwright E2E passed with 123 tests; startup smoke passed.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/server/db/schema.ts (1)

329-341: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Document why these checks use unqualified sql.raw column names.

appSettings (and translationJobs) now emit unqualified "id" / "translation_target_language" while every other table still emits "table"."column" via ${table.column}. This asymmetry looks arbitrary without context, and a future refactor "fixing" it back to ${table.column} would produce table-rebuild migrations whose CHECK bodies reference the old table name from inside __new_*. A one-line comment would lock in the intent.

♻️ Suggested comment
+  // Checks use unqualified column names via sql.raw so table-rebuild
+  // migrations (CREATE TABLE __new_app_settings ...) stay valid.
   () => [
     check("app_settings_id_check", sql.raw(`"id" = 'default'`)),
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/server/db/schema.ts` around lines 329 - 341, Add a concise comment
immediately above the checks in the appSettings schema explaining that the
unqualified sql.raw column names are intentional because qualified references
can retain the old table name during table-rebuild migrations. Preserve the
existing check expressions and apply the same documented intent where the
corresponding translationJobs checks use unqualified columns.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@drizzle/0022_calm_speed.sql`:
- Around line 17-45: Update drizzle/0022_calm_speed.sql lines 17-45 by removing
the early PRAGMA foreign_keys=ON and placing it after the final CREATE INDEX so
both table rebuilds run with enforcement disabled. In
tests/server/db/schema.test.ts lines 586-599, seed translation_chunks and
translation_projection_spans rows for the pre-migration translation_jobs record
before applyRuntimeMigrations, then assert both child rows remain in the
migrated output.

In `@tests/server/db/schema.test.ts`:
- Around line 586-599: Extend the migration test setup around the existing
translation job seed to insert at least one related row into translation_chunks
and one into translation_projection_spans before applyRuntimeMigrations. After
migration, query both child tables and assert their row counts remain unchanged,
alongside the existing foreign-key validation, so the 0022 translation_jobs
rebuild preserves cascaded child data.

In `@tests/server/runtime/runtime-lease-test-helpers.ts`:
- Around line 191-194: Update createJsonLineReader’s nextOutput implementation
so concurrent stderr.next() and stdout.next() reads are not discarded when
Promise.race resolves. Preserve each losing stream read’s result in a shared
merged-output queue, or initialize both stream readers once and enqueue every
produced event, ensuring later calls return all output without hangs.

---

Nitpick comments:
In `@src/server/db/schema.ts`:
- Around line 329-341: Add a concise comment immediately above the checks in the
appSettings schema explaining that the unqualified sql.raw column names are
intentional because qualified references can retain the old table name during
table-rebuild migrations. Preserve the existing check expressions and apply the
same documented intent where the corresponding translationJobs checks use
unqualified columns.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 211105ed-28a7-45cc-b128-e4d6d78a7a7a

📥 Commits

Reviewing files that changed from the base of the PR and between 65b4ef2 and 142c8c8.

📒 Files selected for processing (13)
  • drizzle/0022_calm_speed.sql
  • drizzle/meta/0022_snapshot.json
  • drizzle/meta/_journal.json
  • e2e/cross-device-responsive.spec.ts
  • e2e/settings.spec.ts
  • playwright.config.ts
  • src/server/db/bundled-migrations.ts
  • src/server/db/schema.ts
  • src/server/runtime/runtime-lease-coordinator.ts
  • tests/server/db/schema.test.ts
  • tests/server/psychiatrist/api-routes.test.ts
  • tests/server/runtime/process-lease-overlap.test.ts
  • tests/server/runtime/runtime-lease-test-helpers.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • playwright.config.ts
  • e2e/cross-device-responsive.spec.ts
  • e2e/settings.spec.ts

Comment thread drizzle/0022_calm_speed.sql
Comment thread tests/server/db/schema.test.ts
Comment thread tests/server/runtime/runtime-lease-test-helpers.ts Outdated
@nonnil

nonnil commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

Second EDA review round completed.

Adjudication and fixes:

  • 3652289965: the claimed production child-row cascade is not valid for the supported runtime migration runner. Direct upgrade proof showed foreign keys restored to ON, both seeded child tables retained exactly one row, and foreign_key_check returned no violations. The generated SQL was therefore left unchanged.
  • 3652289966: valid coverage gap. Commit 4cc43fe now seeds and verifies full translation_chunks and translation_projection_spans rows across the 0022 upgrade.
  • Schema nitpick from review 4781475442: commit 4cc43fe documents why the two CHECK expressions intentionally use unqualified raw column names during Drizzle table rebuilds.
  • 3652289967: valid output-loss race. Commit d02f4dc replaces independent racing reads with a retained lossless channel and adds a deterministic stderr-first/stdout-later regression test.

Verification on the pushed head:

  • mise exec -- bun run verify: passed, 178 files / 1769 tests plus production build.
  • Targeted migration and process-overlap tests: passed, 50 tests.
  • Focused backup failsafe suite: passed in six consecutive reruns after one transient pre-push failure; no hook bypass was used.
  • Signed commits pushed; local and remote head both d02f4dc30a0c47df9a549cafdeeef21c2cac47ad.

Each inline finding has an evidence-backed reply and is resolved.

@nonnil

nonnil commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: d02f4dc30a

ℹ️ 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".

@nonnil
nonnil merged commit 049f524 into main Jul 26, 2026
3 checks passed
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