mirror of
https://github.com/Ryder-Sun/Meldwork.git
synced 2026-11-07 06:56:03 -10:00
fix: preserve Hermes sessions across transport changes
This commit is contained in:
1 parent
e7c0223bfa
commit
eb2234b598
2 files changed
+5
-4
No files matched your search
@@ -73,9 +73,10 @@ function invocation(kind, executable, workdir, sessionRef = '', options = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (kind === 'hermes') {
|
if (kind === 'hermes') {
|
||||||
const legacySessionRef = options.sessionTransport === 'acp' ? '' : sessionRef
|
// Hermes uses the same native conversation identifier across its ACP and
|
||||||
|
// legacy transports. Keep it when an attachment requires the legacy path.
|
||||||
|
const legacySessionRef = sessionRef
|
||||||
const useAcp = options.invocationTransport !== 'legacy'
|
const useAcp = options.invocationTransport !== 'legacy'
|
||||||
&& !attachments.length
|
|
||||||
&& options.hermesAcpAvailable !== false
|
&& options.hermesAcpAvailable !== false
|
||||||
&& (!sessionRef || options.sessionTransport === 'acp')
|
&& (!sessionRef || options.sessionTransport === 'acp')
|
||||||
if (useAcp) {
|
if (useAcp) {
|
||||||
@@ -187,7 +188,7 @@ function invocation(kind, executable, workdir, sessionRef = '', options = {}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (kind === 'mimo') {
|
if (kind === 'mimo') {
|
||||||
if (options.invocationTransport !== 'json') {
|
if (!attachments.length && options.invocationTransport !== 'json') {
|
||||||
return {
|
return {
|
||||||
command: executable,
|
command: executable,
|
||||||
args: ['acp', '--pure', '--cwd', workdir],
|
args: ['acp', '--pure', '--cwd', workdir],
|
||||||
|
|||||||
@@ -770,7 +770,7 @@ class LocalWorkspaceAgentInvocation {
|
|||||||
const hermesNeedsLegacy = kind === 'hermes' && sessionTransport === 'acp'
|
const hermesNeedsLegacy = kind === 'hermes' && sessionTransport === 'acp'
|
||||||
&& (!HERMES_WORKSPACE_ACP_ENABLED
|
&& (!HERMES_WORKSPACE_ACP_ENABLED
|
||||||
|| agent.acpAvailable === false
|
|| agent.acpAvailable === false
|
||||||
|| (context.attachments || []).length > 0)
|
)
|
||||||
if (resumedPermission && hermesNeedsLegacy) {
|
if (resumedPermission && hermesNeedsLegacy) {
|
||||||
throw new Error('LOCAL_RUN_PERMISSION_RESUME_UNAVAILABLE')
|
throw new Error('LOCAL_RUN_PERMISSION_RESUME_UNAVAILABLE')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user