Repository navigation
Remove the Windows agent's profile after a forced exit [#439] - #441
Conversation
The WebView2 processes can hold the profile past the 2 s in-process retry, which then leaves it behind once the agent exits. A detached cmd.exe repeats the removal for about 20 s. The watchdog case's second CLI invocation now has a 45 s limit.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Lancement et mode de nettoyage détaché js/developer/tools/WebFrontAgent.cpp |
L’agent peut relancer le même exécutable avec l’option interne --cleanup-profile. Le mode extrait le chemin du profil et réessaie remove_all jusqu’à 20 fois, avec une seconde entre les tentatives. |
Intégration au nettoyage et vérification Windows js/developer/tools/WebFrontAgent.cpp, test/tools/AutomationClient.py, docs/CHANGELOG.md |
Après l’échec des tentatives de suppression intégrées, l’agent lance le nettoyeur détaché. Le watchdog vérifie la suppression après libération d’un fichier verrouillé. Les délais d’attente du test augmentent, et le changelog décrit ce comportement. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant Agent
participant NettoyeurDetache
participant Profil
Agent->>NettoyeurDetache: Lance --cleanup-profile avec le chemin du profil
NettoyeurDetache->>Profil: Réessaie la suppression
Profil-->>NettoyeurDetache: Suppression réussie après libération du fichier verrouillé
Possibly related PRs
- ambroise-leclerc/WebFront#427 modifie le nettoyage des profils et les tests du watchdog après une sortie forcée.
- ambroise-leclerc/WebFront#430 ajoute un nettoyage différé des profils sous Linux, sur un problème similaire.
- ambroise-leclerc/WebFront#407 introduit l’exécutable
webfront-agentque cette modification réutilise pour le nettoyage détaché.
Suggested reviewers: am-l
Merge Risk: 
Minimal · up to 343bb
-
No merge-blocking issue is established. The cleanup change still needs confirmation on the hosted Windows runner.
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Pour
#439, le code Windows lance un processus détaché avec une commande Unicode et réessaie la suppression du profil pendant environ 20 secondes. Le testcheck_windows_profile_cleanervérifie le verrouillage d’un fichier et un chemin contenant des caractères Unicode et des métacaractères. Le scénariocli-watchdogutilise ce contrôle et attend la fenêtre de nettoyage. Le délai de la seconde invocation CLI passe à 45 secondes. Ces changements couvrent les exigences de code et de test de#439. La validation sur le runner hébergé reste une validation opérationnelle, pas une exigence de code manquante.
Full details: Out of Scope Changes check
-
Explanation
Les changements restent liés à
#439. Le code C++ ajoute le nettoyage différé du profil Windows. Le test Python couvre le nettoyeur et le watchdog. L’entrée dedocs/CHANGELOG.mddocumente ce comportement. Aucun changement indépendant n’est démontré.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 2 files. (1 skipped: 1 unsupported.)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Fixes #439.
When the agent's exit is forced, the in-process removal of the WebView2 profile retries for 2 s and then gives up. If
msedgewebview2.exestill holds files, the profile is left behind (the failure ofAutomationCliWatchdogon loaded runners). A detachedcmd.exenow repeats the removal for about 20 s, as the Linux side already does with a shell. The case's second CLI invocation limit goes from 15 s to 45 s.Validation:
AutomationCliWatchdogandAutomationMcpWatchdogpass locally (Windows, WebView2 build), including in a parallelweb-integrationrun. The failure is intermittent and was not reproduced locally, and no regression test was added: this needs the hosted Windows runner (rerun of the desktop job) to be confirmed.