Skip to content

fix(cloud-agent): classify gateway duration limits as timeouts - #8971

Open
eshurakov wants to merge 1 commit into
mainfrom
kilo/misty-data-ueo
Open

eshurakov wants to merge 1 commit into
mainfrom
kilo/misty-data-ueo

Conversation

@eshurakov

Copy link
Copy Markdown
Contributor

Summary

  • Add a narrowly scoped gateway duration-limit wording match to the existing classifyAssistantFailureText timeout branch. The duration is numeric rather than hardcoded to 600 seconds.
  • Classify the observed UnknownError with a JSON envelope in data.message as timeout, reusing the existing Assistant request timed out safe message.
  • Add the exact observed envelope regression and a negative envelope mentioning only plural timeouts, which remains unknown / Assistant request failed.
  • Preserve structured error_type origin precedence, existing safe messages, other reason mappings, and interrupt handling. No UI, gateway, wrapper, dependency, retry, or budget changes.

Verification

No manual, browser, or live gateway tests were run. This is a pure classifier change verified with local automated tests; a unit test does not exercise the live gateway path.

Automated Checks

  • Before the implementation change, pnpm --filter cloud-agent-next test src/session/safe-failure-projection.test.ts failed exactly the new observed-envelope regression: received unknown / Assistant request failed; 313 other tests passed, including the new negative case.
  • After the fix, pnpm --filter cloud-agent-next test src/session/safe-failure-projection.test.ts: all 314 tests passed, including existing structured-origin precedence and interrupt coverage.
  • pnpm --filter cloud-agent-next typecheck: passed, including the package-script wrapper typecheck.
  • pnpm --filter cloud-agent-next lint: passed.
  • pnpm format services/cloud-agent-next/src/shared/assistant-failure.ts services/cloud-agent-next/src/session/safe-failure-projection.test.ts: passed.
  • git diff --check and git diff --check origin/main...HEAD: passed.

Visual Changes

N/A. No UI changes.

Reviewer Notes

  • The fallback intentionally depends on the distinctive gateway duration-limit sentence, not on broad matches for plural timeouts or generic duration-limit text. Future gateway copy changes may require updating this fallback. Recognized structured gateway origins remain authoritative.
  • This only improves the classification and safe wording once the failure is observed. It neither prevents the timeout nor changes the 600-second budget, retry behavior, or failure-delivery timing.
  • Uncovered gaps: live 600-second gateway termination, SSE-to-wrapper transport, deployed Worker/UI rendering, full service tests, and Workers-runtime integration/E2E tests were not exercised. No deployment was performed.

@kilo-code-bot

kilo-code-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The change adds a narrowly anchored duration-limit pattern to the existing timeout branch and a matching regression pair; I found no bugs, security concerns, or behavioral regressions in the two changed files.

Assumptions: [INFERENCE] The live gateway/Wrapper path and the deployed Worker were not exercised here (no execution permitted), so the fix is verified only against the unit-level projection logic; the fallback also depends on the gateway copy remaining stable, which the PR description already acknowledges.

Files Reviewed (2 files)
  • services/cloud-agent-next/src/shared/assistant-failure.ts
  • services/cloud-agent-next/src/session/safe-failure-projection.test.ts

Reviewed by deepseek-flash-latest · Input: 57.5K · Output: 7.6K · Cached: 756.2K

Review guidance: REVIEW.md from base branch main

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant