Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: improve tool display format#1488

Merged
tusharmath merged 5 commits into
mainfrom
improve-tool-format
Sep 5, 2025
Merged

feat: improve tool display format#1488
tusharmath merged 5 commits into
mainfrom
improve-tool-format

Conversation

@tusharmath

@tusharmath tusharmath commented Sep 5, 2025

Copy link
Copy Markdown
Collaborator

fixes #1466

@github-actions github-actions Bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Sep 5, 2025
Comment thread crates/forge_main/src/tools_display.rs Outdated
Comment on lines +80 to +89
assert!(expected.contains("System"));
assert!(expected.contains("[✓] read"));
assert!(expected.contains("[✓] write"));
assert!(expected.contains("[✓] search"));
assert!(expected.contains("[ ] patch"));
assert!(expected.contains("[ ] undo"));
assert!(expected.contains("[ ] shell"));
assert!(expected.contains("[ ] fetch"));
assert!(expected.contains("[ ] remove"));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test assertions for unavailable tools (with [ ] checkboxes) will fail because the format_tools function only adds tools that are present in the ToolsOverview object to the Info output. The function doesn't have logic to show unavailable tools with empty checkboxes.

To fix this, either:

  1. Modify the format_tools function to include a predefined list of all possible tools and mark them as available/unavailable based on what's in the ToolsOverview, or
  2. Remove the assertions that check for unavailable tools (those with [ ] prefix)

The current implementation and test expectations are misaligned.

Suggested change
assert!(expected.contains("System"));
assert!(expected.contains("[✓] read"));
assert!(expected.contains("[✓] write"));
assert!(expected.contains("[✓] search"));
assert!(expected.contains("[ ] patch"));
assert!(expected.contains("[ ] undo"));
assert!(expected.contains("[ ] shell"));
assert!(expected.contains("[ ] fetch"));
assert!(expected.contains("[ ] remove"));
}
assert!(expected.contains("System"));
assert!(expected.contains("[✓] read"));
assert!(expected.contains("[✓] write"));
assert!(expected.contains("[✓] search"));
}

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@tusharmath tusharmath changed the title refactor: enhance tools overview structure and display formatting feat: improve tool display format Sep 5, 2025
Comment thread crates/forge_main/src/ui.rs Outdated
self.writeln(output)?;
let all_tools = self.api.tools().await?;
let agent_tools = self.agent_tools().await?;
println!("{:?}", agent_tools);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This debug print statement should be removed before merging. It appears to be a development artifact that would output raw debug formatting of the agent_tools vector to the console during normal operation, which isn't appropriate for production code.

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@github-actions github-actions Bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Sep 5, 2025
@openhands-ai

openhands-ai Bot commented Sep 5, 2025

Copy link
Copy Markdown

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • ci

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #1488 at branch `improve-tool-format`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

@tusharmath tusharmath enabled auto-merge (squash) September 5, 2025 15:02
@tusharmath tusharmath merged commit 2aecf68 into main Sep 5, 2025
8 checks passed
@tusharmath tusharmath deleted the improve-tool-format branch September 5, 2025 15:06
@tusharmath tusharmath removed the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Sep 5, 2025
laststylebender14 pushed a commit that referenced this pull request Sep 11, 2025
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(agents): Make /tools Command Contextual to Current Agent

1 participant