fix: clean pause on transient Ollama capacity/overload without burning escalation#86
Merged
Merged
Conversation
…g escalation Transient Ollama conditions (HTTP 429/503/529, "server busy", "no slots available", "model is loading", "out of memory", "context deadline exceeded", "connection refused") were treated as story-quality failures, so a requirement only paused after burning reset -> manager -> tech-lead re-plan with misleading messages. - internal/llm/errors.go: IsCapacityError + ContainsCapacitySignature classify 429/503/529 typed errors and the stringified Ollama HTTP-client envelopes. Distinct from IsFatalAPIError (permanent) and 404 (config). - internal/engine/capacity_pause.go: Monitor.pauseIfCapacity pauses the requirement without consuming an escalation attempt; wired into reviewer, merge/conflict-resolution, manager diagnosis, tech-lead re-plan, and the native empty-diff path via agentCompletionHasCapacityError (scans the STORY_COMPLETED payload error field). Tests: internal/llm/capacity_test.go, ollama_test.go overload case, internal/engine/capacity_pause_test.go (unit + post-execution paths).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running multiple concurrent builds against one Ollama instance, the server returns transient overload/resource conditions: HTTP 429/503, `server busy`, `no slots available`, `maximum pending requests exceeded`, `model is loading`, `out of memory`, `context deadline exceeded`, `connection refused`. These were never classified, so the pipeline treated them as story-quality failures and only paused the requirement after burning the whole escalation chain (reset → manager diagnosis → tech-lead re-plan), with misleading messages ("agent produced no code changes", "re-plan failed").
Fix
Tests
TDD throughout: tests written first, watched fail, then implemented.
Green gate
```
go build -o /tmp/nxd ./cmd/nxd && go vet ./... && go test ./... -count=1 # exit 0, all 30 packages ok
golangci-lint run ./... # 0 issues
```