Skip to content

refactor(session): simplify execution and state workflows - #43933

Merged
kitlangton merged 3 commits into
v2from
clarify-session-state
Aug 21, 2026
Merged

refactor(session): simplify execution and state workflows#43933
kitlangton merged 3 commits into
v2from
clarify-session-state

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

Make Session execution and shared state workflows express transport decisions, state creation, pure projections, and no-op guards directly. The refactor preserves durable event ordering, cooperative-concurrency boundaries, State finalization, Form errors, and Session projections.

How

  • Replace the double-negative WebSocket eligibility calculation with hasHttpHooks.
  • Return and reuse a named ToolState created by startToolInput.
  • Express inbox admission's pure projection with Effect.map.
  • Inline State's single-use transform wrapper and return the interface directly.
  • Implement Form's required lookup with Effect.fromOption.
  • Use early guards for missing assistant and retry state.

Scope

Behavior-preserving Session/Core cleanup only; no transport policy, durable events, prompt admission, state lifecycle, form settlement, or projection changes.

Testing

  • Session execution tests: 67 passed
  • State, Form, and Session projector tests: 28 passed
  • Simplify follow-up: bun run test test/session-runner-tool-events.test.ts (17 passed)
  • bun typecheck from packages/core
  • Push hook: bun turbo typecheck --concurrency=3 (40-package workspace)

@kitlangton kitlangton changed the title refactor(session): clarify execution state refactor(session): simplify execution and state workflows Aug 21, 2026
@kitlangton
kitlangton enabled auto-merge (squash) August 21, 2026 17:37
@kitlangton
kitlangton merged commit 8fec7e0 into v2 Aug 21, 2026
10 checks passed
@kitlangton
kitlangton deleted the clarify-session-state branch August 21, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant