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

Method startHubSync

cli/hub_sync.go:237–248  ·  view source on GitHub ↗

startHubSync establishes a fresh shared conversation for this CLI session. Invoked from Start. A standalone CLI (no /connect) joins the on-disk hub when local mode is enabled, sharing the conversation with a co-running gateway daemon. The conversation is ephemeral per session: nothing old is loaded

(ctx context.Context)

Source from the content-addressed store, hash-verified

235// daemon. The conversation is ephemeral per session: nothing old is loaded and
236// the previous thread is pruned, so the database stays bounded.
237func (cli *ChatCLI) startHubSync(ctx context.Context) {
238 if cli.hubSync == nil {
239 cli.hubLocalClose = cli.maybeEnableLocalHub(ctx)
240 }
241 if cli.hubSync == nil {
242 return
243 }
244 if err := cli.hubSync.startFresh(ctx); err != nil {
245 cli.logger.Warn("hub sync: could not start shared session; disabling", zap.Error(err))
246 cli.hubSync = nil
247 }
248}
249
250// syncHubContext pulls turns that arrived on other channels since the last turn
251// into local history, so the model has cross-channel context without anything

Callers 1

StartMethod · 0.95

Calls 4

maybeEnableLocalHubMethod · 0.95
startFreshMethod · 0.80
WarnMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected