Skip to content

Conversation

@daniel-richter
Copy link
Contributor

@daniel-richter daniel-richter commented Oct 22, 2025

Context:

  • Model metadata footer always shown #63
    If I set in the "calling" action file show-model-metadata-footer to false, the model metadata will still be shown.
    Reason: z.coerce.boolean() treats the string 'false' as truthy value.

Solution:

https://zod.dev/api?id=stringbool
In some cases (e.g. parsing environment variables) it's valuable to parse certain string "boolish" values to a plain boolean value. To support this, Zod 4 introduces z.stringbool()

// these are the defaults
z.stringbool({
  truthy: ["true", "1", "yes", "on", "y", "enabled"],
  falsy: ["false", "0", "no", "off", "n", "disabled"],
});

This change removes unnecessary string coercion from input parsing throughout the configuration system and adds a new environment variable placeholder for controlling model metadata display in footers.

Walkthrough

  • Refactor: Simplified input parsing by removing redundant z.coerce.string() calls and replacing them with direct z.string() validation, improving type safety and clarity
  • Refactor: Updated boolean input parsing to use z.stringbool() instead of z.coerce.boolean() for the model metadata footer display setting
  • Chore: Added environment variable placeholder INPUT_SHOW_MODEL_METADATA_FOOTER to support configuration of model metadata visibility in PR summaries

Model: anthropic--claude-4-sonnet | Prompt Tokens: 1608 | Completion Tokens: 157

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for sharing your code. Here is some supportive feedback powered by AI. These suggestions are ideas, not guarantees. Choose what works for you and trust your judgment as AI stands by to assist.
Model: o4-mini | Prompt Tokens: 4055 | Completion Tokens: 5925

@github-actions
Copy link

This change introduces a new environment flag to control model metadata in summaries and streamlines input validation by replacing coercions with stricter Zod types, improving consistency without altering end-user functionality.

Walkthrough

  • New Feature: Exposed INPUT_SHOW_MODEL_METADATA_FOOTER to toggle model metadata in the PR summary footer.
  • Refactor: Switched from z.coerce.* to z.string() (and stringbool() for booleans) across config inputs for clearer type enforcement.
  • Chore: Minor cleanup of parsing calls, removing unnecessary coercion steps.

Model: o4-mini | Prompt Tokens: 1303 | Completion Tokens: 464

@daniel-richter daniel-richter marked this pull request as ready for review October 22, 2025 15:34
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Here's a supportive code review enhanced by AI assistance. These suggestions offer potential improvements, though they're recommendations rather than requirements. You have complete control over which insights to implement—AI simply provides additional perspective to help inform your decisions. Use what feels valuable and fits your project's needs.
Model: anthropic--claude-4-sonnet | Prompt Tokens: 2411 | Completion Tokens: 516

@daniel-richter daniel-richter merged commit 0656652 into main Oct 22, 2025
15 checks passed
@daniel-richter daniel-richter deleted the fix/stringbool branch October 22, 2025 15:46
github-actions bot pushed a commit that referenced this pull request Oct 22, 2025
* Change showModelMetadataFooter input type from boolean to stringbool

* Refactor input parsing to use z.string() instead of z.coerce.string()

* add INPUT_SHOW_MODEL_METADATA_FOOTER
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.

2 participants