Skip to content

Conversation

@vinhnx
Copy link
Owner

@vinhnx vinhnx commented Dec 20, 2025

Agent Runloop:

  • Replace unsafe .unwrap() with safe map/unwrap_or patterns in MCP tool filtering
  • Add proper error handling for malformed tool calls with LLM feedback
  • Fix memory ordering (Relaxed -> Acquire) in CtrlCState for signal handling
  • Add structured error responses for invalid tool arguments

LLM Providers:

  • Move Gemini API key from URL query parameter to x-goog-api-key header
  • Add API key validation before requests for Anthropic and Gemini
  • Return Authentication error instead of making requests with empty keys

Tool Execution:

  • Add input validation for ACP tools (agent IDs, actions, payload size/depth)
  • Implement sliding window eviction in PatternDetector (max 1000 events)
  • Integrate middleware on_error handlers in CachedToolExecutor
  • Track failed calls in executor stats and pattern detector

Pull Request

Description

Please include a summary of the changes and the issue that this PR addresses. Include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue number)

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so others can reproduce. Include any relevant details for your test configuration.

  • Rust tests: cargo test
  • Linting: cargo clippy
  • Formatting: cargo fmt
  • Build: cargo build

Test Configuration:

  • Rust version:
  • Operating system:
  • Toolchain:

Checklist:

  • My code follows the style guidelines of this project (Rust conventions, naming, etc.)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (cargo test)
  • I have run cargo clippy and addressed any issues
  • I have run cargo fmt to ensure proper formatting
  • Any dependent changes have been merged and published in downstream modules
  • I have updated the CHANGELOG.md if this change affects the user-facing behavior
  • I have checked my code and corrected any misspellings

Additional Context

Add any other context or screenshots about the pull request here.

Agent Runloop:
- Replace unsafe .unwrap() with safe map/unwrap_or patterns in MCP tool filtering
- Add proper error handling for malformed tool calls with LLM feedback
- Fix memory ordering (Relaxed -> Acquire) in CtrlCState for signal handling
- Add structured error responses for invalid tool arguments

LLM Providers:
- Move Gemini API key from URL query parameter to x-goog-api-key header
- Add API key validation before requests for Anthropic and Gemini
- Return Authentication error instead of making requests with empty keys

Tool Execution:
- Add input validation for ACP tools (agent IDs, actions, payload size/depth)
- Implement sliding window eviction in PatternDetector (max 1000 events)
- Integrate middleware on_error handlers in CachedToolExecutor
- Track failed calls in executor stats and pattern detector
@vinhnx vinhnx closed this Dec 20, 2025
@vinhnx vinhnx deleted the claude/codebase-audit-optimization-Eh4q8 branch January 17, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants