fix(tunnel): surface agent command failure instead of masking it#646
Draft
skevetter wants to merge 1 commit into
Draft
fix(tunnel): surface agent command failure instead of masking it#646skevetter wants to merge 1 commit into
skevetter wants to merge 1 commit into
Conversation
ClassifyTunnelErrors discarded the tunnel (agent command) error whenever the handler side completed cleanly. When the in-container agent sent its result over gRPC and then failed a later stage (e.g. git clone), the handler saw a clean completion (nil) so the real exit error was dropped. `up` then proceeded to save the workspace result, found the directory already removed by the agent's failure cleanup, and reported the misleading "workspace X no longer exists" instead of the real cause. Surface a permanent tunnel error when the handler returns nil, reusing ClassifyError so normal shutdown/EOF completions still resolve to nil.
✅ Deploy Preview for devsydev canceled.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for images-devsy-sh canceled.
|
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.
Summary
Fixes a misleading error surfaced during
workspace up: when the in-container agent failed a stage after sending its result over the tunnel (e.g. a failedgit clone), the CLI reportedinstead of the real cause. The "no longer exists" message is a downstream symptom — the agent's failure-cleanup had already removed the workspace directory, and
upthen tripped over the missing directory while saving the result.Root cause
ClassifyTunnelErrorsdiscarded the tunnel (agent command) error whenever the handler side completed cleanly:In the SSH/local path (docker/podman), the agent sends its result over gRPC and then may fail a later stage. The handler (result receiver) sees a clean completion, so
handlerErr == niland the agent's real exit error (tunnelErr) was dropped.ExecuteCommandthen returned(result, nil),upproceeded toSaveWorkspaceResult, found the directory already removed by the agent's cleanup, and reported the misleading message.Fix
Surface a permanent tunnel error when the handler returns nil, reusing the existing
ClassifyErrorso normal shutdown/EOF completions still resolve tonil:Before / after
Reproduced on a real Fedora host with rootless podman by cloning an unresolvable repo:
start workspace: save workspace result: workspace notfound-devsy-sh no longer existsstart workspace: tunnel to container: agent command: run agent command failed: exit status 128 ...Notes