Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .fork-features/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"issue": "https://github.com/randomm/opencode/issues/159",
"newFiles": [
"packages/opencode/src/session/async-tasks.ts",
"packages/opencode/src/session/prompt-async.ts",
"packages/opencode/src/tool/task.ts",
"packages/opencode/src/tool/task.txt",
"packages/opencode/src/tool/check_task.ts",
Expand Down Expand Up @@ -44,7 +43,12 @@
"Session ownership filtering",
"filter to caller's session",
"Sync mode: execute synchronously",
"params.sync"
"params.sync",
"enableAutoWakeup",
"triggerWakeup",
"autoWakeupSubscribers",
"hasUndeliveredCompletedTasks",
"getAndClearCompletedTasks"
],
"tests": [
"packages/opencode/test/tool/check_task.test.ts",
Expand Down
101 changes: 0 additions & 101 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 0 additions & 55 deletions packages/opencode/src/session/prompt-async.ts

This file was deleted.

8 changes: 8 additions & 0 deletions packages/opencode/src/session/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Log } from "../util/log"
import { SessionRevert } from "./revert"
import { Session } from "."
import { Agent } from "../agent/agent"
import { getAndClearCompletedTasks, formatCompletedTasksForInjection } from "./async-tasks"
import { Provider } from "../provider/provider"
import { type Tool as AITool, tool, jsonSchema, type ToolCallOptions, asSchema } from "ai"
import { SessionCompaction } from "./compaction"
Expand Down Expand Up @@ -159,6 +160,13 @@ export namespace SessionPrompt {
const session = await Session.get(input.sessionID)
await SessionRevert.cleanup(session)

// Inject completed async task results into the prompt
const completedTasks = getAndClearCompletedTasks(input.sessionID)
if (completedTasks.length > 0) {
const injectionText = formatCompletedTasksForInjection(completedTasks)
input = { ...input, parts: [...input.parts, { type: "text", text: injectionText }] }
}

const message = await createUserMessage(input)
await Session.touch(input.sessionID)

Expand Down