chore: split oversized files into focused modules#61
Merged
Conversation
Stop credential loss on a corrupt auth.json: load_file now distinguishes NotFound from corruption and refuses to overwrite a file it cannot parse. Map store blocking-task join failures to StoreError instead of panicking, and replace the browser/computer/command parser production expects and unreachable with non-panicking paths. Surface previously swallowed failures: /resume read errors now log and emit an error Notify instead of silently truncating context, config save failures log and toast, plan-file IO errors are distinguished from an empty file, and shell pipe read errors are logged. Make Agent-tool semaphore acquisition cancellation-aware so interrupts are not delayed by permit contention.
Introduce SessionState to carry the six mutable per-session fields (target, conversation, tracker, thread_id, mode, plan_path) that were threaded through handle_turn, run_turn_chain, drain_deferred, run_one_turn, handle_shell, handle_compact, and handle_resume. This removes seven too_many_arguments allowances and collapses the verbatim forwarding chains. Replace the three identical 17-field Ctx literals in the op loop with a single ctx! macro, and route mode/clear/select/resume through the bundled state. Behavior is unchanged; all engine tests pass.
…links Store assistant transcript items as raw markdown text instead of pre-themed lines, rendering them through the current theme and highlighter at draw time. Theme switches now restyle past assistant messages instead of leaving them in the old palette. Simplify commit_text/push_error/complete to take only text. Fix markdown link styling inside table cells: link bounds and accent coloring now target the active span buffer (the table cell when inside a table) so table-cell links get accent color and hidden URLs like normal links. Add tests for both behaviors.
Cover the previously untested computer action parser (button routing, key keys/combo fallback, modifier aliases, drag path, defaults, missing-field errors), the /resume command's arg-to-effect mapping, and the agent delegation_label/final_text helpers. Update root AGENTS.md: correct the crate count to 35, add goat-config to the goat-tui dependency line, and document goat-mcp, goat-sandbox, goat-tool-web, and goat-command-app. Update goat-agent/AGENTS.md module table with shell, websearch, plan, conversation, retry, compaction rows and describe SessionState.
d40b353 to
76c678d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Break the largest files into cohesive modules so each crate's responsibilities are explicit. Promotes the self-contained git-worktree subsystem to a
goat-worktreeleaf crate, and splits oversized TUI (picker/config/transcript), protocol, store, command, anthropic-auth, and mcp files into focused submodules. All changes are behavior-preserving pure restructuring; public paths are kept via re-exports.Verification
cargo fmt --all --check— passedcargo clippy --workspace --all-targets -- -D warnings— passedcargo test --workspace— passed