Skip to content

Add telemetry for wta#89

Open
PankajBhojwani wants to merge 2 commits into
mainfrom
pabhojwa/intelligent/wta_telemetry
Open

Add telemetry for wta#89
PankajBhojwani wants to merge 2 commits into
mainfrom
pabhojwa/intelligent/wta_telemetry

Conversation

@PankajBhojwani

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Adds 4 more events to the telemetry we emit:

  • AgentPromptSent
  • AgentResponseReceived
  • AgentResponseAction
  • ErrorFixResolved

Implementation has been based off the implementation of telemetry events in the microsoft/sudo repo, since that also uses Rust and ships with Windows.

PR Checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
    • If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated (if necessary)

Copilot AI review requested due to automatic review settings May 27, 2026 23:39

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.

Pull request overview

Adds ETW-based telemetry instrumentation to the WTA (Windows Terminal Agent) Rust tool, emitting new events around agent prompt/response lifecycle and autofix outcomes, with build-time provider-group GUID injection for internal builds.

Changes:

  • Introduces an ETW provider template + thin wrapper module for emitting WTA telemetry events.
  • Emits new telemetry at key ACP client and UI action points (prompt sent, response received, response action executed, autofix resolution).
  • Adds build-script logic to generate the provider source with optional provider-group GUID injection, plus new win_etw_* dependencies.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/wta/src/telemetry.rs Adds convenience wrappers around the generated ETW provider and tracks current agent id.
tools/wta/src/telemetry_template.rs Defines the ETW provider + event schema used to generate the concrete provider at build time.
tools/wta/src/protocol/acp/client.rs Wires telemetry into ACP prompt dispatch/completion and sets agent identity for events.
tools/wta/src/main.rs Initializes telemetry during the main TUI entrypoints.
tools/wta/src/app.rs Emits telemetry for autofix resolution and executing recommended actions.
tools/wta/Cargo.toml Adds win_etw_macros and win_etw_provider dependencies.
tools/wta/Cargo.lock Locks newly introduced transitive dependencies for ETW support.
tools/wta/build.rs Generates telemetry_generated.rs and injects provider-group GUID when configured.

Comment thread tools/wta/src/protocol/acp/client.rs
Comment thread tools/wta/build.rs Outdated
Comment thread tools/wta/Cargo.toml
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
tracing-appender = "0.2"
which = "7"
win_etw_macros = "0.1.8"
Comment thread tools/wta/Cargo.toml
tracing-appender = "0.2"
which = "7"
win_etw_macros = "0.1.8"
win_etw_provider = "0.1.8"
// and use `keyword = 0x0` (OSS placeholder — internal builds override via
// the crate feature / build-system injection).

use win_etw_macros::trace_logging_provider;
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

@check-spelling-bot Report

⚠️ Dictionary not found

Problems were encountered retrieving check dictionaries (cspell:svelte/dict/svelte.txt cspell:scala/dict/scala.txt cspell:css/dict/css.txt cspell:cpp/src/compiler-clang-attributes.txt cspell:lua/dict/lua.txt cspell:java/src/java-terms.txt cspell:cpp/src/compiler-gcc.txt cspell:golang/dict/go.txt cspell:gaming-terms/dict/gaming-terms.txt cspell:cpp/src/ecosystem.txt cspell:docker/src/docker-words.txt cspell:cpp/src/stdlib-cpp.txt cspell:cpp/src/template-strings.txt cspell:node/dict/node.txt cspell:python/src/common/extra.txt cspell:sql/src/tsql.txt cspell:typescript/dict/typescript.txt cspell:django/dict/django.txt cspell:ruby/dict/ruby.txt cspell:latex/dict/latex.txt cspell:fullstack/dict/fullstack.txt cspell:cpp/src/lang-jargon.txt cspell:public-licenses/src/generated/public-licenses.txt cspell:k8s/dict/k8s.txt cspell:r/src/r.txt cspell:python/src/python/python.txt cspell:python/src/python/python-lib.txt cspell:software-terms/dict/webServices.txt cspell:php/dict/php.txt cspell:public-licenses/src/additional-licenses.txt cspell:sql/src/sql.txt cspell:cpp/src/lang-keywords.txt cspell:html/dict/html.txt cspell:rust/dict/rust.txt cspell:cpp/src/people.txt cspell:haskell/dict/haskell.txt cspell:swift/src/swift.txt cspell:ada/dict/ada.txt cspell:python/src/additional_words.txt cspell:elixir/dict/elixir.txt cspell:clojure/src/clojure.txt cspell:cpp/src/stdlib-cmath.txt cspell:cpp/src/stdlib-cerrno.txt cspell:cpp/src/compiler-msvc.txt cspell:shell/dict/shell-all-words.txt cspell:software-terms/dict/softwareTerms.txt cspell:redis/dict/redis.txt cspell:java/src/java.txt cspell:npm/dict/npm.txt cspell:monkeyc/src/monkeyc_keywords.txt cspell:powershell/dict/powershell.txt cspell:cpp/src/stdlib-c.txt cspell:dart/src/dart.txt cspell:dotnet/dict/dotnet.txt).

