Skip to content

IFeedbackProvider can't work against native commands on non-zero exit code #18852

Open

Description

Summary of the new feature / enhancement

The current design of IFeedbackProvider only works against an ErrorRecord. Unless $PSNativeCommandUseErrorActionPreference is $true, no ErrorRecord is created if a native command exists with a non-zero exit code. For example, I can't build a feedback provider for the git command.

Proposed technical implementation details (optional)

Perhaps FeedbackProviders should be registered with a Kind specifying when it should be enacted? I don't know if there will be other cases other than ErrorRecord and non-zero exit code.

cc Dongbo Wang (@daxian-dbw)

Activity

  1. SteveL-MSFT commented on Dec 27, 2022

    @SteveL-MSFT
    MemberAuthor

    Another use case would be for codex, copilot, chatgpt, etc.. integration where I can type a comment:

    # get process using the most cpu

    and after hitting enter, it could call a feedback provider that can generate a prediction based on the result of the AI result.
    In this case, it's not any error condition. I don't think we want to invoke FeedbackProviders on every successful call, so maybe just special case comments?

  2. SteveL-MSFT commented on Dec 28, 2022

    @SteveL-MSFT
    MemberAuthor

    We need to solve the problem of being able to get native command output when standalone to make some of this work. In the git case, need the stderr output to help build the suggestion.

    It may also make sense to have FeedbackProviders register for specific types of events so they aren't called and each needs to check if they should do processing.

  3. daxian-dbw commented on Jan 4, 2023

    @daxian-dbw
    Member

    For the use case for codex, copilot, chatgpt and etc., comparing with typing a comment and then hitting enter to trigger, I think the user experience will be much better with hitting a PSReadLine key-binding to trigger (basically, having all handled within the PSReadLine). We can easily do more within PSReadLine, such as having a spinning sign indicating it's thinking.

    Also, hitting enter to trigger means it has to jump multiple loops, likely "host -> feedback provider -> PSReadLine -> predictor -> PSReadLine". This workflow is fine if the predictor can get more information from the feedback provider, such as the error messages (and the stderr message from native command in future), but for this particular use case, feedback provider doesn't offer additional information -- the comment is already available within PSReadLine.

  4. moved this from Needed by 7.4 GA to Investigation Tasks in Feedback Provider Roadmapon May 23, 2023
  5. microsoft-github-policy-service commented on Nov 15, 2023

    @microsoft-github-policy-service
  6. microsoft-github-policy-service commented on Nov 15, 2023

    @microsoft-github-policy-service
  7. microsoft-github-policy-service commented on Nov 15, 2023

    @microsoft-github-policy-service
  8. microsoft-github-policy-service commented on Nov 22, 2023

    @microsoft-github-policy-service
  9. added
    KeepOpenThe bot will ignore these and not auto-close
    and removed
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    Resolution-No ActivityIssue has had no activity for 6 months or more
    on Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-Enhancementthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeWG-Enginecore PowerShell engine, interpreter, and runtime

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions