MCPcopy Create free account
hub / github.com/diillson/chatcli / endProcessingLifecycle

Method endProcessingLifecycle

cli/cli_llm.go:116–130  ·  view source on GitHub ↗

endProcessingLifecycle reverses startProcessingLifecycle, then drains any message the user queued while the prior turn was running. The recursive re-entry is bounded by the queue cap (10 messages); when the queue is empty it restores the idle prompt.

(ctx context.Context, stopSpinner func())

Source from the content-addressed store, hash-verified

114// re-entry is bounded by the queue cap (10 messages); when the queue is
115// empty it restores the idle prompt.
116func (cli *ChatCLI) endProcessingLifecycle(ctx context.Context, stopSpinner func()) {
117 defer cli.animation.SetSuppressed(false)
118 stopSpinner()
119
120 if nextMsg := cli.dequeueMessage(); nextMsg != "" {
121 cli.announceQueueDrain()
122 cli.processLLMRequest(ctx, nextMsg)
123 return
124 }
125 cli.isExecuting.Store(false)
126 cli.interactionState = StateNormal
127 fmt.Print("\033[0m")
128 _ = os.Stdout.Sync()
129 cli.forceRefreshPrompt()
130}
131
132// announceQueueDrain prints either the "processing remaining N" or
133// "processing" notice before recursing into the queued turn.

Calls 6

dequeueMessageMethod · 0.95
announceQueueDrainMethod · 0.95
processLLMRequestMethod · 0.95
forceRefreshPromptMethod · 0.95
SetSuppressedMethod · 0.80
SyncMethod · 0.80