⚠️ For more information, see check-dictionary-not-found.

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (127)
adbea
agentic
aiagents
alacritty
arget
asid
askuser
azmcp
bestpractices
caac
CACHEDIR
capturep
cbe
cdfabe
checkmarks
chpwd
Cim
CLAUDECODE
clis
cmdkey
CWDs
Dedented
demotable
DFX
dotent
drx
dtx
eef
eku
ession
extened
ffi
focusp
foob
fooba
footgun
formedness
Ghostty
githubnext
gpt
greenfield
greppable
haikus
inputbox
installable
IOCP
ipfs
keyspace
killp
llm
lrx
LSBs
lsp
lsw
ltx
MBM
mcp
meproj
MMdd
mojibake
mpsc
mtimes
myproj
nafter
ncwd
neww
NOAGGREGATION
noname
nopath
normaliser
normalises
noshortcuts
nrx
nsummary
ntwo
ntx
Nushell
obra
Oids
oobe
ools
openai
parallelizable
peekable
Prereq
PRIs
proactively
prx
psobject
ptx
pytest
qdk
qqqqq
Rasterize
recognises
regen
reparses
replacen
respawning
rmcp
rrx
rtx
rustc
serde
sideload
SIGKILLs
signtool
splitn
splitw
SSZ
submittable
synthesises
THH
toolpath
trn
undercounted
undercounting
unrecognised
usize
vcxprojs
vendored
Wez
wezterm
yeelam
ymdhms
ZDOTDIR
zzzzz
These words are not needed and should be removed Ccc cplusplus ctl Debian dotnet drv endptr EOFs ETW evt Fullwidth gitlab hdr idl IME inbox intelligentterminal Ioctl KVM lbl lld lsb NONINFRINGEMENT notif oss outdir pri prioritization PSobject rcv segfault Signtool sourced SWP Tbl testname transitioning unk unparseable unregisters Virt VMs VTE webpage websites WTCLI xsi

Some files were automatically ignored 🙈

These sample patterns would exclude them:

^\.dotnet\/\.dotnet\/TelemetryStorageService/
^\Q.dotnet/.dotnet/.workloadAdvertisingManifestSentinel10.0.200\E$
^\Q.dotnet/.dotnet/10.0.201.aspNetCertificateSentinel\E$
^\Q.dotnet/.dotnet/10.0.201.dotnetFirstUseSentinel\E$
^\Q.dotnet/.dotnet/10.0.201.toolpath.sentinel\E$
^\Qinstaller/bootstrap/target/.rustc_info.json\E$
^copilot-version\.err$
^copilot-version\.out$

You should consider excluding directory paths (e.g. (?:^|/)vendor/), filenames (e.g. (?:^|/)yarn\.lock$), or file extensions (e.g. \.gz$)

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct, update file exclusions, and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/intelligent-terminal.git repository
on the pabhojwa/intelligent/wta_telemetry branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/intelligent-terminal/actions/runs/26545776240/attempts/1' &&
git commit -m 'Update check-spelling metadata'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (2062) from .github/actions/spelling/expect/alphabet.txt .github/actions/spelling/expect/expect.txt .github/actions/spelling/expect/web.txt and unrecognized words (127)

Dictionary Entries Covers Uniquely
cspell:csharp/csharp.txt 32 2 2
cspell:aws/aws.txt 232 2 2
cspell:fonts/fonts.txt 536 1 1

Consider adding to the extra_dictionaries array (in the .github/actions/spelling/config.json file):

    "cspell:csharp/csharp.txt",
    "cspell:aws/aws.txt",
    "cspell:fonts/fonts.txt",

To stop checking additional dictionaries, put (in the .github/actions/spelling/config.json file):

"check_extra_dictionaries": []
Forbidden patterns 🙅 (9)

In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves.

These forbidden patterns matched content:

Should be nonexistent
\b[Nn]o[nt][- ]existent\b
Should be preexisting
[Pp]re[- ]existing
Should be ; otherwise or . Otherwise

https://study.com/learn/lesson/otherwise-in-a-sentence.html

, [Oo]therwise\b
Should probably be Otherwise,
(?<=\. )Otherwise\s
Complete sentences in parentheticals should not have a space before the period.
\s\.\)(?!.*\}\})
Should be set up (setup is a noun / set up is a verb)
\b[Ss]etup(?= (?:an?|the|to)\b)
Should be reentrant
[Rr]e[- ]entrant
Should be whether or not ...
(?i)\b(?:whe|ra)ther(?:\s\w+)+ or not\.
Should be WinGet
\bWinget\b

Pattern suggestions ✂️ (1)

You could add these patterns to .github/actions/spelling/patterns/dd5026bd5359d5870aa69592e0c186573819caad.txt:

# Automatically suggested patterns

# hit-count: 1 file-count: 1
# python
\b(?i)py(?!gment|gmy|lon|ramid|ro|th)(?=[a-z]{2,})

Alternatively, if a pattern suggestion doesn't make sense for this project, add a # to the beginning of the line in the candidates file with the pattern to stop suggesting it.

Errors, Warnings, and Notices ❌ (9)

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

❌ Errors, Warnings, and Notices Count
⚠️ binary-file 6
ℹ️ candidate-pattern 1
⚠️ check-dictionary-not-found 54
❌ check-file-path 20
❌ forbidden-pattern 16
⚠️ ignored-expect-variant 1
⚠️ noisy-file 7
⚠️ single-line-file 1
⚠️ token-is-substring 5

See ❌ Event descriptions for more information.

✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@vanzue vanzue self-requested a review May 28, 2026 08:38
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.

4 participants