refactor(background-agent): rename registerExternalTask to trackTask
Update BackgroundManager to rename the method for tracking external tasks, improving clarity and consistency in task management. Adjust related tests to reflect the new method name.
This commit is contained in:
parent
b5bd837025
commit
8e2410f1a0
@ -960,7 +960,7 @@ describe("BackgroundManager.tryCompleteTask", () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("BackgroundManager.registerExternalTask", () => {
|
describe("BackgroundManager.trackTask", () => {
|
||||||
let manager: BackgroundManager
|
let manager: BackgroundManager
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@ -985,8 +985,8 @@ describe("BackgroundManager.registerExternalTask", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// #when
|
// #when
|
||||||
await manager.registerExternalTask(input)
|
await manager.trackTask(input)
|
||||||
await manager.registerExternalTask(input)
|
await manager.trackTask(input)
|
||||||
|
|
||||||
// #then
|
// #then
|
||||||
const concurrencyManager = getConcurrencyManager(manager)
|
const concurrencyManager = getConcurrencyManager(manager)
|
||||||
@ -1010,7 +1010,7 @@ describe("BackgroundManager.resume concurrency key", () => {
|
|||||||
|
|
||||||
test("should re-acquire using external task concurrency key", async () => {
|
test("should re-acquire using external task concurrency key", async () => {
|
||||||
// #given
|
// #given
|
||||||
const task = await manager.registerExternalTask({
|
const task = await manager.trackTask({
|
||||||
taskId: "task-1",
|
taskId: "task-1",
|
||||||
sessionID: "session-1",
|
sessionID: "session-1",
|
||||||
parentSessionID: "parent-session",
|
parentSessionID: "parent-session",
|
||||||
|
|||||||
@ -248,10 +248,10 @@ export class BackgroundManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an external task (e.g., from sisyphus_task) for notification tracking.
|
* Track a task created elsewhere (e.g., from sisyphus_task) for notification tracking.
|
||||||
* This allows tasks created by external tools to receive the same toast/prompt notifications.
|
* This allows tasks created by other tools to receive the same toast/prompt notifications.
|
||||||
*/
|
*/
|
||||||
async registerExternalTask(input: {
|
async trackTask(input: {
|
||||||
taskId: string
|
taskId: string
|
||||||
sessionID: string
|
sessionID: string
|
||||||
parentSessionID: string
|
parentSessionID: string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user