improve stream rendering and show tool calling - #90
Conversation
|
|
||
| // sendStreamingAttempt remains as a small test-facing compatibility helper. | ||
| // Production paths use sendEventStreamingAttempt through SendEventStream. | ||
| func (t *ACPTransport) sendStreamingAttempt(ctx context.Context, req Request, textCh chan<- string) (bool, error) { |
There was a problem hiding this comment.
this shouldn't live here.
test only functions and methods should live in _test.go files.
| if attempt < maxAttempts-1 && !receivedText && IsRetryableError(err) { | ||
| // Tool activity can be side-effecting even before assistant text is | ||
| // available. Never retry such a turn transparently. | ||
| if attempt < maxAttempts-1 && !observedActivity && IsRetryableError(err) { |
There was a problem hiding this comment.
I'm not sure the substitution makes sense.
If we don't retry on tool calls, will this retry on text output streams? don't we risk duplicated outputs?
| } | ||
| } | ||
|
|
||
| events := make(chan StreamEvent, 16) |
| // | ||
| //nolint:gocyclo // terminal rendering requires many conditional escape sequences | ||
| func (d *Display) RenderWithGhost(buf *Buffer, cur *Cursor, hasSelection bool, ghostText string, streaming, fromAgent bool, modelName string) { | ||
| func (d *Display) RenderWithGhost(buf *Buffer, cur *Cursor, hasSelection bool, ghostText string, streaming, fromAgent bool, modelName, streamingStatus string) { |
There was a problem hiding this comment.
there are enough arguments here already.
streaming state should be packed into a single argument, have both a boolean streaming and a string streamingStatus feel wrong.
either collapse to a single struct carrying both, and consider using existing Display patterns for setting state Set[Mode|Gutters] etc.)
| ghost *GhostText | ||
| ghostTextChan GhostTextChan // Channel for streaming ghost text updates | ||
| ghostErrChan <-chan error // Channel for ghost text errors | ||
| streamingModel string // Model name for "Thinking..." display |
There was a problem hiding this comment.
I really like the response spinner the way it is.
e87274f to
c647ad1
Compare
c647ad1 to
7717565
Compare
No description provided.