Skip to content

Docs, tests, bug fixes on <meta>#93

Merged
ultmaster merged 3 commits intomainfrom
meta-tags-docs
Aug 15, 2025
Merged

Docs, tests, bug fixes on <meta>#93
ultmaster merged 3 commits intomainfrom
meta-tags-docs

Conversation

@ultmaster
Copy link
Contributor

@ultmaster ultmaster commented Aug 14, 2025

This pull request introduces comprehensive support for meta elements in POML, particularly focusing on structured response schemas, tool registration, and runtime configuration. It also improves expression evaluation and error handling in both the POML engine and the VSCode extension, and adds detailed documentation for these features. The most important changes are grouped below.

Meta Element and Schema Handling Enhancements:

  • Added a new documentation page (docs/language/meta.md) detailing the usage of the <meta> element for version control, component management, response schemas, tool registration, and runtime parameters. [1] [2]
  • Enhanced the POML engine (PomlFile class) to support:
    • Auto-detection and evaluation of schema expressions in <meta type="responseSchema" lang="expr"> and <meta type="tool" lang="expr"> elements, including template variable interpolation and Zod schema handling. [1] [2] [3]
    • Improved error reporting for missing attributes and invalid schema formats in meta elements.
    • Properly skips rendering for meta elements and integrates meta processing into the main rendering loop. [1] [2]
  • Updated tests to ensure that expression tokens are correctly captured for meta elements with lang="expr".

VSCode Extension Improvements:

  • Added a new section in the VSCode documentation explaining CodeLens-based expression evaluation for template variables, schema expressions, and control flow, including usage instructions and examples.
  • Improved error handling in the test command to provide more specific feedback for missing language model settings (provider, model, API key, endpoint) and to clarify log messages.
  • Adjusted prompt output handling to skip redundant error messages when errors are thrown during prompt execution.

Engine Internals and Expression Handling:

  • Updated the expression tokenization logic to recognize and extract schema expressions in meta elements for better tooling support. [1] [2]

These changes provide a more robust and user-friendly experience for defining, validating, and testing structured prompts and tool integrations in POML documents.

@ultmaster ultmaster marked this pull request as ready for review August 15, 2025 02:00
Copilot AI review requested due to automatic review settings August 15, 2025 02:00
@ultmaster ultmaster linked an issue Aug 15, 2025 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a 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 pull request introduces comprehensive support for meta elements in POML, focusing on structured response schemas, tool registration, and runtime configuration. It also enhances expression evaluation and error handling across the POML engine and VSCode extension, while adding extensive documentation for these features.

  • Added structured meta element handling with support for JSON and expression-based schemas
  • Enhanced expression tokenization and evaluation for meta elements with lang="expr"
  • Improved error handling and validation for OpenAPI schemas and tool configurations

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/poml/util/schema.ts Added validation for OpenAPI schema input to prevent null/non-object values
packages/poml/tests/schema.test.ts Added comprehensive test coverage for schema validation edge cases
packages/poml/tests/file.test.tsx Added extensive tests for meta element expression evaluation and error handling
packages/poml/file.tsx Enhanced meta element processing with expression evaluation and improved error reporting
packages/poml-vscode/command/testCommand.ts Improved error messages for missing language model configuration settings
mkdocs.yml Added navigation entry for new meta documentation
docs/vscode/features.md Added documentation for CodeLens expression evaluation feature
docs/language/meta.md Added comprehensive documentation for meta element usage and configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
}
this.runtimeParameters = runtimeParams;
return true;
Copy link

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

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

The return statement is missing for non-runtime meta types. When metaType is not 'responseSchema', 'tool', or 'runtime', the function should return true to indicate the meta element was handled, but currently falls through without returning.

Copilot uses AI. Check for mistakes.
@ultmaster ultmaster merged commit 7ea26d7 into main Aug 15, 2025
7 checks passed
@ultmaster ultmaster deleted the meta-tags-docs branch August 27, 2025 00:53
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.

VS Code POML extension issues with Local LLM providers

2 participants