You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ All notable changes to ManagedCode.FileContext are documented here.
5
5
## Unreleased
6
6
7
7
- Preserve UTF-8 byte accounting when a surrogate pair crosses a full-read buffer boundary.
8
-
- Return a missing-file failure from the metadata tool so session restoration cannot turn a null result into empty content; keep the nullable direct API unchanged.
8
+
- Return structured found/not_found metadata tool results with the logical path, preserving them through session restoration; keep the nullable direct API unchanged.
9
9
- Verify tool-result ordering, empty/error outputs, restored-session follow-ups, and concurrent multi-file operations through real filesystem and LlmTck tests.
10
10
- Update Meziantou.Analyzer to 3.0.203. Retain OpenAI 2.12.0 because Microsoft.Extensions.AI.OpenAI 10.9.0 requires OpenAI below 2.13.0.
Copy file name to clipboardExpand all lines: docs/Features/file-context.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,15 +48,15 @@ flowchart TD
48
48
## Failure flows
49
49
50
50
- Unsafe paths fail with `ArgumentException`; the storage provider is not called.
51
-
- Missing files return `null` through the direct `AgentFileStore` and `IFileContext.GetInfoAsync` contracts; range reads and the `file_context_info` tool throw `FileNotFoundException`.
51
+
- Missing files return `null` through the direct `AgentFileStore` and `IFileContext.GetInfoAsync` contracts; range reads throw `FileNotFoundException`. The `file_context_info` tool returns a structured `not_found` result with the logical path.
52
52
- Storage failures become `IOException` values with the operation and safe logical path, preserving the provider's safe problem detail.
53
53
- Invalid or catastrophic regex patterns fail deterministically; a regex timeout does not hang the agent invocation.
54
54
- Oversized files, result sets, or graph exports stop at configured boundaries and report truncation or a clear limit failure.
55
55
- Graph operations with no matching Markdown input fail clearly instead of inventing an empty knowledge base.
56
56
57
57
## Empty results and conversation history
58
58
59
-
An empty file or no search matches is a valid tool outcome. With the tested Agent Framework function-invocation and OpenAI chat pipeline, these become a `role: tool` message with the matching `tool_call_id`: the content contains serialized `""` or `[]`, respectively. The metadata tool reports a missingfile as a failure instead of returning `null`, because the tested Agent Framework session roundtrip converts a null function result into empty wire content. Range reads retain their structured window metadata even when their content is empty. Tool exceptions also produce a matching error result during the normal function-invocation loop.
59
+
An empty file or no search matches is a valid tool outcome. With the tested Agent Framework function-invocation and OpenAI chat pipeline, these become a `role: tool` message with the matching `tool_call_id`: the content contains serialized `""` or `[]`, respectively. The metadata tool returns `{ "status": "not_found", "path": "missing.txt" }` for an absent file. Existing files return `{ "status": "found", "path": "notes.txt", "info": { ... } }`, where `info` contains the file metadata. Both structured results survive session restoration; a bare null function result would become empty wire content in the tested Agent Framework pipeline. Storage failures and invalid paths still fail normally. Range reads retain their structured window metadata even when their content is empty. Tool exceptions also produce a matching error result during the normal function-invocation loop.
60
60
61
61
FileContext does not persist agent sessions, synthesize fallback assistant responses, or repair interrupted model/tool turns. The host owns those concerns: it must preserve call/result pairs when saving or replaying history and handle cancellation, approval pauses, and provider failures before reusing an incomplete turn. A final assistant message does not replace a tool result. Completed tool turns are also tested through Agent Framework session serialization/restoration and a subsequent user request.
Copy file name to clipboardExpand all lines: src/ManagedCode.FileContext/FileContextToolDescriptions.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ internal static class FileContextToolDescriptions
9
9
"Read a bounded, one-based line range from a text file. Use this instead of a full read for large files.";
10
10
publicconststringStartLine="One-based first line to read.";
11
11
publicconststringLineCount="Number of lines to return; omitted uses the configured default.";
12
-
publicconststringGetInfo="Return file size, media type, and last-modified time without reading its content. Fails if the file does not exist.";
12
+
publicconststringGetInfo="Return status, path, and file metadata without reading content. Status is found with info when the file exists, or not_found when it does not.";
13
13
publicconststringSearchMarkdownGraph=
14
14
"Build a linked-data knowledge graph from scoped Markdown files and search its concepts and relationships.";
15
15
publicconststringGraphQuery="Concept or relationship query.";
0 commit comments