[codex] Structure project favicon resolution failures#3369
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
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 |
ApprovabilityVerdict: Approved Adds structured error context (operation, resource fields) to asset access and project favicon resolution failures for improved debugging. Changes are additive to error structures without altering success paths or core business logic. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
26f8074
into
codex/preserve-asset-access-causes
Summary
Stack
This PR is stacked on #3342 (
codex/preserve-asset-access-causes) so its AssetAccess cause mapping remains intact. Merge #3342 first, then retarget this PR tomain.Validation
vp test apps/server/src/project/ProjectFaviconResolver.test.ts apps/server/src/assets/AssetAccess.test.ts(14 tests)vp check(passes; 20 pre-existing warnings)vp run typecheckNote
Medium Risk
RPC clients must handle richer
AssetAccessErrorpayloads, and favicon flows that previously got silentnullnow receive explicit failures for permission, I/O, and invalid workspace paths.Overview
Project favicon resolution now fails with a tagged
ProjectFaviconResolutionError(operation, workspace paths, underlyingcause) instead of returningnullwhen normalization, unsafe paths, or non-NotFoundstat/read errors occur. Missing candidates still skip viaNotFound-only handling.Asset URL issuance extends the RPC
AssetAccessErrorcontract withAssetAccessOperationand the requestedresource, and threads those throughissueAssetUrl, workspace-context resolution inws.ts, and favicon mapping (resolve-project-faviconwith the resolver error ascause).Tests assert structured fields and cause preservation for workspace assets and favicon resolution edge cases.
Reviewed by Cursor Bugbot for commit c554ee6. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure favicon resolution failures with typed errors in asset URL issuance
ProjectFaviconResolutionError, a tagged error class withoperation,workspaceRoot,relativePath,absolutePath, andcausefields, replacing silent null returns for non-NotFound filesystem errors inProjectFaviconResolver.resolvePath.AssetAccessErrorin assets.ts withoperationandresourcefields, providing a structured discriminator for all failure sites inissueAssetUrl.issueAssetUrlnow propagate asAssetAccessErrorwithoperation: "resolve-project-favicon"instead of silently proceeding.ProjectFaviconResolver.resolvePathandAssetAccessErrorwill see new required fields; previously swallowed errors now surface as typed failures.Macroscope summarized c554ee6.