refactor: remove deprecated logout command and legacy sidechain logic

This commit is contained in:
weishu
2026-01-05 10:49:23 +08:00
parent 7a487269ea
commit f82728e9b3
3 changed files with 0 additions and 37 deletions
-20
View File
@@ -1,20 +0,0 @@
import chalk from 'chalk'
import { handleAuthCommand } from './auth'
import type { CommandDefinition } from './types'
export const logoutCommand: CommandDefinition = {
name: 'logout',
requiresRuntimeAssets: true,
run: async () => {
console.log(chalk.yellow('Note: "hapi logout" is deprecated. Use "hapi auth logout" instead.\n'))
try {
await handleAuthCommand(['logout'])
} catch (error) {
console.error(chalk.red('Error:'), error instanceof Error ? error.message : 'Unknown error')
if (process.env.DEBUG) {
console.error(error)
}
process.exit(1)
}
}
}
-2
View File
@@ -6,7 +6,6 @@ import { daemonCommand } from './daemon'
import { doctorCommand } from './doctor'
import { geminiCommand } from './gemini'
import { hookForwarderCommand } from './hookForwarder'
import { logoutCommand } from './logout'
import { mcpCommand } from './mcp'
import { notifyCommand } from './notify'
import { serverCommand } from './server'
@@ -22,7 +21,6 @@ const COMMANDS: CommandDefinition[] = [
hookForwarderCommand,
doctorCommand,
daemonCommand,
logoutCommand,
notifyCommand
]
-15
View File
@@ -47,21 +47,6 @@ export function reduceChatBlocks(
const rootResult = reduceTimeline(root, reducerContext)
let hasReadyEvent = rootResult.hasReadyEvent
// If a group couldn't be attached to a Task tool call (e.g. legacy shapes), keep it visible.
for (const [taskMessageId, sidechainMessages] of groups) {
if (consumedGroupIds.has(taskMessageId)) continue
if (sidechainMessages.length === 0) continue
const child = reduceTimeline(sidechainMessages, reducerContext)
hasReadyEvent = hasReadyEvent || child.hasReadyEvent
rootResult.blocks.push({
kind: 'agent-event',
id: `sidechain:${taskMessageId}`,
createdAt: sidechainMessages[0].createdAt,
event: { type: 'message', message: 'Task sidechain' }
})
rootResult.blocks.push(...child.blocks)
}
// Only create permission-only tool cards when there is no tool call/result in the transcript.
for (const [id, entry] of permissionsById) {
if (toolIdsInMessages.has(id)) continue