Skip to content

fix(junie): stop $ARGUMENTS/$speckit-... becoming required Junie arguments - #4796

Open
chelsealong wants to merge 3 commits into
github:mainfrom
chelsealong:fix/junie-argument-placeholders
Open

chelsealong wants to merge 3 commits into
github:mainfrom
chelsealong:fix/junie-argument-placeholders

Conversation

@chelsealong

Copy link
Copy Markdown
Contributor

Fixes #4794

Junie treats every $identifier in a command body as a required named argument. The installed commands contained $ARGUMENTS and the prose $speckit-..., so Junie silently refused to run them.

Junie's post_process_command_content now:

  • rewrites $ARGUMENTS to Junie's free-text $prompt, and adds allowPromptArgument: true to the frontmatter (per the Junie custom-slash-commands docs);
  • drops the or \$speckit-...`` aside.

Tests: test_junie_argument_placeholders_adapted and test_junie_setup_leaves_no_stray_dollar_arguments. They fail without the fix (2 failed, 32 passed on the junie test file with the source reverted). With the fix, pytest tests/integrations gives 2677 passed, 5 skipped.

AI disclosure: this change was written with Claude Code (AI-assisted).

@chelsealong
chelsealong requested a review from mnriem as a code owner September 30, 2026 07:56
@mnriem mnriem added the triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review label Sep 30, 2026
@mnriem
mnriem requested a balanced review from Copilot September 30, 2026 13:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Existing or incidental allowPromptArgument: text can prevent the required frontmatter setting from being enabled.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adapts generated Junie commands to accept free-text arguments correctly.

Changes:

  • Rewrites $ARGUMENTS to $prompt and removes misleading $speckit-... prose.
  • Adds regression and generated-command coverage.
File Description
src/​specify_cli/​integrations/​junie/​__init__.py Adds Junie-specific argument adaptation.
tests/​integrations/​test_integration_junie.py Tests placeholder rewriting and generated commands.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/specify_cli/integrations/junie/__init__.py Outdated
@chelsealong

Copy link
Copy Markdown
Contributor Author

Fixed in the latest commit (AI-assisted, Claude Code): _adapt_argument_placeholders now only inspects the frontmatter block and sets allowPromptArgument to true (replacing an existing value such as false, or inserting it), so body text can no longer suppress it. Added test_junie_allow_prompt_argument_false_is_enabled (fails on the previous code; tests/integrations: 2678 passed, 5 skipped).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused implementation addresses both reported blockers with positive and regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@mnriem

mnriem commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Please fix test & lint errors

@chelsealong

Copy link
Copy Markdown
Contributor Author

AI-assisted (Claude Code): I couldn't reproduce a test or lint failure on the current head. ruff@0.15.0 check src tests passes, pytest tests/integrations gives 2678 passed, 5 skipped, and the rest of tests gives 6321 passed, 10 skipped (Linux, Python 3.x). The only red check is pytest (macos-latest, 3.13), and its log isn't readable from the fork. If a maintainer can paste the failing test name or traceback, I'll fix it. I've made no code changes.

@chelsealong

Copy link
Copy Markdown
Contributor Author

AI-assisted (Claude Code): the macOS log is readable now. The single failure is tests/specify_cli/workflows/test_catalog_versions.py::test_exact_add_uses_historical_url_digest_and_requirements (workflow catalog digest check, exit code 1). It's in code this PR doesn't touch (the PR only changes the Junie integration and its test file), and the other 9187 tests pass, including all Junie tests. I made no code changes; a re-run of that job should show whether it's environment-specific.

Pin the workflow ZIP member timestamp so independently generated catalog and download fixtures remain byte-identical across DOS timestamp boundaries. Add a regression using controlled wall-clock values two seconds apart; it fails with the original helper and passes with the fixed timestamp. Production integrity checks and existing negative tests are unchanged.

Validation: targeted workflow catalog and Junie tests: 78 passed; Ruff: passed. Full pytest collection: 9014 before, 9015 after.

Assisted-by: GitHub Copilot (model: GPT-6.1 Sol, autonomous)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The unrelated workflow archive changes violate repository scope discipline and should be split out.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment on lines +53 to +56
archive.writestr(
zipfile.ZipInfo("workflow.yml", date_time=(2020, 1, 1, 0, 0, 0)),
yaml.safe_dump(document),
)

This branch has not been deployed

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

Labels

triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Junie integration: generated commands are unusable because of $ARGUMENTS/$speckit-... auto-detected as required arguments

3 participants