|
| 1 | +--- |
| 2 | +name: app-server-events-sync |
| 3 | +description: Maintain CodexMonitor and Codex app-server protocol parity. Use when asked to audit supported or missing app-server notifications/requests, trace event routing, diagnose schema drift in app-server payloads, or update docs/app-server-events.md after upstream Codex changes. |
| 4 | +--- |
| 5 | + |
| 6 | +# App-Server Events Sync |
| 7 | + |
| 8 | +Use this skill to keep CodexMonitor app-server integration accurate as `../Codex` evolves. |
| 9 | + |
| 10 | +## Canonical Source |
| 11 | + |
| 12 | +Start with: |
| 13 | +- `docs/app-server-events.md` |
| 14 | + |
| 15 | +Treat that file as the canonical runbook and update it when behavior changes. |
| 16 | + |
| 17 | +## Workflow |
| 18 | + |
| 19 | +1. Confirm upstream baseline: |
| 20 | +- Read Codex hash from `../Codex` and update the hash in `docs/app-server-events.md` title. |
| 21 | + |
| 22 | +2. Compare notification methods: |
| 23 | +- Diff Codex v2 notification method set against CodexMonitor routing in `src/utils/appServerEvents.ts` and `src/features/app/hooks/useAppServerEvents.ts`. |
| 24 | +- Update `Supported Events` and `Missing Events` sections in `docs/app-server-events.md`. |
| 25 | + |
| 26 | +3. Compare request methods: |
| 27 | +- Diff Codex v2 client/server request sets against CodexMonitor outgoing and inbound handling. |
| 28 | +- Update `Supported Requests`, `Missing Client Requests`, and `Server Requests` sections. |
| 29 | + |
| 30 | +4. Investigate schema drift when lists look unchanged: |
| 31 | +- Inspect v2 payload structs in `../Codex/codex-rs/app-server-protocol/src/protocol/v2.rs`. |
| 32 | +- Compare parser and normalization edges in `src/utils/appServerEvents.ts`, `src/features/app/hooks/useAppServerEvents.ts`, and `src/features/threads/utils/threadNormalize.ts`. |
| 33 | + |
| 34 | +5. Implement support when requested: |
| 35 | +- Add method/type support at parsing edges first. |
| 36 | +- Route in app event hook. |
| 37 | +- Update thread/item reducers and rendering only if needed. |
| 38 | +- Keep app/daemon parity and avoid duplicated logic. |
| 39 | + |
| 40 | +6. Validate: |
| 41 | +- Run targeted tests for touched files. |
| 42 | +- Run `npm run typecheck`. |
| 43 | +- Run `npm run test` for frontend behavior changes. |
| 44 | +- Run `cd src-tauri && cargo check` for backend changes. |
| 45 | + |
| 46 | +## Key Files |
| 47 | + |
| 48 | +- Routing/types: `src/utils/appServerEvents.ts` |
| 49 | +- Event router: `src/features/app/hooks/useAppServerEvents.ts` |
| 50 | +- Handler composition: `src/features/threads/hooks/useThreadEventHandlers.ts` |
| 51 | +- Item/turn handlers: `src/features/threads/hooks/useThreadItemEvents.ts`, `src/features/threads/hooks/useThreadTurnEvents.ts` |
| 52 | +- Normalization: `src/features/threads/utils/threadNormalize.ts` |
| 53 | +- State: `src/features/threads/hooks/useThreadsReducer.ts` |
| 54 | +- Outgoing requests: `src/services/tauri.ts`, `src-tauri/src/shared/codex_core.rs` |
| 55 | +- Daemon RPC: `src-tauri/src/bin/codex_monitor_daemon/rpc.rs` and `rpc/*` |
| 56 | + |
| 57 | +## References |
| 58 | + |
| 59 | +- Quick command set: `references/quick-commands.md` |
| 60 | +- Canonical runbook: `docs/app-server-events.md` |
| 61 | + |
| 62 | +## Output Expectations |
| 63 | + |
| 64 | +When asked for an audit or update: |
| 65 | +- Report concrete supported and missing method deltas. |
| 66 | +- Cite exact files that need edits. |
| 67 | +- Update `docs/app-server-events.md` in the same change when behavior changed. |
| 68 | +- Call out deliberate non-support explicitly (for example deprecated methods). |
0 commit comments