Skip to content

feat(copilot): add initial prompt support via -i flag#1387

Merged
arnestrickmann merged 1 commit intogeneralaction:mainfrom
naaa760:feat/allw-init-prmpt-github-cli
Mar 10, 2026
Merged

feat(copilot): add initial prompt support via -i flag#1387
arnestrickmann merged 1 commit intogeneralaction:mainfrom
naaa760:feat/allw-init-prmpt-github-cli

Conversation

@naaa760
Copy link
Contributor

@naaa760 naaa760 commented Mar 10, 2026

summary

  • Enable GitHub Copilot CLI tasks to use the initial prompt field by wiring the -i flag through the provider config and PTY startup.

Fixes

fix : #1385

Snapshot

N/A

Type of change

[x] New feature (non-breaking change which adds functionality)

Mandatory Tasks

  • I have self-reviewed the code

Checklist

[x] I have read the contributing guide
[x] My code follows the style guidelines of this project (pnpm run format)
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have checked if my PR needs changes to the documentation
[x] I have checked if my changes generate no new warnings (pnpm run lint)
[x] I have added tests that prove my fix is effective or that my feature works

@vercel
Copy link

vercel bot commented Mar 10, 2026

@naaa760 is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 10, 2026

Greptile Summary

This PR adds a single-line change to src/shared/providers/registry.ts, setting initialPromptFlag: '-i' on the GitHub Copilot provider definition. This wires the Copilot CLI into the existing initialPromptFlag mechanism so that when a user supplies an initial prompt, the application will pass -i <prompt> to the copilot binary at startup — matching the pattern already used by Gemini and Qwen.

Key observations:

  • The change is minimal and follows the established pattern across other providers.
  • buildProviderCliArgs in ptyManager.ts already handles this field correctly; no logic changes are needed.
  • The PR checklist claims new tests were added, but no test files are included in the diff — a test covering the copilot initialPromptFlag resolution and the resulting CLI args would be valuable.
  • The correctness of -i as the Copilot CLI flag is not verified by documentation reference or tests in this PR.

Confidence Score: 4/5

  • Safe to merge with minor concern — the change is a one-liner that follows existing patterns and carries low regression risk.
  • The change is a single additive field in a provider registry that slots into a well-tested infrastructure path (buildProviderCliArgs). The main gap is the absence of a dedicated test for this provider+flag combination despite the checklist claiming otherwise, and no documentation reference confirming -i is the correct Copilot CLI flag.
  • No files require special attention beyond verifying the -i flag against the @github/copilot CLI docs.

Important Files Changed

Filename Overview
src/shared/providers/registry.ts Adds initialPromptFlag: '-i' to the GitHub Copilot provider definition, wiring initial-prompt CLI arg support. Change is minimal and follows the same pattern as Gemini/Qwen, but no tests were added and the correctness of -i as the Copilot CLI flag is unverified in this diff.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[registry.ts\ncopilot provider\ninitialPromptFlag: '-i'] --> B[resolveProviderCommandConfig]
    B --> C{customConfig\ninitialPromptFlag set?}
    C -- Yes --> D[Use custom flag]
    C -- No --> E[Use provider.initialPromptFlag\n= '-i']
    D --> F[buildProviderCliArgs]
    E --> F
    F --> G{initialPromptFlag !== undefined\n&& !useKeystrokeInjection\n&& initialPrompt.trim?}
    G -- No --> H[Skip initial prompt arg]
    G -- Yes --> I{initialPromptFlag truthy?}
    I -- Yes --> J[push '-i' to args]
    I -- No --> K[Skip flag, push prompt only]
    J --> L[push prompt text to args]
    K --> L
    L --> M[PTY spawns: copilot --allow-all-tools -i 'prompt text']
Loading

Last reviewed commit: 2a91c8d

versionArgs: ['--version'],
cli: 'copilot',
autoApproveFlag: '--allow-all-tools',
initialPromptFlag: '-i',
Copy link
Contributor

Choose a reason for hiding this comment

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

No tests added for the new flag

The PR checklist marks "I have added tests that prove my fix is effective or that my feature works" as checked, but the diff only touches registry.ts — no new tests were added. Other providers have snapshot/unit coverage for their initialPromptFlag values via buildProviderCliArgs (e.g., the existing tests in src/test/main/ptyManager.test.ts). A test confirming that the copilot provider resolves to initialPromptFlag: '-i' and that the resulting CLI args include -i <prompt> would prevent regressions and make the intent explicit.

@arnestrickmann arnestrickmann merged commit 616b222 into generalaction:main Mar 10, 2026
3 of 4 checks passed
@bamiebot-maker
Copy link

please do you have any idea of platform where i can take issues and solve for a fee?

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.

[feat]: allow using initial prompts for Github Copilit CLI

3 participants