charmbracelet / charmbracelet/fantasy
Include accumulated text in OnTextEnd callback
- Dominant language
- Go
- Stars
- 987
- Forks
- 137
- Avg merge
- 14h 41m
- Merged PRs (30d)
- 12
Description
Currently `OnTextEndFunc` receives only the message ID:
```go
OnTextEndFunc func(id string) error
```
Consumers who need the full accumulated text (e.g., to collect or persist completed messages) must buffer all deltas themselves. This duplicates the internal `activeTextContent` map already maintained by the agent.
`OnReasoningEndFunc` already passes the full content:
```go
OnReasoningEndFunc func(id string, reasoning ReasoningContent) error
```
Proposal: add the accumulated text as a second parameter:
```go
OnTextEndFunc func(id string, text string) error
```
The text is already available at the call site from `activeTextContent[part.ID]`.
Contributor guide
Assessment
This issue has not been assessed yet.