[codex] Return tool timeouts without draining blocked bodies#976
[codex] Return tool timeouts without draining blocked bodies#976mimeding wants to merge 9 commits into
Conversation
|
Follow-up from the live debug pass: the code change itself still verifies locally. Local checks:
GitHub |
|
Status update after adding the clean-PR rule: this PR is now draft because its attached GitHub checks are not clean yet. It should move back to ready only after #975 lands/rebases into the branch and |
|
Reran #976 after local verification. Local status is clean:
I could not rerun the failed GitHub job directly because GitHub requires repository admin rights for
No timeout-code regression is visible. Keeping this PR draft until #975 lands or the EventSource CI class is otherwise fixed. |
ef9afe3 to
9f315a0
Compare
d2e7169 to
1248480
Compare
Business rationale: The timeout-race branch needs to stay reviewable and green after rebasing onto current main, because nonblocking tool failures are part of the local-agent harness users depend on when tools misbehave. Coding rationale: This commit is a formatter-only cleanup in a file already touched by the branch. It preserves the PocketTTS compatibility behavior while satisfying the touched-file swift-format gate.
1248480 to
4f40ac5
Compare
Business rationale
Tool calls are part of the local-agent harness, so a single blocked or cancellation-hostile tool body must not freeze the whole conversation. Returning a structured timeout envelope quickly lets the agent recover, explain what happened, and keep the user in control even when an individual tool misbehaves.
Coding rationale
ToolRegistry.runToolBodynow races tool execution against a wall-clock timeout and returns the timeout envelope without waiting for the losing tool body to drain. The timeout tests use a blocking fixture that ignores cooperative cancellation without monopolizing the Swift concurrency executor, which better matches subprocess and blocking-I/O failure modes. The rebase keeps PocketTTS initialization compatible with the currently pinned FluidAudio API while preserving existing disk-detection behavior across both the repo-level and language-specific model cache layouts. CI cache changes stay scoped to the branch's test-core stability story.What changed
Validation
git fetch origin && git rebase origin/main- completed; conflict inToolRegistryTimeoutTests.swiftresolved by keeping the fixture-relative timeout assertion and applying the CI stabilization around it.swift build --package-path Packages/OsaurusCore- passed.swift build --package-path Packages/OsaurusCore -c release- passed.swift test --package-path Packages/OsaurusCore- passed: 1,437 tests in 192 suites, with sandbox integration tests skipped by their normal environment gate.xcrun swift-format lint --stricton every touched Swift file - passed.swiftlint lint --stricton every touched Swift file - passed file-by-file.git diff --check origin/main...HEAD- passed.Packages/OsaurusCLI.Non-scope
Residual risks
The branch still carries CI cache-hardening commits because the timeout race was historically sensitive to the GitHub runner environment. If maintainers prefer separating CI-cache policy from timeout behavior, those commits can be split after this rebase is reviewed.