Skip to content

terminal: track activation outcomes and confirmed state - #1823

Open
Eleanor Boyd (eleanorjboyd) wants to merge 1 commit into
microsoft:mainfrom
eleanorjboyd:agents/python-envs-telemetry-feedback
Open

Eleanor Boyd (eleanorjboyd) wants to merge 1 commit into
microsoft:mainfrom
eleanorjboyd:agents/python-envs-telemetry-feedback

Conversation

@eleanorjboyd

@eleanorjboyd Eleanor Boyd (eleanorjboyd) commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Track terminal activation and deactivation attempts with bounded outcome telemetry (operation, outcome, execution method, shell, trigger, and duration), without paths or command text.
  • Only update shell-integration activation state after a matching completion with exit code 0; distinguish nonzero exit, missing exit code, execution errors, and timeouts. Preserve existing optimistic UI behavior for legacy sendText, reporting it as unverified.
  • Add unit coverage for success, failure, unknown, timeout/late completion, unverified legacy execution, and environment switching after failed deactivation.

Closes #1822.

Distinguish shell command success, failure, timeout and unknown completion before updating activation state. Record bounded telemetry for both shell integration and unverified sendText attempts, with regression coverage for deactivation and environment switching.\n\nCo-authored-by: Copilot <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

🔵 Needs a closer look

Telemetry failures can mask successful commands and prevent state updates.

Review effort: Lite
Findings: None

What changed in this PR

Adds terminal activation outcome tracking, confirmed state updates, bounded telemetry, and unit coverage.

Changes:

  • Tracks success, failure, timeout, unknown, and legacy unverified outcomes.
  • Adds trigger and execution telemetry.
  • Expands activation state and environment-switching tests.
File Summary
src/​test/​features/​terminal/​terminalActivationState.unit.test.ts Tests outcome and state-transition scenarios.
src/​features/​terminal/​terminalManager.ts Supplies activation triggers.
src/​features/​terminal/​terminalActivationState.ts Tracks outcomes and confirmed activation state.
src/​common/​telemetry/​constants.ts Defines telemetry event properties and classifications.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Eleanor Boyd (eleanorjboyd) added a commit that referenced this pull request Sep 25, 2026
## Summary
- Return `off` when the legacy `python.terminal.activateEnvironment`
setting is false, without writing a persistent
`python-envs.terminal.autoActivationType` override from a getter.
- Preserve precedence for an explicitly set Python Environments
activation mode.
- Cover false-to-true legacy setting changes and verify lookup never
calls configuration update.

The setting is machine-scoped, so the previous implicit workspace-target
write likely failed rather than persisting for users; this still removes
an unnecessary, unawaited write attempt. This PR is independent of #1823
and contains only the getter and related tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Code quality issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track actual terminal activation outcomes instead of assuming success

3 participants