refactor(tools-mcp): structured JSON results + shell consolidation #91

Merged
jasoncouture merged 15 commits from tool-rework into main 2026-05-18 16:53:50 -04:00
jasoncouture commented 2026-05-18 16:53:32 -04:00 (Migrated from github.com)

Summary

Convert every MCP tool to return a typed record (serialized to JSON by the SDK) instead of a free-form string. Each result implements IToolResponse (string? Error channel) so callers can distinguish success/failure without parsing prose.

  • IToolResponse contract in LlamaShears.Core.Tools.ModelContextProtocol.
  • Filesystem toolsfile_read/file_list/file_write/file_append/file_delete/file_move/file_regex_replace/file_grep all return record results.
  • file_read: dropped the 512 KiB hard-size check (response budget is the only gate now), raised ResponseBudget limits, added createdAt/modifiedAt (DateTimeOffset, local time), removed NextStartLine (agent reported it as token-noise — endLine + 1 is the resume cursor).
  • Memory toolsmemory_index/memory_search/memory_store return structured payloads.
  • Cron toolscron_cancel/list/trigger/edit/schedule return shared CronJobSummary-bearing records.
  • Todo tools — all five share TodoListResult (state, itemCount, items[]).
  • Shell — collapsed shell_sh + shell_bash into a single shell_run (bash-only); dual entry points added MCP surface for nothing on Fedora/Mac/Arch and were a footgun on Debian-family /bin/sh = dash.

Test plan

  • dotnet build clean
  • dotnet test — 519 / 519 passing at every commit
  • Existing filesystem tool tests rewritten to assert on record fields

🤖 Generated with Claude Code

