mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 09:07:46 +02:00
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>
10 lines
577 B
TypeScript
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";
|
|
}
|