Skip to content

Commit 0175678

Browse files
committed
Hide context-pruner in cli
1 parent 9919719 commit 0175678

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/src/hooks/use-send-message.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useCallback, useEffect, useRef } from 'react'
22

33
import { getCodebuffClient, formatToolOutput } from '../utils/codebuff-client'
4+
import { shouldHideAgent } from '../utils/constants'
45
import { formatTimestamp } from '../utils/helpers'
56
import { logger } from '../utils/logger'
67

@@ -693,6 +694,11 @@ export const useSendMessage = ({
693694
event.type === 'subagent_start' ||
694695
event.type === 'subagent-start'
695696
) {
697+
// Skip rendering hidden agents
698+
if (shouldHideAgent(event.agentType)) {
699+
return
700+
}
701+
696702
if (event.agentId) {
697703
logger.info(
698704
{
@@ -946,6 +952,9 @@ export const useSendMessage = ({
946952
event.type === 'subagent-finish'
947953
) {
948954
if (event.agentId) {
955+
if (shouldHideAgent(event.agentType)) {
956+
return
957+
}
949958
agentStreamAccumulatorsRef.current.delete(event.agentId)
950959
removeActiveSubagent(event.agentId)
951960

cli/src/utils/constants.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Agent IDs that should not be rendered in the CLI UI
2+
export const HIDDEN_AGENT_IDS = ['codebuff/context-pruner'] as const
3+
4+
/**
5+
* Check if an agent ID should be hidden from rendering
6+
*/
7+
export const shouldHideAgent = (agentId: string): boolean => {
8+
return HIDDEN_AGENT_IDS.some((hiddenId) => agentId.includes(hiddenId))
9+
}

0 commit comments

Comments
 (0)