## Summary Convert every MCP tool to return a typed record (serialized to JSON by the SDK) instead of a free-form string. Each result implements `IToolResponse` (`string? Error` channel) so callers can distinguish success/failure without parsing prose. - **`IToolResponse` contract** in `LlamaShears.Core.Tools.ModelContextProtocol`. - **Filesystem tools** — `file_read`/`file_list`/`file_write`/`file_append`/`file_delete`/`file_move`/`file_regex_replace`/`file_grep` all return record results. - **`file_read`**: dropped the 512 KiB hard-size check (response budget is the only gate now), raised `ResponseBudget` limits, added `createdAt`/`modifiedAt` (DateTimeOffset, local time), removed `NextStartLine` (agent reported it as token-noise — `endLine + 1` is the resume cursor). - **Memory tools** — `memory_index`/`memory_search`/`memory_store` return structured payloads. - **Cron tools** — `cron_cancel`/`list`/`trigger`/`edit`/`schedule` return shared `CronJobSummary`-bearing records. - **Todo tools** — all five share `TodoListResult` (state, itemCount, items[]). - **Shell** — collapsed `shell_sh` + `shell_bash` into a single `shell_run` (bash-only); dual entry points added MCP surface for nothing on Fedora/Mac/Arch and were a footgun on Debian-family `/bin/sh = dash`. ## Test plan - [x] `dotnet build` clean - [x] `dotnet test` — 519 / 519 passing at every commit - [x] Existing filesystem tool tests rewritten to assert on record fields 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-05-18 16:55:22 -04:00 (Migrated from github.com)
Package Line Rate Branch Rate Complexity Health
LlamaShears.Core.Eventing 91% 84% 53
LlamaShears.Core.Abstractions 49% 34% 365
LlamaShears.Api 30% 30% 469
LlamaShears.Provider.Ollama 44% 28% 188
LlamaShears.Core.Eventing.Extensions 100% 100% 1
LlamaShears.Core 45% 41% 1386
LlamaShears.Provider.Onnx.Embeddings 37% 38% 72
LlamaShears.Provider.OpenAI 66% 65% 229
LlamaShears.Api.Web 1% 1% 428
LlamaShears.Hosting 33% 21% 27
LlamaShears.Plugins 0% 100% 1
LlamaShears.Core.Eventing 89% 75% 53
LlamaShears 52% 36% 25
LlamaShears.Plugins.Host 34% 24% 36
LlamaShears.Core.Abstractions 33% 14% 365
LlamaShears.Api 6% 1% 469
LlamaShears.Provider.Ollama 3% 1% 188
LlamaShears.Core.Eventing.Extensions 100% 100% 1
StrangeSoft.Plugins.Host 20% 21% 87
LlamaShears.Core 40% 27% 1386
LlamaShears.Provider.Onnx.Embeddings 3% 0% 72
LlamaShears.Provider.OpenAI 2% 0% 229
LlamaShears.Api.Web 21% 10% 428
LlamaShears.Hosting 26% 8% 27
LlamaShears.Plugins 0% 100% 1
LlamaShears.Core.Eventing 89% 75% 53
LlamaShears 52% 36% 25
LlamaShears.Plugins.Host 34% 24% 36
LlamaShears.Core.Abstractions 33% 14% 365
LlamaShears.IntegrationTests 85% 73% 72
LlamaShears.Api 8% 3% 469
LlamaShears.Provider.Ollama 3% 1% 188
LlamaShears.Core.Eventing.Extensions 100% 100% 1
StrangeSoft.Plugins.Host 20% 21% 87
LlamaShears.Core 41% 28% 1386
LlamaShears.Provider.Onnx.Embeddings 3% 0% 72
LlamaShears.Provider.OpenAI 2% 0% 229
LlamaShears.Api.Web 31% 17% 428
LlamaShears.Hosting 26% 8% 27
LlamaShears.Analyzers.CodeFixes 85% 69% 60
LlamaShears.Analyzers 88% 76% 199
Summary 46% (10798 / 32117) 36% (2309 / 9425) 10283
Package | Line Rate | Branch Rate | Complexity | Health -------- | --------- | ----------- | ---------- | ------ LlamaShears.Core.Eventing | 91% | 84% | 53 | ✔ LlamaShears.Core.Abstractions | 49% | 34% | 365 | ❌ LlamaShears.Api | 30% | 30% | 469 | ❌ LlamaShears.Provider.Ollama | 44% | 28% | 188 | ❌ LlamaShears.Core.Eventing.Extensions | 100% | 100% | 1 | ✔ LlamaShears.Core | 45% | 41% | 1386 | ❌ LlamaShears.Provider.Onnx.Embeddings | 37% | 38% | 72 | ❌ LlamaShears.Provider.OpenAI | 66% | 65% | 229 | ➖ LlamaShears.Api.Web | 1% | 1% | 428 | ❌ LlamaShears.Hosting | 33% | 21% | 27 | ❌ LlamaShears.Plugins | 0% | 100% | 1 | ❌ LlamaShears.Core.Eventing | 89% | 75% | 53 | ✔ LlamaShears | 52% | 36% | 25 | ➖ LlamaShears.Plugins.Host | 34% | 24% | 36 | ❌ LlamaShears.Core.Abstractions | 33% | 14% | 365 | ❌ LlamaShears.Api | 6% | 1% | 469 | ❌ LlamaShears.Provider.Ollama | 3% | 1% | 188 | ❌ LlamaShears.Core.Eventing.Extensions | 100% | 100% | 1 | ✔ StrangeSoft.Plugins.Host | 20% | 21% | 87 | ❌ LlamaShears.Core | 40% | 27% | 1386 | ❌ LlamaShears.Provider.Onnx.Embeddings | 3% | 0% | 72 | ❌ LlamaShears.Provider.OpenAI | 2% | 0% | 229 | ❌ LlamaShears.Api.Web | 21% | 10% | 428 | ❌ LlamaShears.Hosting | 26% | 8% | 27 | ❌ LlamaShears.Plugins | 0% | 100% | 1 | ❌ LlamaShears.Core.Eventing | 89% | 75% | 53 | ✔ LlamaShears | 52% | 36% | 25 | ➖ LlamaShears.Plugins.Host | 34% | 24% | 36 | ❌ LlamaShears.Core.Abstractions | 33% | 14% | 365 | ❌ LlamaShears.IntegrationTests | 85% | 73% | 72 | ✔ LlamaShears.Api | 8% | 3% | 469 | ❌ LlamaShears.Provider.Ollama | 3% | 1% | 188 | ❌ LlamaShears.Core.Eventing.Extensions | 100% | 100% | 1 | ✔ StrangeSoft.Plugins.Host | 20% | 21% | 87 | ❌ LlamaShears.Core | 41% | 28% | 1386 | ❌ LlamaShears.Provider.Onnx.Embeddings | 3% | 0% | 72 | ❌ LlamaShears.Provider.OpenAI | 2% | 0% | 229 | ❌ LlamaShears.Api.Web | 31% | 17% | 428 | ❌ LlamaShears.Hosting | 26% | 8% | 27 | ❌ LlamaShears.Analyzers.CodeFixes | 85% | 69% | 60 | ✔ LlamaShears.Analyzers | 88% | 76% | 199 | ✔ **Summary** | **46%** (10798 / 32117) | **36%** (2309 / 9425) | **10283** | ❌ <!-- Sticky Pull Request Commentcoverage -->
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-05-18 16:58:11 -04:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

