Skip to content

Add run boundary effect diagnostics#205

Open
briancavalier wants to merge 8 commits into
mainfrom
codex/run-boundary-diagnostics
Open

Add run boundary effect diagnostics#205
briancavalier wants to merge 8 commits into
mainfrom
codex/run-boundary-diagnostics

Conversation

@briancavalier

Copy link
Copy Markdown
Owner

Summary

  • add an internal unhandled-effect diagnostic sentinel for run/runPromise/runTask parameter types
  • preserve existing accepted runtime effects at each run boundary
  • add focused type tests for accepted runtime effects, handled programs, and rejected residual effects

Validation

  • corepack pnpm typecheck
  • corepack pnpm test
  • corepack pnpm build
  • corepack pnpm lint

Manual check

  • temporarily removed guessing-game handlePrint and confirmed runPromise now reports UnhandledEffectsError without explicit annotations

@briancavalier briancavalier marked this pull request as ready for review May 22, 2026 18:53

@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: 1988a3f703

ℹ️ 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 +14 to +15
: [UnhandledEffects<E, RuntimeEffects>] extends [never]
? unknown

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 Accept generics constrained to runtime effects

The new RunBoundary check rejects valid wrapper functions where E is already constrained to runtime effects (for example, <E extends Async | HandlerCapture<string> | Interrupt>(program: Fx<E, A>) => runTask(program)). With the current [Exclude<E, RuntimeEffects>] extends [never] condition, TypeScript does not reduce the generic case, so callers are forced to add unsafe casts (as now done in NodeRuntime.ts), which regresses API ergonomics and weakens compile-time guarantees for downstream users.

Useful? React with 👍 / 👎.

@briancavalier briancavalier added the experiment An experiment to explore an idea. May never be merged label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experiment An experiment to explore an idea. May never be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant