Skip to content

refactor: split session handler modules - #268

Merged
thymikee merged 3 commits into
mainfrom
codex/session-handler-refactor
Mar 26, 2026
Merged

refactor: split session handler modules#268
thymikee merged 3 commits into
mainfrom
codex/session-handler-refactor

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Refactor the session handler family by extracting command-specific modules and shrinking the remaining routers.

  • move inventory, state, observability, and replay handling out of session.ts
  • split open preparation and replay runtime/healing into focused helper modules
  • add focused regression tests for the extracted seams

Closes #267

Validation

  • pnpm typecheck
  • pnpm test:unit
  • pnpm test:smoke
  • pnpm format

@github-actions

github-actions Bot commented Mar 26, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-268/

Built to branch gh-pages at 2026-03-26 20:13 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@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: 0e1946e872

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

};
}

const device = await refreshSessionDeviceIfNeeded(session.device, resolveDevice);

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 Validate relaunch args before refreshing/resolving device

prepareExistingOpenCommand now calls refreshSessionDeviceIfNeeded (and prepareNewOpenCommand calls resolveDevice) before validatePreparedOpenRequest runs in prepareResolvedOpenCommand. That means invalid relaunch inputs such as open --relaunch https://... or Android APK targets can be masked by DEVICE_NOT_FOUND when the device is unavailable, instead of returning the expected deterministic INVALID_ARGS error about the bad relaunch target.

Useful? React with 👍 / 👎.

@thymikee
thymikee merged commit a79b703 into main Mar 26, 2026
12 checks passed
@thymikee
thymikee deleted the codex/session-handler-refactor branch March 26, 2026 20:15
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.

Refactor session command handlers into focused modules

1 participant