-
Notifications
You must be signed in to change notification settings - Fork 19
Add agentic task log demo with reusable treebark templates #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
|
@copilot my user bubbles arent right-aligned or blue: |
|
@danmarshall Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
|
@copilot my user bubbles aren't blue or right-aligned: |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Fixed in commit 23dbc8c. The issue was:
User bubbles are now properly styled with blue background, right-aligned, and white text. |
|
@copilot nice work! can you also envision a job where some work is best visualized as a chart? |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Added chart visualizations in commit 9222ce3. The demo now includes: Regional Revenue Analysis - Bar chart showing revenue by region (North: $950K, South: $850K, East: $1.1M, West: $1.3M) Monthly Revenue Trend - Line chart displaying Q4 progression (Oct: $1.2M → Nov: $1.4M → Dec: $1.6M) The charts appear after the assistant's analysis phase, demonstrating how agentic work can be visualized with actual data charts in Chartifact. |
|
@copilot whatvisualizations did you add? they should actually be something the agent itself did. so lets find some way to chart some kind of thing the agent did. |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Changed in commit af9d770. The charts now show what the agent itself did during execution: Execution Time by Phase - Bar chart showing time spent: Data Loading (6s), Analysis (13s), Report Generation (13s) Log Activity Over Time - Line chart showing cumulative log entries produced by the agent as it worked (18 total logs across ~4 minutes) The visualizations now track the agent's own performance and activity patterns, not the business data it analyzed. |
|
@copilot this is great work, and it highlights a need for Treebark templates to be reusable within a document. Give me 3 proposals for how we might go about this. Think of the problem/solution like an architect. Mostly, we should be concerned about the ergonomics from the markdown flavor. (In JSON, I think its straightforward, we would use the |
Here are 3 architectural proposals for reusable Treebark templates: Proposal 1: Named Template References (Recommended)Problem: Template duplication leads to maintenance burden and verbosity. Solution: Store templates in JSON syntax: {
"resources": {
"templates": {
"chatBubble": {
"div": {
"class": "chat-bubble bubble-{{type}}",
"$children": [...]
}
}
}
},
"groups": [{
"elements": [
{"type": "treebark", "templateRef": "chatBubble", "variableId": "chatMessages"}
]
}]
}Markdown syntax (fenced block with template reference): :::treebark{template=chatBubble data=chatMessages}
:::Pros: Clean separation, easy to maintain, mirrors chart pattern Proposal 2: Inline Template Definition with ReuseProblem: First use requires full template, subsequent uses are verbose. Solution: First treebark element with an JSON syntax: {"type": "treebark", "templateId": "chat", "variableId": "chatMessages", "template": {...}},
{"type": "treebark", "templateId": "chat", "variableId": "chatMessages2"}Markdown syntax: :::treebark{id=chat data=chatMessages}
```json
{"div": {...}}::: :::treebark{template=chat data=chatMessages2} Markdown syntax: :::treebark{extends=baseLog title="Phase 1"}
:::Pros: Maximum flexibility, DRY for variations Recommendation: Proposal 1 for clearest ergonomics. The |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
|
@copilot ok now the schema changes we made need to be codified into the compiler package's validation. |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Updated in commit e3cacf9. The compiler validation now enforces:
Updated file: |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
|
@copilot we also might need to relax the validation for the new rules, I'm getting "Treebark element must have a template property" |
…reebark Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Fixed in commit 2299b47. Reordered the validation checks so that:
This prevents the confusing "must have a template property" error when using getTemplate, since the more specific validation for getTemplate will catch the issue if there's a problem with the getTemplate usage specifically. |
|
@copilot can you demonstrate the new reusable template in the primer doc 11.treebark.idoc |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
Added in commit 583e076. The primer document now includes a new "Reusable Templates" section demonstrating:
The example uses the existing |
|
@copilot thanks. Now it seems the compiler isnt outputting the new properties. |
Fixed in commit 5f5b6db. Added |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>
|
@copilot the page isnt working. I think its because youre data loaders are objects not arrays. just make them arrays. we can just print the phase in the markdown. |
Fixed in commit 3f0e8c7. Changed execution phases from nested objects to flat arrays, and moved phase headers to markdown text elements instead of including them in the data. Now uses proper array structure for all data sources as required by the schema.
Fixed in commit 1f3d7c2. Changed execution phases from nested objects with |
Co-authored-by: danmarshall <11507384+danmarshall@users.noreply.github.com>




Create a demo showing an agentic task log output with alternating chat and execution phases, including chart visualizations of the agent's own execution metrics. Additionally implements reusable treebark templates feature to eliminate template duplication.
Completed Tasks
Data Structure Fix
Changed from nested structure:
{ "content": [ {"phase": "...", "logs": [...]} ] }To flat arrays:
{ "content": [ {"timestamp": "...", "level": "...", "message": "..."} ] }Phase headers now appear as HTML text elements in markdown, keeping data sources simple and schema-compliant.
Preview
Live Preview: https://microsoft.github.io/chartifact/view/?load=https://raw.githubusercontent.com/microsoft/chartifact/copilot/add-demo-log-output/packages/web-deploy/json/agentic-task-log.idoc.json
Original prompt
💡 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.