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.
Files changed (3) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/index.ts +19 -2
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Fixed
6
+ - Plugin-created Raven sessions now emit a session update after creation so OpenCode adds root-level sessions to its navigable child-session list.
7
+
3
8
  ## 2.2.0
4
9
 
5
10
  ### Added
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: `${toolName}: ${args.query.slice(0, 80)}`,
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: `raven_seek: ${args.query.slice(0, 80)}`,
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-raven",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Context-saving search and on-demand MCP routing for OpenCode through focused Raven agents.",
5
5
  "main": "./index.ts",
6
6
  "exports": {