Skip to content

feat: add typed runtime to open#217

Merged
thymikee merged 4 commits intomainfrom
codex/typed-open-runtime
Mar 13, 2026
Merged

feat: add typed runtime to open#217
thymikee merged 4 commits intomainfrom
codex/typed-open-runtime

Conversation

@thymikee
Copy link
Contributor

@thymikee thymikee commented Mar 13, 2026

Summary

Add typed runtime payload support to open so callers can replace session runtime and relaunch atomically.
Make runtime actions replayable, validate malformed typed runtime payloads, normalize typed-runtime validation into structured daemon error responses, and forward typed runtime through batch steps.
Touched files: 13. Scope expanded beyond the initial session handler into replay/session-store/batch/docs to keep recording, replay, and typed transport consistent.

Note: runtime set now shares the same metro port validation path as typed open.runtime, so out-of-range ports fail fast instead of being accepted implicitly.

Validation

  • pnpm typecheck
  • pnpm exec node --test src/daemon/__tests__/session-store.test.ts src/daemon/handlers/__tests__/session.test.ts
  • pnpm test:smoke
  • pnpm test:unit (still fails in pre-existing src/daemon/__tests__/http-server.test.ts with "Promise resolution is still pending but the event loop has already resolved")

Copy link

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

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: 6b6e6e191a

ℹ️ 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 on lines +311 to +313
runtime: setSessionRuntimeHintsForOpen(sessionStore, sessionName, explicitRuntime),
previousRuntime,
replacedStoredRuntime: true,

Choose a reason for hiding this comment

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

P1 Badge Defer runtime replacement until open succeeds

resolveOpenRuntimeHints writes the new runtime into sessionStore before any launch work runs, so a later failure in applyRuntimeHints, relaunch close, or dispatch(..., 'open', ...) leaves the session mutated even though open returned an error. This breaks the “atomic replace-and-open” behavior and can make subsequent retries/replays run with an unintended runtime payload from a failed attempt.

Useful? React with 👍 / 👎.

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

PR Preview Action v1.8.1

QR code for preview link

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

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

@thymikee thymikee merged commit 674ae97 into main Mar 13, 2026
6 of 7 checks passed
@thymikee thymikee deleted the codex/typed-open-runtime branch March 13, 2026 18:35
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