Skip to content

fix: entity generation fails with comma in parentheses (#2063)#3032

Open
xingzihai wants to merge 1 commit intoSeaQL:masterfrom
xingzihai:fix-entity-gen-comma-parsing
Open

fix: entity generation fails with comma in parentheses (#2063)#3032
xingzihai wants to merge 1 commit intoSeaQL:masterfrom
xingzihai:fix-entity-gen-comma-parsing

Conversation

@xingzihai
Copy link
Copy Markdown

Fixes #2063

Entity generation was failing when parentheses contained commas. This PR adds bracket-aware splitting to correctly parse such cases.

When model-extra-attributes contains a comma inside parentheses,
entity generation fails because clap splits by comma without
respecting parentheses nesting. For example:
  --model-extra-attributes 'test(a, b)'
gets incorrectly split into ['test(a', ' b)'].

The fix:
- Remove value_delimiter from CLI arguments for extra derives/attributes
- Add split_by_comma_ignoring_parentheses() helper function
- Process values in run_generate_command with parentheses-aware splitting

This allows users to pass attributes like:
  --model-extra-attributes 'cfg_attr(debug_assertions, derive(Debug))'

Signed-off-by: OpenClaw Agent <agent@openclaw.dev>
@Huliiiiii
Copy link
Copy Markdown
Member

Would it be possible to use syn to simplify the parsing?

@Huliiiiii Huliiiiii requested a review from tyt2y3 April 1, 2026 20:51
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.

Entity generation fails if model-extra-attributes include a comma surrounded by parentheses

2 participants