fix(ts-sdk): fix nohup process completion detection and OSS download path#1224
Conversation
…path The TS SDK's waitForProcessCompletion incorrectly treats all exceptions from `kill -0 PID` as failures. When the process exits, the server returns status=Failed for the kill check, but this should be interpreted as "process completed" (matching Python SDK behavior). Also fixes ensureOssutil and oss_client commands that were using normal mode (85s server-side hard timeout) instead of nohup mode for long-running operations like ossutil install, wget, and ossutil cp. Fixes alibaba#1223 Co-Authored-By: Claude Code <noreply@anthropic.com> AI-Model: claude-opus-4-6 AI-Contributed/Feature: 92/92 AI-Contributed/UT: 0/0
|
Review note: [P1] Please add a stronger verification step before returning success, for example compare |
Reject incomplete sandbox downloads by comparing the remote file size with the local source size after wget exits in nohup mode. Add regression coverage for partial, unverifiable, and complete transfers. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-5 AI-Contributed/Feature: 20/20 AI-Contributed/UT: 65/65
|
Review note: [P1] This breaks the first-time install path that the PR is trying to fix. Please either remove the quick check, or make it non-throwing when the command is missing, e.g. run a shell/session check like |
Co-Authored-By: Codex <noreply@openai.com> AI-Model: GPT-5 AI-Contributed/Feature: 12/12 AI-Contributed/UT: 25/25
Summary
Fixes three bugs in the TS SDK's nohup/OSS download path that caused large file downloads to fail:
waitForProcessCompletionmisinterpreted "process exited" exceptions as failures (divergence from Python SDK behavior)ensureOssutilused normal mode which hits the 85s server-siderun_in_sessiontimeoutoss_client.tswget/ossutil cp used normal mode instead of nohup for long-running transfersChanges
client.tswaitForProcessCompletionfile_system.tsensureOssutilwrites script to file + runs via nohup (matches Pythonprocess.execute_script)oss_client.tswaitTimeout: 600http.tsTest Plan
--download-mode oss— MD5 verifiednpm run test:unit)Fixes #1223
🤖 Generated with Claude Code