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

Method syncHubContext

cli/hub_sync.go:254–261  ·  view source on GitHub ↗

syncHubContext pulls turns that arrived on other channels since the last turn into local history, so the model has cross-channel context without anything being printed. Called at the start of each local turn (chat/agent/coder) on that turn's goroutine, so it never races the REPL.

(ctx context.Context)

Source from the content-addressed store, hash-verified

252// being printed. Called at the start of each local turn (chat/agent/coder) on
253// that turn's goroutine, so it never races the REPL.
254func (cli *ChatCLI) syncHubContext(ctx context.Context) {
255 if cli.hubSync == nil {
256 return
257 }
258 if msgs := cli.hubSync.pull(ctx); len(msgs) > 0 {
259 cli.history = append(cli.history, msgs...)
260 }
261}
262
263// mirrorHubTurn records a completed local turn on the shared conversation, so a
264// thread continued in the CLI shows up as context on Telegram/Slack/WhatsApp.

Callers 2

processLLMRequestMethod · 0.95
RunMethod · 0.80

Calls 1

pullMethod · 0.80

Tested by

no test coverage detected