Files
PaperClipAI/server/src/services/workspace-source-restriction.ts
T
8f1cb11a03 fix(workspaces): name the owner action when a shared source is restricted (#16545)
A reused task workspace in a shared project checkout keeps its source
denial when another task's restricted worktree shares that checkout
(#16095 deliberately does not clone over existing workspaces). The run
then failed as an opaque `setup_failed` 403 and the task was blocked
with a generic "no live execution path" notice.

Convert that exact denial into a `configuration_incomplete` failure
with reason `workspace_source_restricted`, give the task notice and the
recovery action the owner step, and keep this pre-dispatch owner action
out of the unexpected Sentry run-failure stream. The reason and
predicate live in a dependency-free module. Access checks are unchanged.

Co-Authored-By: Paperclip <Paperclip-Paperclip@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 01:33:53 -07:00

10 lines
577 B
TypeScript

// Dependency-free so run-failure reporting can classify this outcome without
// loading the checkout and credential graph behind isolated source handling.
export const RESTRICTED_WORKSPACE_SOURCE_REASON = "workspace_source_restricted";
/** The shared checkout holds a task workspace that the run's actor cannot read. */
export function isRestrictedWorkspaceSourceDenial(error: unknown): boolean {
const denial = error as { status?: unknown; message?: unknown } | null;
return denial?.status === 403 && denial.message === "Task workspace access is no longer available";
}