[HUM-120] Surface the full error cause chain in LogError - #46
Merged
Conversation
tozd's Error() and %+v only expose the outermost wrap message, so root causes — e.g. a Docker connection failure behind "starting agent container" — were invisible to users. Add CauseChain to render the full unwrapped chain (collapsing the duplicate messages tozd wrappers emit) and have LogError report it as the error field, alongside the existing structured details such as captured install.sh stderr. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
LogErrorpreviously logged only the outermost wrap message (tozd'sError()/%+vexpose just the top wrap), so the actual root cause — e.g. a Docker connection failure — was invisible in logs. This renders the full unwrapped chain via a newCauseChain(err)helper ("outer: inner: root"), collapsing consecutive duplicate messages thatWrapWithDetailsproduces so the output stays readable.It also drops the old implementation's redundant double
.Err(err)call.Provenance
Salvaged from an unmerged commit (
200e6db, authored 2026-06-17) that was stranded on a local-only branch and never pushed. Cherry-picked clean ontomain. The companion HUM-120 docker-context commit was not revived — that feature already landed onmainvia462fff4 [HUM-122] Resolve active Docker context in both engine clients.Verification
make test— 2836 tests passgo vet+staticcheckclean onerrors/go build ./...clean🤖 Generated with Claude Code