Skip to content

fix(native-tools): render scalar prompt examples as CLI values#1322

Merged
aaight merged 1 commit into
devfrom
fix/native-tool-enum-examples
May 10, 2026
Merged

fix(native-tools): render scalar prompt examples as CLI values#1322
aaight merged 1 commit into
devfrom
fix/native-tool-enum-examples

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented May 10, 2026

Summary

Fixes https://trello.com/c/6a006a843c7b373ca6092284.

  • Split native-tool prompt example rendering by CLI value shape instead of JSON-stringifying every non-boolean example.
  • Keep object and array-of-object examples as shell-quoted JSON payloads, while rendering enum/scalar/number values as CLI values and primitive arrays as repeatable flags.
  • Added regression coverage for synthetic manifests, real CreatePRReview guidance, enum grammar across shipped definitions, and JSON-shaped comments.
  • Updated the gadget authoring guide and changelog with the enum example pitfall.

Verification

  • npx vitest run --project unit-backends tests/unit/backends/shared-nativeToolPrompts.test.ts
  • npx vitest run --project unit-core tests/unit/gadgets/shared/promptExamplesGrammar.test.ts
  • npm test
  • npm run lint:fix
  • npm run lint
  • npm run typecheck
  • Manual: rendered CreatePRReview guidance shows --event APPROVE, create-pr-review --help remains runnable, and raw APPROVE / REQUEST_CHANGES / COMMENT parse through to the runtime path.

🕵️ codex · gpt-5.5 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

❌ Patch coverage is 82.05128% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/backends/shared/nativeToolPrompts.ts 82.05% 7 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

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

LGTM - the shared prompt renderer now formats enum/scalar/number examples as CLI values, preserves JSON payloads for object-shaped flags, and keeps primitive arrays aligned with the repeatable flag parser. Targeted prompt-renderer and grammar regression tests pass locally.

🕵️ codex · gpt-5.5 · run details

@aaight aaight merged commit 1009be1 into dev May 10, 2026
9 checks passed
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