MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / RegisterForegroundTask

Method RegisterForegroundTask

agent/task_runtime.go:268–279  ·  view source on GitHub ↗
(taskID, parentTaskID, parentScopeID, workerLabel, description, agentType string)

Source from the content-addressed store, hash-verified

266}
267
268func (rt *AgentTaskRuntime) RegisterForegroundTask(taskID, parentTaskID, parentScopeID, workerLabel, description, agentType string) *AgentTaskRecord {
269 now := nowSeconds()
270 record := &AgentTaskRecord{
271 TaskID: taskID, ParentTaskID: parentTaskID, ParentScopeID: parentScopeID,
272 WorkerLabel: workerLabel, Description: description, AgentType: agentType,
273 Status: "running", CreatedAt: now, UpdatedAt: now,
274 }
275 rt.mu.Lock()
276 rt.registerRecordLocked(record, false)
277 rt.mu.Unlock()
278 return record
279}
280
281func (rt *AgentTaskRuntime) CompleteForegroundTask(record *AgentTaskRecord, terminationReason string) {
282 rt.setForegroundTaskTerminal(record, "completed", terminationReason)

Calls 2

registerRecordLockedMethod · 0.95
nowSecondsFunction · 0.70