opencode-raven 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/index.ts +19 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/index.ts
CHANGED
|
@@ -1558,6 +1558,19 @@ Then restart opencode for the model change to take effect. If the task can be co
|
|
|
1558
1558
|
return sessionId
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
1561
|
+
async function syncCreatedSession(sessionId: string, title: string, signal?: AbortSignal) {
|
|
1562
|
+
try {
|
|
1563
|
+
await client.session.update({
|
|
1564
|
+
path: { id: sessionId },
|
|
1565
|
+
body: { title },
|
|
1566
|
+
signal,
|
|
1567
|
+
})
|
|
1568
|
+
} catch (error) {
|
|
1569
|
+
if (signal?.aborted) throw error
|
|
1570
|
+
// Delegation still works if an older or disconnected TUI misses the sync event.
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1561
1574
|
async function executeRavenDelegation(kind: DelegationKind, args: { query: string; sessionId?: string }, context: any) {
|
|
1562
1575
|
const started = Date.now()
|
|
1563
1576
|
const agent = delegationAgent(kind)
|
|
@@ -1627,15 +1640,17 @@ Then restart opencode for the model change to take effect. If the task can be co
|
|
|
1627
1640
|
resumed = true
|
|
1628
1641
|
previousSavedCandidate = estimateRavenSavedCandidateBytes(messages)
|
|
1629
1642
|
} else {
|
|
1643
|
+
const sessionTitle = `${toolName}: ${args.query.slice(0, 80)}`
|
|
1630
1644
|
const session = await client.session.create({
|
|
1631
1645
|
body: {
|
|
1632
1646
|
parentID: rootId,
|
|
1633
|
-
title:
|
|
1647
|
+
title: sessionTitle,
|
|
1634
1648
|
},
|
|
1635
1649
|
signal: context.abort,
|
|
1636
1650
|
})
|
|
1637
1651
|
sessionId = (session as any)?.data?.id ?? (session as any)?.id
|
|
1638
1652
|
if (!sessionId) return { title, output: "Failed to create Raven session." }
|
|
1653
|
+
await syncCreatedSession(sessionId, sessionTitle, context.abort)
|
|
1639
1654
|
}
|
|
1640
1655
|
|
|
1641
1656
|
ravenSessions.add(sessionId)
|
|
@@ -1909,10 +1924,11 @@ Then restart opencode for the model change to take effect. If the task can be co
|
|
|
1909
1924
|
resumed = true
|
|
1910
1925
|
previousSavedCandidate = estimateRavenSavedCandidateBytes(messages)
|
|
1911
1926
|
} else {
|
|
1927
|
+
const sessionTitle = `raven_seek: ${args.query.slice(0, 80)}`
|
|
1912
1928
|
const session = await client.session.create({
|
|
1913
1929
|
body: {
|
|
1914
1930
|
parentID: rootId,
|
|
1915
|
-
title:
|
|
1931
|
+
title: sessionTitle,
|
|
1916
1932
|
},
|
|
1917
1933
|
signal: context.abort,
|
|
1918
1934
|
})
|
|
@@ -1921,6 +1937,7 @@ Then restart opencode for the model change to take effect. If the task can be co
|
|
|
1921
1937
|
if (!sessionId) {
|
|
1922
1938
|
return { title: "Raven Seek", output: "Failed to create Raven session." }
|
|
1923
1939
|
}
|
|
1940
|
+
await syncCreatedSession(sessionId, sessionTitle, context.abort)
|
|
1924
1941
|
}
|
|
1925
1942
|
|
|
1926
1943
|
ravenSessions.add(sessionId)
|