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)
| 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. |
| 254 | func (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. |
no test coverage detected