Skip to content

[codex] Extract chat turn phases#36

Merged
roackb2 merged 2 commits intomainfrom
codex/chat-turn-phase-extraction
May 2, 2026
Merged

[codex] Extract chat turn phases#36
roackb2 merged 2 commits intomainfrom
codex/chat-turn-phase-extraction

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 2, 2026

Summary

Extracts M10 and M11 chat turn orchestration phases:

  • adds turn-session.ts, turn-runtime.ts, and turn-tools.ts for ordinary turn session/runtime/tool preparation
  • adds turn-memory-maintenance.ts for inline/background maintenance, trace appending, latest-turn event summary updates, and background failure trace events
  • adds turn-persistence.ts for final turn persistence orchestration and final-compaction running seed updates
  • keeps ordinary-turn.ts as high-level phase orchestration with lease cleanup still in the finally path
  • documents the new chat modules in src/core/chat/README.md
  • adds focused unit tests for runtime preparation and memory-maintenance trace update behavior

Why

This advances the domain-module refactor by shrinking the ordinary chat turn harness into named core-only phase modules while preserving public turn behavior.

Validation

  • yarn test:unit src/__tests__/unit/core/chat-turn-runtime.test.ts
  • yarn test:unit src/__tests__/unit/core/chat-turn-memory-maintenance.test.ts
  • yarn vitest run src/__tests__/integration/memory/memory-integration.test.ts
  • yarn vitest run src/__tests__/integration/chat/chat-runtime.test.ts
  • yarn vitest run src/__tests__/integration/chat/session-submit.test.ts
  • yarn vitest run src/__tests__/integration/core/agent-loop.test.ts
  • yarn test:integration outside the sandbox
  • yarn eslint
  • yarn typecheck
  • yarn build

@roackb2 roackb2 merged commit 2575124 into main May 2, 2026
4 checks passed
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