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)
| 235 | // daemon. The conversation is ephemeral per session: nothing old is loaded and |
| 236 | // the previous thread is pruned, so the database stays bounded. |
| 237 | func (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 |
no test coverage detected