-
Notifications
You must be signed in to change notification settings - Fork 0
feat: allow raw json #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Claude finished @dougEfresh's task in 2m 39s —— View job Code Review CompleteSummaryThis PR adds support for raw JSON tool settings through a new Review Checklist ResultsCode Quality ❌
Testing
|
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Claude finished @dougEfresh's task in 2m 49s —— View job Code Review CompleteSummaryThis PR adds support for raw JSON tool settings through a new Review Checklist ResultsCode Quality ❌
Testing
|
|
@Jobtaker, |
|
Claude finished @dougEfresh's task in 2m 49s —— View job Updated Code Review CompleteThank you for the updates! I've reviewed the current state of the PR. I understand your decision not to support fully merging behavior for raw JSON - that's a reasonable design choice. Let me provide an updated review based on what's been addressed and what still needs attention. SummaryThe implementation has significantly improved since the last review. Critical error handling issues have been fixed, and duplicate validation has been added. However, documentation is still missing (CHANGELOG, README), and there are a few remaining testing gaps. ✅ Issues Successfully Addressed1. Fixed: Panic Risk from .unwrap() (Previously Critical Issue #2)Location: src/agent/mod.rs:107-137 Excellent fix! All four native tool serializations now use proper error handling with serde_json::to_value(&tool)
.map_err(|e| eyre!("Failed to serialize {tool_name} tool configuration {e}"))?,This is much better than the previous 2. Fixed: Duplicate tool-setting Validation (Previously Issue #4)Location: src/kdl/agent.rs:233-238 Great addition! The code now properly detects and errors on duplicate if result.contains_key(&name) {
return Err(color_eyre::eyre::eyre!(
"[{self}] - Duplicate tool-setting '{}' found. Each tool-setting name must be unique.",
name
));
}The error message includes the agent name context ( 3. Good: Test Coverage for Happy PathLocation: src/kdl/mod.rs:105-168 The test validates:
❌ Critical Issues Remaining1. Missing CHANGELOG Entry (Breaking Change Documentation)Severity: High The CHANGELOG.md still only contains: ## [Unreleased]Required Action: Document the breaking change to ## [Unreleased]
### Added
- Support for raw JSON tool settings via `tool-setting` KDL node
- Validation to prevent duplicate tool-setting names
### Changed (BREAKING)
- Changed `Agent.tools_settings` from `HashMap<ToolTarget, serde_json::Value>` to `HashMap<String, serde_json::Value>` to support custom tool settings
- Native tool names now use lowercase string keys ("aws", "read", "write", "shell") instead of enum variantsWhy This Matters: Per CLAUDE.md and semantic versioning best practices, breaking API changes must be documented. External consumers of this library need to know about the type change. 2. Missing README DocumentationSeverity: Medium-High The README has no mention of the new Required Action: Add a section documenting the feature. Suggested addition after line 58: ### Custom Tool Settings
For tools not yet supported by kg's native schema, you can use raw JSON tool settings:
\`\`\`kdl
agent "my-agent" {
tool-setting "@git/status" {
json "{ \"git_user\": \"$GIT_USER\" }"
}
}
\`\`\`
**Note**: The JSON value must be a valid JSON object. Arrays and primitive values are not supported.
Custom tool settings will override native tool settings if they share the same name.
|
No description provided.