refactor(background-agent): normalize task ID field naming

Rename BackgroundTask and attempt ID fields to camelCase across background-agent consumers while moving BackgroundManager construction to a single config object.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-02 03:01:03 +09:00
parent 054ade9ced
commit da251c9b30
57 changed files with 1299 additions and 1327 deletions
@@ -20,10 +20,10 @@ function createDeferredPromise(): {
}
}
function createTask(overrides: Partial<BackgroundTask> & { id: string; sessionID: string }): BackgroundTask {
function createTask(overrides: Partial<BackgroundTask> & { id: string; sessionId: string }): BackgroundTask {
return {
parentSessionID: "parent-session",
parentMessageID: "parent-message",
parentSessionId: "parent-session",
parentMessageId: "parent-message",
description: "test task",
prompt: "test prompt",
agent: "explore",
@@ -34,7 +34,7 @@ function createTask(overrides: Partial<BackgroundTask> & { id: string; sessionID
}
function createBackgroundManager(): BackgroundManager {
return new BackgroundManager({
return new BackgroundManager({ pluginContext: {
client: {
session: {
abort: async () => ({}),
@@ -47,7 +47,7 @@ function createBackgroundManager(): BackgroundManager {
worktree: tmpdir(),
serverUrl: new URL("https://example.com"),
$: {} as never,
} as never)
} as never })
}
describe("BackgroundManager shutdown global cleanup", () => {
@@ -74,14 +74,14 @@ describe("BackgroundManager shutdown global cleanup", () => {
"task-running-shutdown-cleanup",
createTask({
id: "task-running-shutdown-cleanup",
sessionID: runningSessionID,
sessionId: runningSessionID,
}),
],
[
"task-completed-shutdown-cleanup",
createTask({
id: "task-completed-shutdown-cleanup",
sessionID: completedSessionID,
sessionId: completedSessionID,
status: "completed",
completedAt: new Date(),
}),
@@ -119,7 +119,7 @@ describe("BackgroundManager shutdown global cleanup", () => {
"task-running-await-shutdown",
createTask({
id: "task-running-await-shutdown",
sessionID: runningSessionID,
sessionId: runningSessionID,
}),
],
])