Skip to content

Commit a7dbfa1

Browse files
committed
fix(showcase/ms-agent-dotnet): stabilize D5 demo flows
1 parent 0f7f247 commit a7dbfa1

23 files changed

Lines changed: 1358 additions & 220 deletions

showcase/aimock/d5-all.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,24 @@
824824
]
825825
}
826826
},
827+
{
828+
"match": {
829+
"userMessage": "trip to mars",
830+
"toolCallId": "call_d5_generate_steps_001__approved"
831+
},
832+
"response": {
833+
"content": "Great choices! I will proceed with executing the selected steps for your trip to Mars. Let me work through each one."
834+
}
835+
},
836+
{
837+
"match": {
838+
"userMessage": "trip to mars",
839+
"toolCallId": "call_d5_generate_steps_001__rejected"
840+
},
841+
"response": {
842+
"content": "No problem — I will not execute the Mars trip plan."
843+
}
844+
},
827845
{
828846
"match": {
829847
"userMessage": "trip to mars",
@@ -1289,6 +1307,19 @@
12891307
"content": "Hi — I'm your shared-state co-pilot. Your Preferences panel (name, tone, language, interests) is fed to me on every turn, and I jot notes back into the Agent Scratch Pad via set_notes so the UI re-renders. Try setting your name or asking me to remember something."
12901308
}
12911309
},
1310+
{
1311+
"_comment": "shared-state-read-write edited-name probe. The harness sets name=D5-PREF-PROBE before clicking Greet me; matching this proves changed preferences reached the model-visible system prompt instead of serving the default fixture.",
1312+
"match": {
1313+
"userMessage": "Say hi and introduce yourself",
1314+
"systemMessage": [
1315+
"preferences",
1316+
"\"name\": \"D5-PREF-PROBE\""
1317+
]
1318+
},
1319+
"response": {
1320+
"content": "Hi D5-PREF-PROBE - I can see your edited shared-state preferences in the current turn."
1321+
}
1322+
},
12921323
{
12931324
"_comment": "shared-state-read-write — Plan-a-weekend pill. Same no-systemMessage gate as the Greet pill.",
12941325
"match": {
@@ -1645,6 +1676,26 @@
16451676
"content": "Theme toggled."
16461677
}
16471678
},
1679+
{
1680+
"_comment": "hitl-in-app — refund pill (#12345), approved branch. The .NET runtime suffixes the request_user_approval tool result id from the actual frontend result so approve/reject matching is deterministic without sequenceIndex.",
1681+
"match": {
1682+
"userMessage": "$50 refund to Jordan Rivera on ticket #12345",
1683+
"toolCallId": "call_d5_hitl_refund_12345_001__approved"
1684+
},
1685+
"response": {
1686+
"content": "I am processing the $50 refund to Jordan Rivera on ticket #12345 now."
1687+
}
1688+
},
1689+
{
1690+
"_comment": "hitl-in-app — refund pill (#12345), rejected branch.",
1691+
"match": {
1692+
"userMessage": "$50 refund to Jordan Rivera on ticket #12345",
1693+
"toolCallId": "call_d5_hitl_refund_12345_001__rejected"
1694+
},
1695+
"response": {
1696+
"content": "The refund request was not approved. I will not issue the $50 refund to Jordan Rivera on ticket #12345."
1697+
}
1698+
},
16481699
{
16491700
"_comment": "hitl-in-app — refund pill (#12345), post-tool-result response. Content includes BOTH approve and reject key phrases so both test assertions can match (the test checks for a substring, not the full string). This avoids sequenceIndex which is fragile across aimock restarts.",
16501701
"match": {
@@ -1671,6 +1722,26 @@
16711722
]
16721723
}
16731724
},
1725+
{
1726+
"_comment": "hitl-in-app — downgrade pill (#12346), approved branch.",
1727+
"match": {
1728+
"userMessage": "downgrade Priya Shah (#12346) to the Starter plan",
1729+
"toolCallId": "call_d5_hitl_downgrade_12346_001__approved"
1730+
},
1731+
"response": {
1732+
"content": "Downgrade confirmed — Priya Shah (#12346) will move to the Starter plan effective next billing cycle."
1733+
}
1734+
},
1735+
{
1736+
"_comment": "hitl-in-app — downgrade pill (#12346), rejected branch.",
1737+
"match": {
1738+
"userMessage": "downgrade Priya Shah (#12346) to the Starter plan",
1739+
"toolCallId": "call_d5_hitl_downgrade_12346_001__rejected"
1740+
},
1741+
"response": {
1742+
"content": "The downgrade request was not approved. Priya Shah (#12346) will remain on the current plan."
1743+
}
1744+
},
16741745
{
16751746
"_comment": "hitl-in-app — downgrade pill (#12346), 2nd turn. Same pattern as refund/escalate. Without this entry, the generic 'plan' catch-all in feature-parity.json hijacks the downgrade message. Content includes approve and reject key phrases because aimock cannot inspect the frontend tool result payload.",
16761747
"match": {
@@ -1697,6 +1768,26 @@
16971768
]
16981769
}
16991770
},
1771+
{
1772+
"_comment": "hitl-in-app — escalate pill (#12347), approved branch.",
1773+
"match": {
1774+
"userMessage": "escalate ticket #12347 to the payments team",
1775+
"toolCallId": "call_d5_hitl_escalate_12347_001__approved"
1776+
},
1777+
"response": {
1778+
"content": "Escalated ticket #12347 to the payments team for Morgan Lee."
1779+
}
1780+
},
1781+
{
1782+
"_comment": "hitl-in-app — escalate pill (#12347), rejected branch.",
1783+
"match": {
1784+
"userMessage": "escalate ticket #12347 to the payments team",
1785+
"toolCallId": "call_d5_hitl_escalate_12347_001__rejected"
1786+
},
1787+
"response": {
1788+
"content": "Not escalated — ticket #12347 will stay in the current queue."
1789+
}
1790+
},
17001791
{
17011792
"_comment": "hitl-in-app — escalate pill (#12347), post-tool-result response. Content includes both approve and reject key phrases.",
17021793
"match": {

showcase/aimock/feature-parity.json

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,6 @@
1717
]
1818
}
1919
},
20-
{
21-
"_comment": "beautiful-chat Calculator pill — call generateSandboxedUi with metric shortcuts.",
22-
"match": {
23-
"userMessage": "build a modern calculator",
24-
"hasToolResult": false
25-
},
26-
"response": {
27-
"toolCalls": [
28-
{
29-
"id": "call_fp_open_gen_ui_calc_001",
30-
"name": "generateSandboxedUi",
31-
"arguments": "{\"initialHeight\":520,\"placeholderMessages\":[\"Composing calculator UI…\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.wrap{padding:16px;max-width:260px}.display{background:#1e293b;padding:12px;border-radius:8px;margin-bottom:8px;font-family:monospace;text-align:right;font-size:18px;min-height:24px}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}button{padding:10px;background:#334155;border:0;color:#e2e8f0;border-radius:6px;font-size:14px;cursor:pointer}button:hover{background:#475569}.shortcuts{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px}.shortcuts button{background:#1e3a5f;font-size:11px;padding:8px 4px}.shortcuts button:hover{background:#2563eb}\",\"html\":\"<div class=\\\"wrap\\\" data-testid=\\\"ogui-calculator\\\"><div class=\\\"display\\\" id=\\\"d\\\">0</div><div class=\\\"grid\\\"><button>7</button><button>8</button><button>9</button><button>+</button><button>4</button><button>5</button><button>6</button><button>-</button><button>1</button><button>2</button><button>3</button><button>*</button><button>0</button><button>.</button><button id=\\\"eq\\\">=</button><button>/</button></div><div class=\\\"shortcuts\\\"><button data-val=\\\"1200000\\\">Revenue $1.2M</button><button data-val=\\\"342\\\">Customers 342</button><button data-val=\\\"4.2\\\">Conv 4.2%</button><button data-val=\\\"42000\\\">Electronics $42K</button><button data-val=\\\"28000\\\">Clothing $28K</button><button data-val=\\\"18000\\\">Food $18K</button></div></div>\",\"jsFunctions\":\"(function(){var expr='';var display=document.getElementById('d');document.querySelectorAll('.grid button').forEach(function(btn){btn.addEventListener('click',async function(){if(btn.id==='eq'){var res=await Websandbox.connection.remote.evaluateExpression({expression:expr});if(res&&res.ok){display.textContent=String(res.value);expr=String(res.value);}else{display.textContent='err';expr='';}}else{expr+=btn.textContent;display.textContent=expr;}});});document.querySelectorAll('.shortcuts button').forEach(function(btn){btn.addEventListener('click',function(){var val=btn.getAttribute('data-val');expr+=val;display.textContent=expr;});});})();\"}"
32-
}
33-
]
34-
}
35-
},
36-
{
37-
"_comment": "beautiful-chat Calculator pill — toolCallId response after generateSandboxedUi renders.",
38-
"match": {
39-
"toolCallId": "call_fp_open_gen_ui_calc_001"
40-
},
41-
"response": {
42-
"content": "Here's your calculator with metric shortcut buttons. The shortcuts insert sample company values (revenue, customers, conversion rate, category breakdowns) into the display. Tap any shortcut, then use the standard buttons to do math with those values."
43-
}
44-
},
4520
{
4621
"match": {
4722
"toolCallId": "call_fp_generate_a2ui_sales_dashboard_001"
@@ -708,8 +683,7 @@
708683
},
709684
{
710685
"match": {
711-
"userMessage": "revenue distribution by category",
712-
"hasToolResult": false
686+
"userMessage": "revenue distribution by category"
713687
},
714688
"response": {
715689
"toolCalls": [
@@ -723,8 +697,7 @@
723697
},
724698
{
725699
"match": {
726-
"userMessage": "expenses by category",
727-
"hasToolResult": false
700+
"userMessage": "expenses by category"
728701
},
729702
"response": {
730703
"toolCalls": [
@@ -861,8 +834,7 @@
861834
},
862835
{
863836
"match": {
864-
"userMessage": "30-minute meeting to learn about CopilotKit",
865-
"hasToolResult": false
837+
"userMessage": "30-minute meeting to learn about CopilotKit"
866838
},
867839
"response": {
868840
"toolCalls": [
@@ -890,8 +862,7 @@
890862
},
891863
{
892864
"match": {
893-
"userMessage": "toggle",
894-
"hasToolResult": false
865+
"userMessage": "toggle"
895866
},
896867
"response": {
897868
"toolCalls": [
@@ -929,8 +900,7 @@
929900
},
930901
{
931902
"match": {
932-
"userMessage": "three todos about learning CopilotKit",
933-
"hasToolResult": false
903+
"userMessage": "three todos about learning CopilotKit"
934904
},
935905
"response": {
936906
"toolCalls": [
@@ -960,11 +930,19 @@
960930
"content": "Yes — 17 is prime. A prime number is a positive integer greater than 1 with no divisors other than 1 and itself. To check 17, we only need to test divisors up to its square root (≈4.12), so 2, 3, and 4. 17 ÷ 2 leaves remainder 1, 17 ÷ 3 leaves remainder 2, and 17 ÷ 4 leaves remainder 1. No divisor in that range divides 17 cleanly, so it has no factors besides 1 and 17 — confirming it is prime."
961931
}
962932
},
933+
{
934+
"_comment": "Beautiful Chat — Calculator pill follow-up after generateSandboxedUi returns. Kept before the first-leg userMessage fixture so follow-up turns are not stolen by the same prompt substring.",
935+
"match": {
936+
"toolCallId": "call_fp_beautiful_chat_calculator_001"
937+
},
938+
"response": {
939+
"content": "Calculator app rendered above — tap a metric shortcut to insert its value, then operate on it with the standard keypad."
940+
}
941+
},
963942
{
964943
"_comment": "Beautiful Chat — Calculator (Open Generative UI) pill. Returns a generateSandboxedUi tool call with a complete calculator widget (matches the d5 calc fixture's pattern but tailored to the beautiful-chat pill's user message).",
965944
"match": {
966-
"userMessage": "build a modern calculator with standard buttons",
967-
"hasToolResult": false
945+
"userMessage": "build a modern calculator with standard buttons"
968946
},
969947
"response": {
970948
"toolCalls": [
@@ -976,20 +954,10 @@
976954
]
977955
}
978956
},
979-
{
980-
"_comment": "Beautiful Chat — Calculator pill follow-up after generateSandboxedUi returns. Closes the turn with a brief confirmation so the chat plateau settles.",
981-
"match": {
982-
"toolCallId": "call_fp_beautiful_chat_calculator_001"
983-
},
984-
"response": {
985-
"content": "Calculator app rendered above — tap a metric shortcut to insert its value, then operate on it with the standard keypad."
986-
}
987-
},
988957
{
989958
"_comment": "Beautiful Chat — Excalidraw (MCP App) pill. Returns a create_view tool call (the Excalidraw MCP server's tool) with a basic network diagram. Without this fixture aimock falls through to real OpenAI proxy and the pill 502s on the gh-mock key.",
990959
"match": {
991-
"userMessage": "Use Excalidraw to create a simple network diagram",
992-
"hasToolResult": false
960+
"userMessage": "Use Excalidraw to create a simple network diagram"
993961
},
994962
"response": {
995963
"toolCalls": [

showcase/harness/fixtures/d5/hitl-steps.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@
1616
]
1717
}
1818
},
19+
{
20+
"match": {
21+
"userMessage": "trip to mars",
22+
"toolCallId": "call_d5_generate_steps_001__approved"
23+
},
24+
"response": {
25+
"content": "Great choices! I will proceed with executing the selected steps for your trip to Mars. Let me work through each one."
26+
}
27+
},
28+
{
29+
"match": {
30+
"userMessage": "trip to mars",
31+
"toolCallId": "call_d5_generate_steps_001__rejected"
32+
},
33+
"response": {
34+
"content": "No problem — I will not execute the Mars trip plan."
35+
}
36+
},
1937
{
2038
"match": {
2139
"userMessage": "trip to mars",

showcase/harness/fixtures/d5/shared-state.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
"content": "Hi — I'm your shared-state co-pilot. Your Preferences panel (name, tone, language, interests) is fed to me on every turn, and I jot notes back into the Agent Scratch Pad via set_notes so the UI re-renders. Try setting your name or asking me to remember something."
1818
}
1919
},
20+
{
21+
"_comment": "Edited-name probe. The harness sets name=D5-PREF-PROBE before clicking Greet me; matching this proves changed preferences reached the model-visible system prompt instead of serving the default fixture.",
22+
"match": {
23+
"userMessage": "Say hi and introduce yourself",
24+
"systemMessage": [
25+
"preferences",
26+
"\"name\": \"D5-PREF-PROBE\""
27+
]
28+
},
29+
"response": {
30+
"content": "Hi D5-PREF-PROBE - I can see your edited shared-state preferences in the current turn."
31+
}
32+
},
2033
{
2134
"_comment": "Plan a weekend pill (msg: 'Suggest a weekend plan based on my interests.'). Same default-state system prompt gate as the Greet pill.",
2235
"match": {

showcase/integrations/ms-agent-dotnet/agent/D5ParityAgents.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -435,17 +435,6 @@ public override async IAsyncEnumerable<AgentRunResponseUpdate> RunStreamingAsync
435435
[EnumeratorCancellation] CancellationToken cancellationToken = default)
436436
{
437437
var materialized = messages as IReadOnlyList<ChatMessage> ?? messages.ToList();
438-
if (TryBuildDeterministicReply(materialized, options) is { } deterministicReply)
439-
{
440-
yield return new AgentRunResponseUpdate
441-
{
442-
Role = ChatRole.Assistant,
443-
MessageId = $"readonly-context-{Guid.NewGuid():N}",
444-
Contents = [new TextContent(deterministicReply)],
445-
};
446-
yield break;
447-
}
448-
449438
var augmented = TryBuildContextMessage(options) is { } contextMessage
450439
? new[] { contextMessage }.Concat(materialized)
451440
: materialized;

0 commit comments

Comments
 (0)