This PR refactors the Model Context Protocol (MCP) tool surface so tools return structured, typed result records (serialized to JSON) implementing a shared IToolResponse error channel, and consolidates the shell tools into a single bash-based entry point.

Changes:

  • Introduces IToolResponse and updates MCP tools to return typed record payloads with a shared Error field instead of free-form strings.
  • Refactors filesystem, memory, cron, todo, and shell MCP tools to emit structured results (plus updated unit tests asserting on fields).
  • Updates response budgeting (larger max bytes/lines) and removes file_read’s previous hard file-size refusal.

Reviewed changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/WriteFileToolTests.cs Updates assertions to validate structured file_write result fields (Error, Written, BytesWritten, Overwritten).
tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/RegexReplaceFileToolTests.cs Updates assertions and renames a test to validate structured file_regex_replace results.
tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/ReadFileToolTests.cs Rewrites file_read tests to assert on range fields, EOF behavior, and timestamps; updates truncation/resume testing.
tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/GrepToolTests.cs Updates tests to assert structured file_grep match objects and counts.
tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/DeleteFileToolTests.cs Updates assertions to validate structured file_delete result fields.
tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/AppendFileToolTests.cs Updates assertions to validate structured file_append result fields.
src/LlamaShears.Core/Tools/ModelContextProtocol/IToolResponse.cs Adds shared response contract for MCP tool results (string? Error).
src/LlamaShears.Api/Tools/ModelContextProtocol/Todo/TodoTools.cs Changes todo tools to return TodoListResult (structured JSON) and centralizes state-to-error mapping.
src/LlamaShears.Api/Tools/ModelContextProtocol/Todo/TodoListResult.cs Adds typed todo list result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Shell/ShellTools.cs Consolidates shell tools into shell_run (bash) and returns ShellRunResult structured output.
src/LlamaShears.Api/Tools/ModelContextProtocol/Shell/ShellRunResult.cs Adds typed shell execution result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/ResponseBudget.cs Increases shared response budget limits (bytes and lines).
src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/StoreMemoryTool.cs Returns structured MemoryStoreResult with Stored, RelativePath, and Error.
src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/SearchMemoryTool.cs Returns structured MemorySearchResultPayload with query echoing and hit list.
src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemoryStoreResult.cs Adds typed memory store result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemorySearchResultPayload.cs Adds typed memory search payload record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemorySearchHit.cs Adds typed memory search hit record.
src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemoryIndexResult.cs Adds typed memory index reconcile result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/IndexMemoryTool.cs Returns structured MemoryIndexResult instead of formatted strings.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/WriteFileTool.cs Changes file_write to return FileWriteResult and standardizes failure handling via Error.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/RegexReplaceFileTool.cs Changes file_regex_replace to return FileRegexReplaceResult with edited/replacement counts.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/ReadFileTool.cs Changes file_read to return FileReadResult with range/timestamps/EOF flag and removes hard file-size cap.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/MoveFileTool.cs Changes file_move to return FileMoveResult with moved/overwritten flags and structured errors.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/ListFilesTool.cs Changes file_list to return FileListResult containing structured entries and truncation metadata.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/GrepTool.cs Changes file_grep to return GrepResult with match objects and counts.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/GrepResult.cs Adds typed grep result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/GrepMatch.cs Adds typed grep match record.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileWriteResult.cs Adds typed file write result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileRegexReplaceResult.cs Adds typed regex replace result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileReadResult.cs Adds typed file read result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileMoveResult.cs Adds typed file move result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileListResult.cs Adds typed file list result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileListEntry.cs Adds typed file list entry record.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileDeleteResult.cs Adds typed file delete result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileAppendResult.cs Adds typed file append result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/TriggerCronTool.cs Changes cron_trigger to return CronTriggerResult structured output.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/ScheduleCronTool.cs Changes cron_schedule to return CronScheduleResult including a CronJobSummary.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/ListCronTool.cs Changes cron_list to return CronListResult with structured job summaries.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/EditCronTool.cs Changes cron_edit to return CronEditResult with edited flag and updated job summary.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronTriggerResult.cs Adds typed cron trigger result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronScheduleResult.cs Adds typed cron schedule result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronListResult.cs Adds typed cron list result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronJobSummary.cs Adds shared cron job summary record used across cron tool results.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronEditResult.cs Adds typed cron edit result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronCancelResult.cs Adds typed cron cancel result record implementing IToolResponse.
src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CancelCronTool.cs Changes cron_cancel to return CronCancelResult structured output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull request overview This PR refactors the Model Context Protocol (MCP) tool surface so tools return structured, typed result records (serialized to JSON) implementing a shared `IToolResponse` error channel, and consolidates the shell tools into a single bash-based entry point. **Changes:** - Introduces `IToolResponse` and updates MCP tools to return typed record payloads with a shared `Error` field instead of free-form strings. - Refactors filesystem, memory, cron, todo, and shell MCP tools to emit structured results (plus updated unit tests asserting on fields). - Updates response budgeting (larger max bytes/lines) and removes `file_read`’s previous hard file-size refusal. ### Reviewed changes Copilot reviewed 48 out of 48 changed files in this pull request and generated 3 comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/WriteFileToolTests.cs | Updates assertions to validate structured `file_write` result fields (`Error`, `Written`, `BytesWritten`, `Overwritten`). | | tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/RegexReplaceFileToolTests.cs | Updates assertions and renames a test to validate structured `file_regex_replace` results. | | tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/ReadFileToolTests.cs | Rewrites `file_read` tests to assert on range fields, EOF behavior, and timestamps; updates truncation/resume testing. | | tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/GrepToolTests.cs | Updates tests to assert structured `file_grep` match objects and counts. | | tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/DeleteFileToolTests.cs | Updates assertions to validate structured `file_delete` result fields. | | tests/LlamaShears.UnitTests/Api/Tools/ModelContextProtocol/Filesystem/AppendFileToolTests.cs | Updates assertions to validate structured `file_append` result fields. | | src/LlamaShears.Core/Tools/ModelContextProtocol/IToolResponse.cs | Adds shared response contract for MCP tool results (`string? Error`). | | src/LlamaShears.Api/Tools/ModelContextProtocol/Todo/TodoTools.cs | Changes todo tools to return `TodoListResult` (structured JSON) and centralizes state-to-error mapping. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Todo/TodoListResult.cs | Adds typed todo list result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Shell/ShellTools.cs | Consolidates shell tools into `shell_run` (bash) and returns `ShellRunResult` structured output. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Shell/ShellRunResult.cs | Adds typed shell execution result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/ResponseBudget.cs | Increases shared response budget limits (bytes and lines). | | src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/StoreMemoryTool.cs | Returns structured `MemoryStoreResult` with `Stored`, `RelativePath`, and `Error`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/SearchMemoryTool.cs | Returns structured `MemorySearchResultPayload` with query echoing and hit list. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemoryStoreResult.cs | Adds typed memory store result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemorySearchResultPayload.cs | Adds typed memory search payload record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemorySearchHit.cs | Adds typed memory search hit record. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/MemoryIndexResult.cs | Adds typed memory index reconcile result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Memory/IndexMemoryTool.cs | Returns structured `MemoryIndexResult` instead of formatted strings. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/WriteFileTool.cs | Changes `file_write` to return `FileWriteResult` and standardizes failure handling via `Error`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/RegexReplaceFileTool.cs | Changes `file_regex_replace` to return `FileRegexReplaceResult` with edited/replacement counts. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/ReadFileTool.cs | Changes `file_read` to return `FileReadResult` with range/timestamps/EOF flag and removes hard file-size cap. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/MoveFileTool.cs | Changes `file_move` to return `FileMoveResult` with moved/overwritten flags and structured errors. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/ListFilesTool.cs | Changes `file_list` to return `FileListResult` containing structured entries and truncation metadata. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/GrepTool.cs | Changes `file_grep` to return `GrepResult` with match objects and counts. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/GrepResult.cs | Adds typed grep result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/GrepMatch.cs | Adds typed grep match record. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileWriteResult.cs | Adds typed file write result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileRegexReplaceResult.cs | Adds typed regex replace result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileReadResult.cs | Adds typed file read result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileMoveResult.cs | Adds typed file move result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileListResult.cs | Adds typed file list result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileListEntry.cs | Adds typed file list entry record. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileDeleteResult.cs | Adds typed file delete result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Filesystem/FileAppendResult.cs | Adds typed file append result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/TriggerCronTool.cs | Changes `cron_trigger` to return `CronTriggerResult` structured output. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/ScheduleCronTool.cs | Changes `cron_schedule` to return `CronScheduleResult` including a `CronJobSummary`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/ListCronTool.cs | Changes `cron_list` to return `CronListResult` with structured job summaries. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/EditCronTool.cs | Changes `cron_edit` to return `CronEditResult` with edited flag and updated job summary. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronTriggerResult.cs | Adds typed cron trigger result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronScheduleResult.cs | Adds typed cron schedule result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronListResult.cs | Adds typed cron list result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronJobSummary.cs | Adds shared cron job summary record used across cron tool results. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronEditResult.cs | Adds typed cron edit result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CronCancelResult.cs | Adds typed cron cancel result record implementing `IToolResponse`. | | src/LlamaShears.Api/Tools/ModelContextProtocol/Cron/CancelCronTool.cs | Changes `cron_cancel` to return `CronCancelResult` structured output. | </details> --- 💡 <a href="/jasoncouture/llama-shears/new/main?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
@ -196,7 +204,6 @@ public sealed partial class GrepTool
match = match.NextMatch();
}
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-05-18 16:58:10 -04:00

