Skip to content

feat: add an interactive chat command - #86

Merged
yarolegovich merged 13 commits into
a2aproject:mainfrom
ConnorMoss02:feat/34-chat
Oct 28, 2026
Merged

yarolegovich merged 13 commits into
a2aproject:mainfrom
ConnorMoss02:feat/34-chat

Conversation

@ConnorMoss02

@ConnorMoss02 ConnorMoss02 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds a2a chat. It reads a message, sends it, prints the reply and loops. The context id carries across turns and an input-required task continues with your next message.

--stream works like it does for send, and --context-id and --task-id pick up an existing conversation. Ctrl-C cancels a running turn, and a failed turn prints the error without ending the chat. It stops on auth-required and prints the ids on /quit, EOF or Ctrl-C at the prompt. When stdin or stdout isn't a terminal it sends once and exits.

Fixes #34

@yarolegovich yarolegovich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR! overall looks good, but I'd encourage to polish the overall chat UX further before merging it

Comment thread internal/cli/chat.go Outdated
Comment thread internal/cli/chat.go
Comment thread internal/cli/chat.go Outdated
Comment thread internal/cli/chat.go Outdated
@ConnorMoss02

Copy link
Copy Markdown
Contributor Author

I also took a stab at sending CancelTask when a turn is interrupted (663dd60), so the agent stops working on it too. Happy to roll it back if you'd rather keep that out of this PR.

Comment thread internal/cli/chat.go Outdated
Comment thread internal/cli/chat.go Outdated
Comment thread internal/cli/chat.go Outdated
Comment thread internal/cli/chat.go Outdated
Comment thread internal/cli/chat.go Outdated
@msampathkumar

Copy link
Copy Markdown
Member

@ConnorMoss02 Thank you for working on this. We appreciate this work :)

I have shared a few comment to help with the help messages.

…ut turns

- A turn that exceeds --timeout now cancels the task it left running,
  instead of leaving it working while the next message starts a new task.
- The cancel request after an interrupt gets its own interrupt scope, so
  a second Ctrl-C abandons it rather than waiting up to --timeout.
- Without a terminal, chat prints the context and task ids after the
  single send so the conversation can be resumed.
- The session logic lives in internal/chat; the cli package only wires
  the client into it. Input lines may be up to 1 MiB.
- Tests follow the repository's conventions.
@yarolegovich

Copy link
Copy Markdown
Member

I'm going to apply @msampathkumar 's suggestions and merge.

Without a terminal chat was a send with fewer options, so it is now a
usage error that points to send. Help and flag text follow the review
suggestions, and /exit ends a session like /quit.
@yarolegovich
yarolegovich merged commit c65d313 into a2aproject:main Oct 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add interactive chat for multi-turn agent sessions

3 participants