agent: add Prompt method and Activity tracking#2864
Open
Conversation
Co-authored-by: asim <[email protected]>
Copilot
AI
changed the title
[WIP] Add agent management for service lifecycle
Add Feb 22, 2026
agent package: AI-driven service lifecycle management
Co-authored-by: asim <[email protected]>
Copilot
AI
changed the title
Add
agent: add Prompt method and Activity tracking
Feb 22, 2026
agent package: AI-driven service lifecycle management
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents needed a way to receive on-demand prompts at runtime and a general mechanism to observe what they are doing.
Changes
Agentinterface additionsPrompt(text string) <-chan *model.Response— non-blocking; spawns a goroutine that runs the prompt through the model (including tool execution), then delivers the response on a buffered channel and closes it. Channel is closed with no value if no model is configured.Activity() []Activity— returns a safe snapshot copy of the agent's activity log, capped at 256 entries.Activity tracking
ActivityTypestring constants:evaluate,prompt,tool,response,errorActivitystruct:Time,Type,Prompt,Tool,Result,Errrecord()helper — thread-safe, drops oldest entries beyond capevaluate()now records each cycle's evaluate/tool/response/error eventsActivityErrorvsActivityToolvia JSON inspection of the content stringUsage
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.