From 8329d127afbfaa82d4fa5a24e9f5354774226f48 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 1 Apr 2026 11:34:39 -0700 Subject: [PATCH] Clarify orchestration state-mapping guidance - Prefer shared modules for transition and event mapping - Make failure and resume behavior explicit --- AGENTS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index cea5090cce..313387071d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,6 +23,8 @@ If a tradeoff is required, choose correctness and robustness over short-term con Long term maintainability is a core priority. If you add new functionality, first check if there is shared logic that can be extracted to a separate module. Duplicate logic across multiple files is a code smell and should be avoided. Don't be afraid to change existing code. Don't take shortcuts by just adding local logic to solve a problem. +When touching orchestration, streaming, or reconnect behavior, prefer extracting the state transition or event-mapping logic into a named shared module instead of embedding it inline in transport handlers or React components. Code in these paths should make failure and resume behavior explicit. + ## Package Roles - `apps/server`: Node.js WebSocket server. Wraps Codex app-server (JSON-RPC over stdio), serves the React web app, and manages provider sessions.