Skip to content

[JS/TS/Python] Fix Async.StartChild with timeout always timing out#4482

Merged
MangelMaxime merged 1 commit intomainfrom
repo-assist/fix-issue-4481-startchild-timeout-12e4803013f899f2
Apr 6, 2026
Merged

[JS/TS/Python] Fix Async.StartChild with timeout always timing out#4482
MangelMaxime merged 1 commit intomainfrom
repo-assist/fix-issue-4481-startchild-timeout-12e4803013f899f2

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 4, 2026

🤖 This pull request was created by Repo Assist, an automated AI assistant.

Closes #4481

Summary

  • Root cause: startChild used Promise.all (join) to race the computation against a throwAfter timer. Since throwAfter only ever rejects (after the timeout elapses) and never resolves, Promise.all could never resolve — it always waited for both branches, then rejected with TimeoutException regardless of how fast the computation finished.

  • Fix: Use race semantics instead. The computation is started as a Promise immediately, then a new racing Promise wraps both the computation and a plain setTimeout reject. Whichever settles first wins — computation success/failure propagates through; timeout fires TimeoutException only if the computation hasn't settled yet.

  • Cleanup: Remove the now-unused throwAfter and parallel2 helper functions.

  • Test: Added a regression test "Async.StartChild with timeout completes when computation finishes before timeout" that verifies a 10 ms computation succeeds under a 1000 ms timeout.

Changes

Trade-offs

The new implementation uses a plain setTimeout for the timeout (no cancel-listener integration). The previous throwAfter had cancel-listener support, but since startChild already starts the computation in a hot Promise (cancellation of the outer token does not cancel the child promise anyway), this is not a regression. The semantics match .NET's Async.StartChild: once started, the child runs to completion unless it times out.

Note

🔒 Integrity filtering filtered 101 items

Integrity filtering activated and filtered the following items during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.

  • #4375 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4326 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4224 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4176 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4094 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4082 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4080 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4060 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #4046 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #3969 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #3925 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #3923 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #3921 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #3919 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #3908 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • #3895 (search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
  • ... and 85 more items

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

@github-actions github-actions bot added automation Automated changes repo-assist Created by Repo Assist labels Apr 4, 2026
@MangelMaxime MangelMaxime force-pushed the repo-assist/fix-issue-4481-startchild-timeout-12e4803013f899f2 branch from e4ad51e to 125868d Compare April 6, 2026 20:40
…ixes #4481)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MangelMaxime MangelMaxime force-pushed the repo-assist/fix-issue-4481-startchild-timeout-12e4803013f899f2 branch from 125868d to 2768b69 Compare April 6, 2026 20:41
@MangelMaxime MangelMaxime marked this pull request as ready for review April 6, 2026 20:41
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 6, 2026

Python Type Checking Results (Pyright)

Metric Value
Total errors 18
Files with errors 4
Excluded files 4
New errors ✅ No
Excluded files with errors (4 files)

These files have known type errors and are excluded from CI. Remove from pyrightconfig.ci.json as errors are fixed.

File Errors Status
temp/tests/Python/test_applicative.py 12 Excluded
temp/tests/Python/test_hash_set.py 3 Excluded
temp/tests/Python/test_nested_and_recursive_pattern.py 2 Excluded
temp/tests/Python/fable_modules/thoth_json_python/encode.py 1 Excluded

@MangelMaxime MangelMaxime changed the title [Repo Assist] [JS/TS] Fix Async.StartChild with timeout always timing out [JS/TS/Python] Fix Async.StartChild with timeout always timing out Apr 6, 2026
@MangelMaxime MangelMaxime merged commit d160469 into main Apr 6, 2026
24 checks passed
@MangelMaxime MangelMaxime deleted the repo-assist/fix-issue-4481-startchild-timeout-12e4803013f899f2 branch April 6, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation Automated changes repo-assist Created by Repo Assist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Investigate] Async.StartChild with timeout always times out in JavaScript

1 participant