[codex] Preserve VCS project config error causes#3474
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository 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:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-authored-by: codex <codex@users.noreply.github.com>
97bf166 to
e89f06d
Compare
ApprovabilityVerdict: Approved This PR refactors error logging to preserve error cause chains, changing only how VcsProjectConfig errors are formatted in logs. The change is self-contained with updated tests and has no business logic or security implications. You can customize Macroscope's approvability policy. Learn more. |
VCS project configuration discovery intentionally recovers from inspect, read, and decode failures so repositories remain usable with the automatic provider fallback. The recovery logger previously flattened
VcsProjectConfigErrorinto its message and copied fields, which discarded the original platform or schema cause and its stack before the error was swallowed.This change logs the structured
VcsProjectConfigErroritself and retains the existing safe operation, working-directory, config-path, and error-tag annotations. Recovery behavior remains unchanged: failed candidate inspection continues walking parent directories, while read and decode failures still resolve toauto. No configuration contents or credentials are added to logging.The existing focused recovery tests now verify that inspect, read, and decode fallbacks observe the structured error object and retain its nested platform or schema cause.
Validation:
vp test run apps/server/src/vcs/VcsProjectConfig.test.ts(8 tests)vp checkvp run typecheckNote
Low Risk
Observability-only change to warning logs during existing auto-fallback paths; no change to config resolution or credentials in logs.
Overview
VCS config discovery still swallows inspect/read/decode failures and falls back to
auto; this PR only changes what gets logged on those recovery paths.logVcsProjectConfigErrornow passes the fullVcsProjectConfigErrortoEffect.logWarningand addsoperation,cwd,configPath, anderrorTagviaEffect.annotateLogs, instead of logging the message string plus a copied context object. That keeps the wrappedcause(e.g.PlatformError,SchemaError) available in logs.stackis no longer duplicated in log annotations.Tests for inspect, read, and decode recovery now assert the logger receives a
VcsProjectConfigErrorinstance (with_tagandcause) rather than a[message, context]tuple.Reviewed by Cursor Bugbot for commit e89f06d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve error causes in
logVcsProjectConfigErrorby logging the error object directlyChanges
logVcsProjectConfigErrorin VcsProjectConfig.ts to pass the full error object toEffect.logWarninginstead of a message string with a context object. Metadata (operation,cwd,configPath,errorTag) is now attached viaEffect.annotateLogs. Tests in VcsProjectConfig.test.ts are updated to assert on the loggedVcsProjectConfigErrorinstance and itscauserather than a string message and context tuple.Macroscope summarized e89f06d.