can1357/oh-my-pi · info · Error
Aborted before execution
Error message
Aborted before execution
What it means
The tangential-command job registered with the background task manager checks the AbortSignal at the top of its task callback and throws immediately if abort was requested before any work started. This prevents spawning a whole clone agent session for a task whose cancellation already fired.
Source
Thrown at packages/coding-agent/src/modes/controllers/tan-command-controller.ts:123
const cloneFile = path.join(sessionDir, `${cloneId}.jsonl`);
const label = `/tan ${previewWork(trimmedWork)}`;
await this.ctx.sessionManager.ensureOnDisk();
await this.ctx.sessionManager.flush();
let jobId = "";
try {
const cloneManager = await SessionManager.forkFrom(parentFile, cwd, sessionDir, undefined, {
copyArtifacts: false,
suppressBreadcrumb: true,
sessionFile: cloneFile,
});
jobId = manager.register(
"task",
label,
async ({ signal }) => {
if (signal.aborted) throw new Error("Aborted before execution");
let clone: AgentSession | undefined;
try {
const created = await sdk.createAgentSession({
cwd,
sessionManager: cloneManager,
model,
thinkingLevel,
systemPrompt,
toolNames,
providerSessionId: `${parentSessionId}:tan:${Snowflake.next()}`,
providerPromptCacheKey: parentPromptCacheKey,
modelRegistry,
authStorage: modelRegistry.authStorage,
settings,
hasUI: false,
enableMCP: false,
customTools,View on GitHub (pinned to 9690622007)
Solutions
- Expected cancellation path — no fix needed; the UI treats it as 'task aborted'
- If it fires spuriously, check whether something reuses/aborts the same AbortController too early (e.g. parent controller teardown)
- Delay registering the task until you are sure the user did not cancel (e.g. after confirmation)
Defensive patterns
Strategy: try-catch
Validate before calling
if (signal?.aborted) {
return; // don't register the task at all
} Try / catch
try {
await tanCommand.start(args);
} catch (err) {
if (err.message === "Aborted before execution") {
// expected cancellation — no-op / show 'cancelled'
return;
}
throw err;
} Prevention
- Check signal.aborted before registering background work
- Reuse one AbortController per command lifecycle and don't abort it during setup
- Treat this error as a normal cancellation outcome in UI code
- Keep task setup fast to shrink the cancellation race window
When it happens
Trigger: Calling start() on TanCommandController, the job being queued/registered via manager.register, and the signal aborting between registration and the callback actually running — the callback's first statement sees signal.aborted === true.
Common situations: User cancels the /tan command (Esc) right as it starts; a queued task is aborted while waiting for a concurrency slot; the task manager aborts all jobs during shutdown or session switch.
Related errors
- Request was aborted
- Auth broker request aborted
- OAuth refresh ownership aborted by caller
- Request was aborted.
- AbortError
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/5a1737692ce50306.
Report an issue: GitHub.