This empty catch (RegexMatchTimeoutException) silently swallows timeouts without any written justification or signal to the caller. ADR-0010 forbids swallowing exceptions unless the reasoning is explicitly documented in the catch block, and a grep timeout also changes observable results. Consider either returning a structured warning/error (e.g., an Errors/SkippedFiles field) or at least adding an Ignored — … comment and logging so operators/users can tell matches may be incomplete.

This empty `catch (RegexMatchTimeoutException)` silently swallows timeouts without any written justification or signal to the caller. ADR-0010 forbids swallowing exceptions unless the reasoning is explicitly documented in the catch block, and a grep timeout also changes observable results. Consider either returning a structured warning/error (e.g., an `Errors`/`SkippedFiles` field) or at least adding an `Ignored — …` comment and logging so operators/users can tell matches may be incomplete.
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-05-18 16:58:11 -04:00

This catch block discards IO/authorization failures (_ = ex;) without any written justification or reporting. Per ADR-0010, swallowing is forbidden unless the reasoning is articulated in the catch block, and silently skipping unreadable files can materially change grep results. Consider returning a structured warning/error (per-file or aggregated), logging at least at Debug/Information with the file path, or rethrowing and letting the caller handle failure.

This catch block discards IO/authorization failures (`_ = ex;`) without any written justification or reporting. Per ADR-0010, swallowing is forbidden unless the reasoning is articulated in the catch block, and silently skipping unreadable files can materially change grep results. Consider returning a structured warning/error (per-file or aggregated), logging at least at Debug/Information with the file path, or rethrowing and letting the caller handle failure.
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2026-05-18 16:58:10 -04:00

When a single line exceeds the response budget, ReadRangeAsync returns Truncated=true with LinesReturned=0. In that case this response sets EndLine = requestedStartLine - 1, so the documented resume cursor (endLine + 1) does not advance and callers can get stuck in an infinite retry loop. Consider surfacing an explicit error for this condition and/or returning a resume cursor that guarantees forward progress (e.g., a dedicated NextStartLine/ResumeStartLine field, or a different EndLine sentinel when truncated-with-zero-lines occurs).

When a single line exceeds the response budget, `ReadRangeAsync` returns `Truncated=true` with `LinesReturned=0`. In that case this response sets `EndLine = requestedStartLine - 1`, so the documented resume cursor (`endLine + 1`) does not advance and callers can get stuck in an infinite retry loop. Consider surfacing an explicit error for this condition and/or returning a resume cursor that guarantees forward progress (e.g., a dedicated `NextStartLine`/`ResumeStartLine` field, or a different `EndLine` sentinel when truncated-with-zero-lines occurs).
Sign in to join this conversation.
No description provided.