refactor(worker): rename claude-executor to pi-executor

This commit is contained in:
ezl-keygraph committed 2026-06-15 16:05:31 +05:30
1 parent 56241625a4
commit 263b18e98a
13 files changed
+32 -32

No files matched your search

+1 -1
View File
@@ -106,7 +106,7 @@ export function resolveModelId(tier: ModelTier = 'medium', providerConfig?: Prov
/**
* Resolve the thinking level for a run.
*
* The Claude Agent SDK enabled "adaptive" thinking only on capable models; pi uses
* The previous harness enabled "adaptive" thinking only on capable models; pi uses
* explicit levels and clamps to model capability internally. We default to 'medium'
* and honour the existing CLAUDE_ADAPTIVE_THINKING=false kill switch (→ 'off'). An
* explicit CLAUDE_THINKING_LEVEL wins when set.
+2 -2
View File
@@ -326,7 +326,7 @@ export function formatErrorOutput(
} else if (context.useCleanOutput) {
lines.push(`${context.agentType} failed (${formatDuration(duration)})`);
} else {
lines.push(` Claude Code failed: ${description} (${formatDuration(duration)})`);
lines.push(` pi agent failed: ${description} (${formatDuration(duration)})`);
}
lines.push(` Error Type: ${error.constructor.name}`);
@@ -360,7 +360,7 @@ export function formatCompletionMessage(
return `${context.agentType.charAt(0).toUpperCase() + context.agentType.slice(1)} complete! (${turnCount} turns, ${formatDuration(duration)})`;
}
return ` Claude Code completed: ${description} (${turnCount} turns) in ${formatDuration(duration)}`;
return ` pi agent completed: ${description} (${turnCount} turns) in ${formatDuration(duration)}`;
}
export function formatToolUseOutput(toolName: string, input: Record<string, unknown> | undefined): string[] {
@@ -78,7 +78,7 @@ async function buildPermissionResourceLoader(cwd: string, logger: ActivityLogger
return loader;
}
export interface ClaudePromptResult {
export interface PiPromptResult {
result?: string | null | undefined;
success: boolean;
duration: number;
@@ -109,7 +109,7 @@ async function writeErrorLog(
try {
const errorLog = {
timestamp: formatTimestamp(),
agent: 'claude-executor',
agent: 'pi-executor',
error: { name: err.constructor.name, message: err.message, code: err.code, status: err.status, stack: err.stack },
context: { sourceDir, prompt: `${fullPrompt.slice(0, 200)}...`, retryable: isRetryableError(err) },
duration,
@@ -122,7 +122,7 @@ async function writeErrorLog(
}
export async function validateAgentOutput(
result: ClaudePromptResult,
result: PiPromptResult,
agentName: string | null,
sourceDir: string,
logger: ActivityLogger,
@@ -187,11 +187,11 @@ function classifyErrorText(content: string): PentestError | null {
// Low-level pi execution. Drives one agent session to completion with progress and
// audit logging. Exported for Temporal activities to call single-attempt execution.
export async function runClaudePrompt(
export async function runPiPrompt(
prompt: string,
sourceDir: string,
context: string = '',
description: string = 'Claude analysis',
description: string = 'Agent analysis',
_agentName: string | null = null,
auditSession: AuditSession | null = null,
logger: ActivityLogger,
@@ -200,7 +200,7 @@ export async function runClaudePrompt(
apiKey?: string,
deliverablesSubdir?: string,
providerConfig?: import('../types/config.js').ProviderConfig,
): Promise<ClaudePromptResult> {
): Promise<PiPromptResult> {
// 1. Initialize timing and prompt
const timer = new Timer(`agent-${description.toLowerCase().replace(/\s+/g, '-')}`);
const fullPrompt = context ? `${context}\n\n${prompt}` : prompt;
+1 -1
View File
@@ -6,7 +6,7 @@
/**
* Writes the @gotgenes/pi-permission-system global config from `code_path` avoid
* patterns. The executor loads the extension (see claude-executor) and pi enforces
* patterns. The executor loads the extension (see pi-executor) and pi enforces
* these path denies at the tool layer for every agent. Written to the global config
* dir under `agentDir` — the project-scoped path is gated behind project trust,
* which our headless runs do not grant; the global path is not.
+2 -2
View File
@@ -7,7 +7,7 @@
/**
* Universal custom tools registered for every agent: `task` and `todo_write`.
*
* These replace the Claude Agent SDK built-ins that pi does not ship. `task`
* These replace the previous harness built-ins that pi does not ship. `task`
* delegates a focused analysis to an in-process read-only child session (the
* Task sub-agent replacement); `todo_write` is a full-state-replace planning
* scratchpad mirrored to the workflow log.
@@ -116,7 +116,7 @@ function renderTodos(todos: readonly TodoItem[]): string {
/**
* The `todo_write` tool — a full-state-replace planning scratchpad.
*
* Mirrors Claude Code's TodoWrite: each call carries the entire list and replaces
* Mirrors the TodoWrite tool: each call carries the entire list and replaces
* stored state (no append/merge). No deliverable impact; every call is echoed to
* the workflow log so `shannon logs` shows the agent's live plan. State is per
* tool instance (one per agent execution).