Add context snapshots for async questions and plugin refresh (#44948)

## What changed

- Add a multi-turn scenario covering `request_user_input_async`, continued work while awaiting an answer, and delivery of the answer into the active turn.
- Add a scenario covering plugin configuration reload in an existing thread, including discovery and use of newly installed skills and MCP tools across turns.
- Render explicit tool output names and namespaces in context snapshots, with a regression test ensuring outputs do not inherit metadata from their calls.

GitOrigin-RevId: 64fca8cb51a3a697fa84bf444ce55b8408961ab5
This commit is contained in:
pakrym-oai authored and copyberry committed 2026-09-12 00:34:18 +00:00
1 parent 132c739171
commit 89c8bcf37d
5 files changed
+751 -2

No files matched your search

@@ -46,6 +46,36 @@ fn lite_tool_catalog_and_code_calls_are_visible() {
assert!(rendered.contains("03:custom_tool_call_output:success=true:plan updated"));
}
#[test]
fn tool_outputs_show_only_their_own_names_and_namespaces() {
let items = [
json!({ "type": "function_call", "call_id": "lookup", "namespace": "collaboration", "name": "lookup", "arguments": "{}" }),
json!({ "type": "custom_tool_call", "call_id": "custom", "namespace": "functions", "name": "exec", "input": "" }),
json!({ "type": "function_call_output", "call_id": "lookup", "output": "ordinary function result" }),
json!({ "type": "custom_tool_call_output", "call_id": "custom", "output": "ordinary custom result" }),
json!({ "type": "custom_tool_call_output", "call_id": "custom", "name": "exec", "output": "Code Mode notification" }),
json!({ "type": "function_call_output", "call_id": "lookup", "name": "lookup", "output": "explicit name only" }),
json!({ "type": "function_call_output", "name": "notifications", "namespace": "slack", "output": "standalone" }),
json!({ "type": "function_call_output", "call_id": "lookup", "namespace": "slack", "output": "explicit namespace only" }),
];
let rendered = render_test_items(&items, &ContextSnapshotOptions::default());
let outputs = rendered
.lines()
.filter(|line| line.contains("call_output"))
.collect::<Vec<_>>();
assert_eq!(
outputs,
[
"02:function_call_output:ordinary function result",
"03:custom_tool_call_output:ordinary custom result",
"04:custom_tool_call_output/exec:Code Mode notification",
"05:function_call_output/lookup:explicit name only",
"06:function_call_output/slack.notifications:standalone",
"07:function_call_output[namespace=slack]:explicit namespace only",
]
);
}
#[test]
fn encrypted_compaction_payload_changes_are_visible_without_exposing_contents() {
let render = |encrypted_content| {