Skip to content

Refactor Codex adapter lifecycle helpers - #1478

Merged
juliusmarminge merged 2 commits into
mainfrom
feature/refactor-codex-adapter-lifecycle
Mar 28, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
feature/refactor-codex-adapter-lifecycle

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Mar 28, 2026 •

Copy link
Copy Markdown
Member
  • Split adapter setup into named Effect.fn helpers
  • Keep listener registration and cleanup explicit

What Changed

Why

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Refactor-only change in the Codex provider adapter; primary risk is subtle lifecycle/cleanup differences around manager acquisition and event listener registration/shutdown.

Overview
Refactors apps/server/src/provider/Layers/CodexAdapter.ts to break makeCodexAdapter into named Effect.fn helpers, improving stack traces and making the lifecycle steps more explicit.

This extracts helpers for manager acquisition (acquireManager), attachment loading/encoding (resolveAttachment used by sendTurn), and event listener registration/cleanup (registerListener/unregisterListener plus writeNativeEvent), while keeping the adapter’s public operations and error mapping behavior the same.

Written by Cursor Bugbot for commit 9b9c9b3. This will update automatically on new commits. Configure here.

Note

Refactor CodexAdapter lifecycle helpers into named Effect.fn generators

Restructures CodexAdapter.ts to use named Effect.fn generators throughout, improving traceability in Effect traces.

  • Extracts acquireManager as a standalone helper that resolves an existing manager from options or constructs one via CodexAppServerManager
  • Adds resolveAttachment helper to consolidate inline file-reading logic from sendTurn, using Effect.forEach with concurrency 1
  • Extracts registerListener and unregisterListener as named helpers wired via Effect.acquireRelease, and adds writeNativeEvent to isolate native event logging
  • No behavioral changes; all handler logic (session management, turn sending, thread operations) is preserved as-is

Macroscope summarized 9b9c9b3.

- Split adapter setup into named Effect.fn helpers
- Keep listener registration and cleanup explicit
@coderabbitai

coderabbitai Bot commented Mar 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 01f6268a-0e28-45cf-9b3a-843cfef2fb9e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor-codex-adapter-lifecycle

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

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 28, 2026
- Replace `sendTurn` parameter inference with `ProviderSendTurnInput`
- Keep attachment resolution aligned with shared contracts
@juliusmarminge
juliusmarminge merged commit 23b3f0c into main Mar 28, 2026
11 checks passed
@juliusmarminge
juliusmarminge deleted the feature/refactor-codex-adapter-lifecycle branch March 28, 2026 01:43
dcherrera pushed a commit to dcherrera/t3code that referenced this pull request Jul 7, 2026
NeilTheFisher pushed a commit to NeilTheFisher/t3code that referenced this pull request Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant