Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
117 changes: 117 additions & 0 deletions pnpm-lock.yaml

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

22 changes: 22 additions & 0 deletions src/core/task/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import { BrowserSession } from "../../services/browser/BrowserSession"
import { McpHub } from "../../services/mcp/McpHub"
import { McpServerManager } from "../../services/mcp/McpServerManager"
import { RepoPerTaskCheckpointService } from "../../services/checkpoints"
import { TaskBridgeService } from "../../services/task-bridge/TaskBridgeService"

// integrations
import { DiffViewProvider } from "../../integrations/editor/DiffViewProvider"
Expand Down Expand Up @@ -247,6 +248,9 @@ export class Task extends EventEmitter<TaskEvents> {
checkpointService?: RepoPerTaskCheckpointService
checkpointServiceInitializing = false

// Task Bridge
taskBridgeService?: TaskBridgeService

// Streaming
isWaitingForFirstChunk = false
isStreaming = false
Expand Down Expand Up @@ -351,6 +355,12 @@ export class Task extends EventEmitter<TaskEvents> {

this.toolRepetitionDetector = new ToolRepetitionDetector(this.consecutiveMistakeLimit)

// TODO: Figure out when to enable task bridge.
// eslint-disable-next-line no-constant-condition
if (true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO comment with hard-coded true condition - is there a plan for when this should be conditionally enabled? This might be worth addressing before merging.

this.taskBridgeService = TaskBridgeService.getInstance()
}

onCreated?.(this)

if (startTask) {
Expand Down Expand Up @@ -1210,6 +1220,13 @@ export class Task extends EventEmitter<TaskEvents> {
this.pauseInterval = undefined
}

// Unsubscribe from TaskBridge service.
if (this.taskBridgeService) {
this.taskBridgeService
.unsubscribeFromTask(this.taskId)
.catch((error) => console.error("Error unsubscribing from task bridge:", error))
}

// Release any terminals associated with this task.
try {
// Release any terminals associated with this task.
Expand Down Expand Up @@ -1304,6 +1321,11 @@ export class Task extends EventEmitter<TaskEvents> {
// Kicks off the checkpoints initialization process in the background.
getCheckpointService(this)

if (this.taskBridgeService) {
await this.taskBridgeService.initialize()
await this.taskBridgeService.subscribeToTask(this)
}

let nextUserContent = userContent
let includeFileDetails = true

Expand Down
3 changes: 3 additions & 0 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@
"gray-matter": "^4.0.3",
"i18next": "^25.0.0",
"ignore": "^7.0.3",
"ioredis": "^5.3.2",
"isbinaryfile": "^5.0.2",
"lodash.debounce": "^4.0.8",
"mammoth": "^1.9.1",
Expand Down Expand Up @@ -492,6 +493,7 @@
"@types/diff": "^5.2.1",
"@types/diff-match-patch": "^1.0.36",
"@types/glob": "^8.1.0",
"@types/ioredis-mock": "^8.2.6",
"@types/mocha": "^10.0.10",
"@types/node": "20.x",
"@types/node-cache": "^4.1.3",
Expand All @@ -508,6 +510,7 @@
"esbuild": "^0.25.0",
"execa": "^9.5.2",
"glob": "^11.0.1",
"ioredis-mock": "^8.9.0",
"mkdirp": "^3.0.1",
"nock": "^14.0.4",
"npm-run-all2": "^8.0.1",
Expand Down
Loading
Loading