Skip to content

Fix script terminal commands returning errors after dispatch - #1737

Merged
Stella Huang (StellaHuang95) merged 1 commit into
microsoft:mainfrom
StellaHuang95:copilot/pep723-terminal-return
Aug 26, 2026
Merged

Fix script terminal commands returning errors after dispatch#1737
Stella Huang (StellaHuang95) merged 1 commit into
microsoft:mainfrom
StellaHuang95:copilot/pep723-terminal-return

Conversation

@StellaHuang95

Copy link
Copy Markdown
Contributor

Context

The existing normal and dedicated script-terminal command handlers dispatch the script successfully, then fall through to the invalid-context error because the successful branches do not return.

This affects any caller using these existing commands; it is not specific to PEP 723.

Why this change is needed

A script can start running while the command promise rejects, causing callers to report failure after successful dispatch. The false error also makes command completion inconsistent with the underlying terminal operation.

What changed

  • Return after successful normal terminal dispatch.
  • Return after successful dedicated terminal dispatch.
  • Preserve invalid-context errors for non-URI inputs and URI inputs without a project or environment.

Behavior and compatibility

  • No command, menu, setting, view, or status-bar contribution is added.
  • Environment resolution and fallback are unchanged.
  • Terminal selection/reuse, cwd, arguments, visibility, and activation behavior are unchanged.
  • The only success-path difference is that the command now resolves instead of throwing after dispatch.

Reviewer guide

  1. Review the two production return statements.
  2. Review success coverage for resolved and fallback environments.
  3. Review invalid and missing-context regressions.

Validation

  • npm run compile-tests --silent
  • Targeted command and terminal manager suites: 33 passing
  • ESLint on changed TypeScript files
  • git diff --check

@StellaHuang95 Stella Huang (StellaHuang95) added the feature-request Request for new features or functionality label Aug 25, 2026
@heejaechang

Heejae Chang (heejaechang) commented Aug 25, 2026

Copy link
Copy Markdown

🔒 Automated review in progress — Heejae Chang (@heejaechang) is auto-reviewing this PR.

@heejaechang

Copy link
Copy Markdown

Verification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved via Review Center.

@heejaechang Heejae Chang (heejaechang) added the review-auto:approved Automated review: no blocking findings (approval posted). label Aug 25, 2026
@StellaHuang95
Stella Huang (StellaHuang95) force-pushed the copilot/pep723-terminal-return branch 3 times, most recently from 8906be5 to af6bd61 Compare August 26, 2026 18:38
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@StellaHuang95
Stella Huang (StellaHuang95) merged commit 3d63516 into microsoft:main Aug 26, 2026
44 checks passed
@StellaHuang95
Stella Huang (StellaHuang95) deleted the copilot/pep723-terminal-return branch August 26, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request Request for new features or functionality review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants