Conversation
- Introduced a new endpoint `/commands` to retrieve available Zyra CLI commands and their details. - Implemented the `zyra_cli_manifest` service to handle command listing and details retrieval. - Created multiple system prompts for the Zyra assistant, including `zyra_helper_bot_system.md`, `zyra_tools_system.md`, and `wizard_system.md`, to guide user interactions. - Added a caching mechanism for the command manifest to improve performance. - Updated the server to include the new manifest router and ensure proper API key requirements. - Established guidelines for the assistant's behavior, emphasizing clarity, structure, and educational responses. - Included example commands and fallback handling for unsupported requests. - Enhanced the README documentation for LLM assets and structured the asset directories for better organization.
Add Zyra CLI manifest and assistant prompts
…enAPI schema and GitHub repo access functionality, code review improvements
…y, code review improvements
…er maintainability, code review improvements
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces comprehensive infrastructure for LLM tooling and project workflows, enhancing Zyra's integration capabilities and contributor experience. The changes establish structured templates for issues and pull requests, provide explicit repository guidance, and add extensive LLM integration support.
- Establishes workflow gap tracking with structured issue/PR templates to align development with actual CLI needs
- Adds comprehensive LLM tooling infrastructure including prompts, OpenAPI specs, and Open WebUI tools
- Introduces a new manifest API service enabling dynamic CLI command discovery and examples
Reviewed Changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/snapshots/ | Updates API snapshots to include new /commands endpoint |
| src/zyra/wizard/prompts.py | Refactors system prompt loading to support packaged assets with fallback |
| src/zyra/assets/llm/ | Adds comprehensive LLM assets including prompts and action definitions |
| src/zyra/api/ | Implements new manifest service and router for CLI command discovery |
| pyproject.toml | Version bump to 0.1.23 |
| llm/ | Extensive LLM integration resources including prompts, tools, and OpenAPI specs |
| .github/ | Adds contributor templates, Copilot instructions, and workflow standardization |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| _asset_prompt = _load_system_prompt_from_assets() | ||
| SYSTEM_PROMPT = _asset_prompt if _asset_prompt else _default_system_prompt() |
There was a problem hiding this comment.
The module-level prompt loading executes on every import, potentially causing unnecessary I/O operations. Consider lazy-loading the SYSTEM_PROMPT using a function or property to defer the file system access until actually needed.
| _asset_prompt = _load_system_prompt_from_assets() | |
| SYSTEM_PROMPT = _asset_prompt if _asset_prompt else _default_system_prompt() | |
| _system_prompt_cache: str | None = None | |
| def get_system_prompt() -> str: | |
| global _system_prompt_cache | |
| if _system_prompt_cache is None: | |
| asset_prompt = _load_system_prompt_from_assets() | |
| _system_prompt_cache = asset_prompt if asset_prompt else _default_system_prompt() | |
| return _system_prompt_cache |
| except Exception: | ||
| self.valves = None |
There was a problem hiding this comment.
The broad exception handling in the else clause silently sets valves to None, which could mask configuration issues. Consider logging the exception or catching more specific exceptions like ValidationError to provide better debugging information.
| except Exception: | |
| self.valves = None | |
| except ValidationError as ve: | |
| logging.error(f"Failed to instantiate Valves: {ve}") | |
| self.valves = None | |
| except Exception as e: | |
| logging.error(f"Unexpected error during Valves instantiation: {e}") | |
| self.valves = None |
| # Use injected valves if provided; else seed with schema defaults | ||
| self.valves = valves if valves is not None else self.Valves() # type: ignore[call-arg] |
There was a problem hiding this comment.
This initialization pattern differs from the zyra_cli_manifest tool's more defensive approach with try/except. Consider aligning the error handling strategies between the two tools for consistency, especially since both deal with similar valve initialization.
| # Use injected valves if provided; else seed with schema defaults | |
| self.valves = valves if valves is not None else self.Valves() # type: ignore[call-arg] | |
| # Use injected valves if provided; else seed with schema defaults, with error handling | |
| try: | |
| self.valves = valves if valves is not None else self.Valves() # type: ignore[call-arg] | |
| except Exception as e: | |
| print(f"Error initializing valves: {e}") | |
| self.valves = self.Valves() # fallback to defaults |
This pull request introduces a comprehensive set of improvements focused on project documentation, issue/PR workflow templates, and LLM integration support. The main themes are: establishing structured templates for issues and pull requests, providing explicit repository instructions for contributors and Copilot, and adding resources for LLM tooling and API integrations.
Issue & PR Workflow Standardization
.github/ISSUE_TEMPLATE/to ensure contributors provide clear, actionable information and implementation plans. [1] [2] [3].github/PULL_REQUEST_TEMPLATE.md) with a checklist for code, tests, documentation, and workflow alignment.CONTRIBUTING.mdto document the new workflow gap process and template usage, guiding contributors to link PRs to relevant issues and maintain documentation accuracy.Copilot & Contributor Guidance
.github/copilot-instructions.md) covering project overview, environment setup, build/test/lint steps, CI validation, repo layout, and explicit guidance for Copilot usage.LLM Tooling & API Integration
llm/directory with documentation (llm/README.md) describing its purpose, layout, and conventions for repository-local LLM tools and prompts. [1] [2]llm/actions/cli_manifest/openapi.yaml, [1] browse the repository (llm/actions/github_repo_access/openapi.yaml, [2] [3] and provide sample endpoints (llm/actions/sample/openapi.yaml, [4] [5].Repository Hygiene
.copilotignoreto exclude environment files, secrets, and dependency lockfiles from Copilot indexing.These changes collectively improve contributor experience, project maintainability, and enable advanced LLM-powered workflows.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] llm/actions/cli_manifest/README.md [14] [15]