-
Notifications
You must be signed in to change notification settings - Fork 0
Improvements #25
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
Improvements #25
Conversation
Persists the collapsed/expanded state of tool categories using a dedicated state variable. This change ensures that the tool categories maintain their state across re-renders, providing a better user experience. Also enhances the UI of the tools section.
Adds a 'source' attribute to tool information objects in both the API session routes and core MCP session tests. This provides a way to track the origin of tools.
Improves debug data serialization by truncating long strings early in the serialization process to prevent excessive memory usage and improve performance. This change also ensures that truncation is handled consistently between the backend and frontend, improving the display of debug data in the UI, especially for large responses. Specifically, it adds a recursive string truncation function to avoid JSON serialization errors for very large payloads.
Refactors the debug data serialization and colorization logic to correctly handle nested color metadata. This ensures that color information is accurately propagated and displayed for complex data structures in the debug output. The key path is used to correctly scope the colors in nested structures.
Clarifies the location for tests in the repository's Copilot instructions. Refactors the test case for debug capture to check for color metadata at the data root level with path-based keys instead of at the payload level.
Implements a GitHub Actions workflow that automatically refines issue descriptions using the GitHub Models API. The workflow is triggered by a comment containing '#airefine' from the issue creator. It enhances issue descriptions by adding technical details, context, acceptance criteria, and implementation considerations. It also adds a note to remind contributors to document their work in Confluence. Includes error handling and reactions to indicate progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR bundles multiple enhancements across automation, debugging utilities, UI behavior, and documentation enforcement.
- Adds a GitHub Actions workflow to automatically refine issue descriptions using AI.
- Extends debugging utilities with JSON string truncation and color-metadata serialization.
- Refactors the ChatApp to track collapse/expand state for tool categories and preserve UI state.
- Updates documentation to enforce that tests reside in the
testsfolder.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/issue-ai-refinement.yml | New workflow triggered on #airefine comments to refine issue bodies via AI |
| src/core/debug_capture.py | Adds truncate_json_strings and serialize_with_colors for color-aware JSON output |
| src/ui/chat.ts | Replaces renderTools with updateToolsUI, tracks toolCategoryStates, adds logging |
| src/ui/styles.css | Refines debug-panel and tool-category styling with transitions and hover effects |
| tests/test_debug_capture.py | Adjusts assertions to verify color metadata keys at the correct JSON root level |
| tests/test_core_mcp_session.py | Adds missing source parameter to tool instantiation in tests |
| tests/test_api_session_routes.py | Includes source field in mocked tool info for session routes tests |
| .github/copilot-instructions.md | Updates instructions to require all tests be placed in the tests folder |
Comments suppressed due to low confidence (2)
src/ui/chat.ts:1404
- This template literal contains unescaped double quotes inside backticks, which will cause a syntax error. Escape the inner quotes or use single quotes for the span tags.
return `"<span class="debug-color-white">${this.escapeHtml(mainText)}</span><span class="debug-truncated">...[truncated]</span>"`;
src/ui/chat.ts:1419
- Similar to the previous case, this backtick string uses unescaped double quotes inside. Escape these quotes or switch to single quotes to avoid breaking the code.
return `${indent} "<span class="debug-color-white">${this.escapeHtml(mainText)}</span><span class="debug-truncated">...[truncated]</span>"`;
| } | ||
|
|
||
| private renderTools(): void { | ||
| console.log('renderTools() called'); |
Copilot
AI
Jun 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Multiple console.log statements have been added for debugging. Consider removing or replacing them with a configurable logging utility before merging to avoid unnecessary noise in production.
| return False | ||
|
|
||
| try: | ||
| def truncate_json_strings(obj: Any, max_string_length: int = 100) -> Any: |
Copilot
AI
Jun 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Project guidelines discourage adding docstrings unless absolutely necessary. The function name and type hints are self-explanatory, so remove the docstring to comply with guideline 1000000.
|
|
||
| return obj | ||
|
|
||
| def serialize_with_colors(obj: Any, max_len: int, key_path: str = "") -> tuple[Any, dict]: |
Copilot
AI
Jun 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A docstring was added here but per guideline 1000000, avoid docstrings unless critically needed. The signature and naming already convey purpose.
This pull request introduces several changes across different files to enhance functionality and improve code organization. Key updates include adding a new GitHub Actions workflow for AI-based issue refinement, improving JSON serialization in debugging, and updating the
ChatAppUI logic to better manage tool categories and their states.Workflow Automation:
.github/workflows/issue-ai-refinement.yml: Added a new GitHub Actions workflow to refine issue descriptions using AI. The workflow is triggered by comments containing#airefinefrom the issue creator, and updates the issue with enhanced details, acceptance criteria, and implementation considerations.Debugging Utilities:
src/core/debug_capture.py: Introducedtruncate_json_stringsto truncate long strings in JSON data andserialize_with_colorsto serialize objects with color metadata for debugging. Added recursive handling for lists and dictionaries, improved error handling, and integrated color metadata at the root level.UI Enhancements:
src/ui/chat.ts:toolCategoryStatesto track the collapse state of tool categories.renderToolswithupdateToolsUIto preserve UI state and ensure accurate updates to tool configurations. [1] [2]Documentation:
.github/copilot-instructions.md: Updated instructions to specify that all tests must be placed in thetestsfolder.