Title: fix: end agent runs that stall instead of spinning forever by tristan-mouchet · Pull Request #593 · ycode/ycode · GitHub
Open Graph Title: fix: end agent runs that stall instead of spinning forever by tristan-mouchet · Pull Request #593 · ycode/ycode
X Title: fix: end agent runs that stall instead of spinning forever by tristan-mouchet · Pull Request #593 · ycode/ycode
Description: Summary An agent run whose provider request stalled — connection accepted, then no bytes, no error, no close — blocked the loop indefinitely. The browser held its SSE connection open and the panel spun with no way out. One run was observed hung for 103 minutes against a 29-minute budget. The cause is that MAX_RUN_MS was only checked between turns, so a request stuck mid-turn could outlive the budget without ever being noticed. Extracted from #574 so it can land on its own. Affects every provider, not just the one that surfaced it. Changes Arm an AbortController for MAX_RUN_MS and merge it with the caller's signal, so the in-flight request is cancelled when the budget runs out End the run with the existing resumable time-limit message rather than a silent done (a cancelled turn produces no output, which previously looked like a clean finish) Clear the deadline timer on every exit path, so an abandoned generator can't leave it armed Test plan Point the agent at an endpoint that accepts the connection and then goes silent; the run should end at the budget with "This ran out of time before finishing…" instead of hanging Verified locally against a stalling HTTP server: aborts at 1024ms on a 1000ms budget (AI_CHAT_MAX_DURATION=61) and surfaces the resumable error Run a normal agent build end to end and confirm it completes untouched, with no spurious time-limit error Confirm "continue" still resumes a run that hit the time limit, with earlier edits preserved Cancel a run mid-flight and confirm the caller's abort still works
Open Graph Description: Summary An agent run whose provider request stalled — connection accepted, then no bytes, no error, no close — blocked the loop indefinitely. The browser held its SSE connection open and the panel ...
X Description: Summary An agent run whose provider request stalled — connection accepted, then no bytes, no error, no close — blocked the loop indefinitely. The browser held its SSE connection open and the panel ...
Opengraph URL: https://github.com/ycode/ycode/pull/593
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:47a589e5-2019-5692-a45f-d5476e6f9f09 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 95EE:5FDBE:F3497:138FEA:6AFE42E1 |
| html-safe-nonce | fc3bbc02e45b34b99b8ad6f0e411591888687ac3d1eaa9829a2d3435c93606cc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUVFOjVGREJFOkYzNDk3OjEzOEZFQTo2QUZFNDJFMSIsInZpc2l0b3JfaWQiOiI3MzA1NTg1NDc1MDIyODk3ODg5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1c33bb17b14dbb5d1261f80c033c55b16837659749bb1e9df712812b54b5ec7b |
| hovercard-subject-tag | pull_request:4797626462 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/ycode/ycode/pull/593/files |
| twitter:image | https://avatars.githubusercontent.com/u/82507011?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/82507011?s=400&v=4 |
| og:image:alt | Summary An agent run whose provider request stalled — connection accepted, then no bytes, no error, no close — blocked the loop indefinitely. The browser held its SSE connection open and the panel ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/ycode/ycode git https://github.com/ycode/ycode.git |
| octolytics-dimension-user_id | 65892203 |
| octolytics-dimension-user_login | ycode |
| octolytics-dimension-repository_id | 1165452593 |
| octolytics-dimension-repository_nwo | ycode/ycode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1165452593 |
| octolytics-dimension-repository_network_root_nwo | ycode/ycode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ce393ea11ad276623b946bc9663d3e7d6f564275 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width