MAESTRO: Merge PR #940 - backfill project field on SDK session creation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,11 +7,13 @@ These PRs fix various session lifecycle issues — orphaned messages, provider r
|
||||
- [x] Review PR #934 (`fix: terminate session on prompt-too-long instead of retrying indefinitely` by @jayvenn21). File: `src/services/worker/SDKAgent.ts`. Currently, prompt-too-long errors cause infinite retry loops. Steps: (1) `gh pr checkout 934` (2) Review — should detect the specific error and terminate the session cleanly (3) Verify no data loss on termination (pending observations should still be saved) (4) Run `npm run build` (5) If clean: `gh pr merge 934 --rebase --delete-branch`
|
||||
- **MERGED** (2026-02-06): Clean +5 line fix. Detects "Prompt is too long" in SDK response text and throws a fatal error, which propagates up to `startSessionProcessor` catch handler for clean session termination. No data loss — previously processed observations are already saved before this point. Build passes.
|
||||
|
||||
- [ ] Review PR #693 (`fix: prevent infinite restart loop that causes runaway API costs` by @ajbmachon). Files: `src/services/worker-types.ts`, `GeminiAgent.ts`, `OpenRouterAgent.ts`, `SessionManager.ts`, `SessionRoutes.ts`. Steps: (1) `gh pr checkout 693` (2) Review restart limiting logic — should have max restart count or cooldown (3) Verify it applies to all providers (Claude, Gemini, OpenRouter) (4) Run `npm run build` (5) If clean: `gh pr merge 693 --rebase --delete-branch`
|
||||
- [x] Review PR #693 (`fix: prevent infinite restart loop that causes runaway API costs` by @ajbmachon). Files: `src/services/worker-types.ts`, `GeminiAgent.ts`, `OpenRouterAgent.ts`, `SessionManager.ts`, `SessionRoutes.ts`. Steps: (1) `gh pr checkout 693` (2) Review restart limiting logic — should have max restart count or cooldown (3) Verify it applies to all providers (Claude, Gemini, OpenRouter) (4) Run `npm run build` (5) If clean: `gh pr merge 693 --rebase --delete-branch`
|
||||
- **MERGED** (2026-02-06): Applied directly to main (branch was 3+ weeks old). Adds `consecutiveRestarts` counter to ActiveSession, limits crash-recovery restarts to 3 with exponential backoff (1s, 2s, 4s), and adds defensive `memorySessionId` checks in GeminiAgent and OpenRouterAgent before expensive LLM calls. Build passes. Addresses $402+ runaway cost scenario reported by the author.
|
||||
|
||||
## Session Processing
|
||||
|
||||
- [ ] Review PR #940 (`fix: Backfill project field on SDK session creation` by @miclip). Files: `src/services/sqlite/SessionStore.ts`, `src/services/sqlite/sessions/create.ts`. Steps: (1) `gh pr checkout 940` (2) Review — should populate the project field when creating a session so observations are properly scoped (3) Small, focused change (4) Run `npm run build` (5) If clean: `gh pr merge 940 --rebase --delete-branch`
|
||||
- [x] Review PR #940 (`fix: Backfill project field on SDK session creation` by @miclip). Files: `src/services/sqlite/SessionStore.ts`, `src/services/sqlite/sessions/create.ts`. Steps: (1) `gh pr checkout 940` (2) Review — should populate the project field when creating a session so observations are properly scoped (3) Small, focused change (4) Run `npm run build` (5) If clean: `gh pr merge 940 --rebase --delete-branch`
|
||||
- **MERGED** (2026-02-06): Clean +18/-2 line fix. Adds a conditional UPDATE after INSERT OR IGNORE to backfill the project field when a later hook provides it — only updates when existing value is NULL or empty. Fixes race condition where PostToolUse hook creates the session before UserPromptSubmit sets the project. Both functional (`sessions/create.ts`) and class (`SessionStore.ts`) versions updated identically. Build passes.
|
||||
|
||||
- [ ] Review PR #937 (`fix(worker): gracefully process orphaned pending messages after session termination` by @jayvenn21). Files: `src/services/sqlite/PendingMessageStore.ts`, `src/services/worker-service.ts`, `src/services/worker/SessionManager.ts`. Steps: (1) `gh pr checkout 937` (2) Review — orphaned messages should be processed or discarded cleanly, not stuck forever (3) Run `npm run build` (4) If clean: `gh pr merge 937 --rebase --delete-branch`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user