Skip to content

Auto-wrap missing Jinja expressions and require non-empty action_id for action nodes#351

Open
zhongkaifu wants to merge 2 commits into
mainfrom
codex/update-code-to-wrap-missing-jinja-expressions
Open

Auto-wrap missing Jinja expressions and require non-empty action_id for action nodes#351
zhongkaifu wants to merge 2 commits into
mainfrom
codex/update-code-to-wrap-missing-jinja-expressions

Conversation

@zhongkaifu
Copy link
Copy Markdown
Owner

Motivation

  • Avoid Jinja parse/runtime errors caused by param strings that look like Jinja variable access but are missing {{ }} wrapping.
  • Reduce false positives by performing a compile-time check before auto-wrapping suspected expressions.
  • Ensure workflow correctness by enforcing that nodes of type action always provide a non-empty action_id so they can be executed.

Description

  • Added POTENTIAL_JINJA_EXPR, looks_like_missing_jinja and has_unwrapped_variable helpers to velvetflow/jinja_utils.py, where has_unwrapped_variable now uses get_jinja_env().compile_expression to verify candidates.
  • Updated velvetflow/verification/jinja_validation.py to use has_unwrapped_variable in _normalize_jinja_expr so unwrapped but valid expressions are auto-wrapped as {{ ... }}.
  • Added a validation rule in velvetflow/verification/node_rules.py that emits a MISSING_REQUIRED_PARAM ValidationError for action nodes missing or having an empty action_id, with messaging that directs the error context to be analyzed/handled by an LLM and repair tools.

Testing

  • No automated tests were executed for these changes.
  • Changes were committed locally and prepared for PR, but the test suite and CI were not run as part of this rollout.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant