Repository navigation
fix(workspace): treat write-probe cleanup as best effort - #2455
Closed
Mahdi-Hasan wants to merge 1 commit into
Closed
Mahdi-Hasan wants to merge 1 commit into
Mahdi-Hasan wants to merge 1 commit into
Conversation
The per-turn workspace readiness check touches a probe file, then unlinks it. Only OSError was handled, so any other exception from `unlink` (for example one raised by a delete guard that refuses a bulk delete) escaped the request and left the turn without a response. The touch already proves the outputs folder is writable. Removing the probe is cleanup, so log a warning and carry on if it fails. Fixes HKUDS#2453 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ContentWorkspaceService._ensure_readyruns on every turn. It touchesoutputs/.deeptutor-write-probe-<uuid>, then callsprobe.unlink(). OnlyOSErrorwas handled. Any other exception fromunlinkescaped the request.The report in #2453 shows this: a delete guard in the reporter's environment refused the probe delete with
SAFE_DELETE_BULK_CONFIRM_REQUIREDand the exception escaped the ASGI stack.Changes:
touch. Removing the probe is cleanup, so it is now best effort: failures are logged as a warning and the turn continues.touchfailure path is unchanged, so an unwritable folder still raisesWorkspaceError.unlink(missing_ok=True)replacesunlink().Behavior change: a probe that cannot be removed no longer reports the folder as "not writable". It could not have been created otherwise.
I cannot confirm the "process dies" part of the report. This PR fixes the part that is visible in DeepTutor's own code.
Related Issues
Module(s) Affected
services/workspacetestsChecklist
dev(notmain).deeptutor-repo-hygiene, which callspython3and fails only on Windows.python scripts/check_repo_hygiene.pypasses.Additional Notes
test_a_failing_probe_cleanup_does_not_fail_the_workspaceintests/api/test_workspace_router.py. It fails ondevand passes here.tests/api/test_workspace_router.py: 9 passed.tests/services/workspace/test_data_migration.pytests fail on Windows with and without this change.