Repository navigation
fix(integrations): pass the Junie dispatch prompt via --task - #5065
Merged
Merged
Conversation
JunieIntegration inherited MarkdownIntegration.build_exec_args(), which passes the prompt as -p <prompt>. Junie's -p is the short form of --project <path>, so every dispatch, including the built-in workflow command and prompt steps in text mode, asked Junie to run in a project directory named after the prompt and gave it no task. Junie takes a non-interactive task as a positional argument or --task. Override build_exec_args() to pass the prompt with --task. The base requires_cli guard and argument order (EXTRA_ARGS before --model) are unchanged, and --model and --output-format json are flags Junie documents. docs/integrations/junie.md named -p and now names --task. Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused Junie-only correction preserves the existing dispatch contract, includes regression coverage, and has no unresolved findings.
No open issues 🎉
What changed in this PR
Corrects Junie’s non-interactive dispatch so prompts are treated as tasks rather than project directories, addressing part of the CLI dispatch audit in #2416.
Changes:
- Adds a Junie-specific
build_exec_args()override using--task, preserving existing runtime validation and other options. - Adds four regression tests covering prompt forwarding, JSON output, model selection, and extra arguments.
- Updates the Junie integration guide to show the corrected invocation.
Validation relies on the PR’s reported before-and-after results; tests were not rerun here.
| File | Description |
|---|---|
tests/integrations/test_integration_junie.py |
Adds regression coverage for Junie dispatch arguments. |
src/specify_cli/integrations/junie/__init__.py |
Passes non-interactive prompts through --task. |
docs/integrations/junie.md |
Documents the corrected task flag. |
Review effort: Max
Collaborator
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
JunieIntegrationdoes not overridebuild_exec_args(), so it inheritsMarkdownIntegration.build_exec_args()(base.py#L1151-L1170), which passes the prompt as-p <prompt>.In Junie CLI,
-pis the short form of--project, the directory Junie runs in. A non-interactive task is given as a positional argument or with--task. Fromjunie --help(@jetbrains/junie@3110.7.0, the npm package the JetBrains/junie README installs):The same is in Junie's CLI reference and in the Junie skill JetBrains ships in its own repository: "
-pis--project. Non-interactive is simply the positional task." (hermes-plugin/skills/junie/SKILL.md#L93).Run inside a project created with
specify init --integration junie, withHOMEpointing at an empty directory (not logged in, no API key):The
-pform fails before Junie looks for credentials, so this reproduces without an account. The--taskform gets past option parsing and project resolution and stops only because thisHOMEhas no authorization (Junie reports that with exit 0).The same failure through Spec Kit on
main(dc2cec4), with thatjunieonPATH, run from the project directory:On this branch the same call reaches Junie's authorization check: exit code 0, and stdout is the
{"errors":["Cannot find authorization. ..."]}object above.Reachability. Unlike the Kimi Code (#5031) and Pi (#5043) fixes, which only affected structured output,
-pis passed in every mode, so the built-in workflows hit it. Thecommandstep dispatches throughdispatch_command()(step/command/__init__.py#L333-L342), and thepromptstep builds its argv withbuild_exec_args(..., output_json=False)(step/prompt/__init__.py#L248-L253); both use the inherited argv. Running the bundled workflow in the same project with a stand-injunieonPATHthat only records its argv and exits 1:On this branch the same run records
argv: [--task] [/speckit-specify build a login page], which is the form Junie accepts above.Not shown here, because it needs a logged-in Junie: whether a custom command passed as a non-interactive task is expanded from
.junie/commands/. That also depends on #4794 (open), which reports that$ARGUMENTSin the installed commands keeps Junie from running them; this PR does not touch command content.Fix. Override
build_exec_args()inJunieIntegrationto pass the prompt with--task.--taskis used rather than a bare positional so the argv keeps the base shape, with the prompt right after its flag. The rest matches the base implementation: therequires_cliguard,SPECKIT_INTEGRATION_JUNIE_EXTRA_ARGSbefore--model,--model, and--output-format json. The full argv this branch builds,junie --task "/speckit-plan x" --skip-update-check --model sonnet --output-format json(with--skip-update-checkfrom the extra-args variable), also gets to the authorization check above. The change stays inside the Junie integration package, its test file, and its agent pagedocs/integrations/junie.md#L32-L33, which namedjunie -p <prompt>. The new method sits at the end of the class, away from the lines the open Junie PRs (#4795, #4796, #4883, #4983) change.Part of #2416, which lists Junie's inherited
junie -p "prompt" --model X --output-format jsonargv as unverified. Same shape as #5031 and #5043.Testing
Tested locally with
uv run specify --helpRan existing tests with
uv sync && uv run pytest: run as.venv/bin/python -m pytest, results belowTested with a sample project (if applicable): the
specify init --integration junieproject above, withjunie26.9.7 (3110.7) and with the argv-recording stand-intests/integrations/test_integration_junie.pygets four argv tests: text mode,--output-format json,--model, andSPECKIT_INTEGRATION_JUNIE_EXTRA_ARGS. Run againstmain, all four fail with'-p' != '--task'. All four pass on this branch, and the file passes as a whole (37 tests)..venv/bin/python -m pytest tests/integrations tests/workflows tests/test_agent_config_consistency.py -q: 3660 passed, 8 skipped.uvx ruff@0.15.0 check src tests: all checks passed.markdownlint-cli20.23.2 (the version the lint workflow's action pins) ondocs/integrations/junie.md: 0 issues.Full suite,
.venv/bin/python -m pytest tests -q(macOS, Python 3.14.3): 12696 passed, 434 skipped, 15 failed. All 15 are in 6 files this PR does not touch, and running those files against unmodifiedmainon the same machine fails the same 15 test IDs. 11 are composed-template cases intest_*_python_parity.py, whose bash variant runspython3fromPATH, and that interpreter has no PyYAML on this machine; they pass with the venv'spython3first onPATH. The other 4 are intest_workflow_step_submission.py, where the fakecurlgets a#!<sys.executable>shebang and the interpreter path on this machine contains a space.AI Disclosure
AI disclosure: Claude Code opened this PR on behalf of @RaycarlLei. Claude Code (model: Claude Opus 5.5, reasoning effort xhigh, autonomous agent mode with tool approvals bypassed) read Junie's documentation and JetBrains' Junie repository, installed
@jetbrains/junie@3110.7.0and ran it without logging in to reproduce the bug, reproduced the workflow argv with a stand-injunie, wrote the override, the four tests and thedocs/integrations/junie.mdupdate, ran the checks above, wrote this description, and pushed the branch. A read-only Claude Code subagent on the same model cross-checked the links, the reachability claims and the diff, and its corrections were applied. @RaycarlLei approved posting; he did not review the diff line by line, re-run the tests, or edit this description. The commit carriesAssisted-by: Claude Code (model: Claude Opus 5.5, autonomous).🤖 Generated with Claude Code