Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
220 changes: 220 additions & 0 deletions .github/workflows/windows-chat-focus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
name: Windows chat focus E2E

on:
workflow_dispatch:
inputs:
live_solheim:
description: Run real Solheim terminal/diff tests (requires environment approval)
type: boolean
default: false
live_runner:
description: Hosted Windows Server or an interactive self-hosted Windows 11 x64 runner
type: choice
options:
- windows-2022
- windows11-x64
default: windows-2022
pull_request:
types: [opened, synchronize, reopened, labeled]
paths:
- ".github/workflows/windows-chat-focus.yml"
- "jetbrains_plugin/scripts/ui-harness/**"
- "jetbrains_plugin/src/main/kotlin/**"
- "jetbrains_plugin/build.gradle.kts"
- "jetbrains_plugin/gradle.properties"
- "extension_host/**"

permissions:
contents: read

concurrency:
# Skipped label events must not replace a pending build for this PR.
group: windows-chat-focus-${{ github.ref }}-${{ github.event.action == 'labeled' && github.event.label.name != 'live-solheim' && 'ignored-label' || 'validation' }}
cancel-in-progress: ${{ github.event.action != 'labeled' }}

jobs:
build:
if: github.event.action != 'labeled' || github.event.label.name == 'live-solheim'
name: Build this checkout with the pinned extension
# Keep native dependency builds independent of ubuntu-latest image changes.
runs-on: ubuntu-24.04
timeout-minutes: 90
env:
# Match the extension used in the existing focus investigation.
ZOO_EXTENSION_VERSION: "3.84.0"
# This job packages the plugin; headful tests use the IDE's bundled JCEF.
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
persist-credentials: false
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
cache: gradle
- uses: actions/setup-node@v6
with:
node-version: "22"
cache: npm
cache-dependency-path: extension_host/package-lock.json
- name: Install native build dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends build-essential libx11-dev libxkbfile-dev pkg-config
- name: Validate the local streaming fixture and authenticated relay
working-directory: jetbrains_plugin/scripts/ui-harness
run: python3 -m unittest -v test_streaming_fixture.py test_solheim_proxy.py
- name: Prepare extension host source
run: ./scripts/setup.sh --skip-deps --verbose
- name: Cache the cross-platform VS Code runtime
uses: actions/cache@v4
with:
path: jetbrains_plugin/platform.zip
key: chat-focus-platform-${{ hashFiles('jetbrains_plugin/gradle.properties', 'jetbrains_plugin/genPlatform.gradle') }}
- name: Build the full plugin without publishing
run: ./scripts/build.sh --mode release --clean --verbose
- uses: actions/upload-artifact@v4
with:
name: chat-focus-plugin
path: jetbrains_plugin/build/distributions/*.zip
if-no-files-found: error

windows-e2e:
name: Native typing and streaming chat (IDEA ${{ matrix.ide }})
needs: build
runs-on: windows-2022
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- ide: "2025.3"
sha256: "6f7234b57444371c3af02ab31a15f76dd1d6e5e32eaabc96722777a9addcd023"
- ide: "2026.2.1"
sha256: "8aa16db629952300ab74d2d5e095150d1a534593e65bbbbd795b859759c00cbc"
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Validate fixture HTTP behavior on Windows
run: python -m unittest discover -s jetbrains_plugin/scripts/ui-harness -p test_streaming_fixture.py -v
- uses: actions/download-artifact@v4
with:
name: chat-focus-plugin
path: focus-plugin
- name: Download pinned Windows IDE with bundled JBR and JCEF
env:
IDE_VERSION: ${{ matrix.ide }}
IDE_SHA256: ${{ matrix.sha256 }}
run: |
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory -Force focus-evidence | Out-Null
$archive = "idea-$env:IDE_VERSION.win.zip"
$url = "https://download.jetbrains.com/idea/$archive"
# Pinned from JetBrains' <archive>.sha256, not resolved from a latest feed.
$expected = $env:IDE_SHA256
if ($expected -notmatch '^[a-fA-F0-9]{64}$') { throw 'Invalid vendor checksum' }
Invoke-WebRequest $url -OutFile "$env:RUNNER_TEMP/idea.zip"
$actual = (Get-FileHash "$env:RUNNER_TEMP/idea.zip" -Algorithm SHA256).Hash
if ($actual -ne $expected) { throw 'IDE archive checksum mismatch' }
"$url SHA256=$actual" | Set-Content focus-evidence/ide-download.txt
Expand-Archive "$env:RUNNER_TEMP/idea.zip" "$env:RUNNER_TEMP/focus-ide"
Remove-Item "$env:RUNNER_TEMP/idea.zip"
$launchers = @(Get-ChildItem "$env:RUNNER_TEMP/focus-ide" -Filter idea64.exe -Recurse)
if ($launchers.Count -ne 1) { throw 'Expected exactly one native IDE launcher' }
$ideDir = $launchers[0].Directory.Parent.FullName
"FOCUS_IDE_DIR=$ideDir" >> $env:GITHUB_ENV
- name: Run native desktop preflight and two-turn streaming focus test
run: |
$plugins = @(Get-ChildItem focus-plugin -Filter *.zip)
if ($plugins.Count -ne 1) { throw 'Expected exactly one plugin distribution' }
& ./jetbrains_plugin/scripts/ui-harness/run-windows.ps1 `
-IdeDir $env:FOCUS_IDE_DIR -PluginZip $plugins[0].FullName `
-EvidenceDir "$env:GITHUB_WORKSPACE/focus-evidence"
- name: Upload focus traces, screenshots, and run identity
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-chat-focus-${{ matrix.ide }}-${{ github.sha }}
path: focus-evidence/
if-no-files-found: error

live-solheim:
name: Live Solheim terminal and diff focus (WebStorm 2026.2.1)
needs: [build, windows-e2e]
if: >-
(github.event_name == 'workflow_dispatch' && inputs.live_solheim) ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'live-solheim'))
environment: solheim
runs-on: ${{ inputs.live_runner == 'windows11-x64' && fromJSON('["self-hosted", "Windows", "X64", "windows11-x64"]') || 'windows-2022' }}
timeout-minutes: 60
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: actions/download-artifact@v4
with:
name: chat-focus-plugin
path: focus-plugin
- name: Download WebStorm 2026.2.1 with bundled JBR and JCEF
run: |
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory -Force live-evidence | Out-Null
$url = 'https://download.jetbrains.com/webstorm/WebStorm-2026.2.1.win.zip'
$expected = '08c65a4c2fbc5c8ede2d95de83fddd1665327c970f52c750e6e6414265f834d7'
Invoke-WebRequest $url -OutFile "$env:RUNNER_TEMP/webstorm-focus.zip"
$actual = (Get-FileHash "$env:RUNNER_TEMP/webstorm-focus.zip" -Algorithm SHA256).Hash
if ($actual -ne $expected) { throw 'WebStorm archive checksum mismatch' }
"$url SHA256=$actual" | Set-Content live-evidence/ide-download.txt
$idePath = Join-Path $env:RUNNER_TEMP ('webstorm-focus-' + [guid]::NewGuid().ToString('N'))
Expand-Archive "$env:RUNNER_TEMP/webstorm-focus.zip" $idePath
Remove-Item "$env:RUNNER_TEMP/webstorm-focus.zip"
$launchers = @(Get-ChildItem $idePath -Filter webstorm64.exe -Recurse)
if ($launchers.Count -ne 1) { throw 'Expected exactly one WebStorm launcher' }
"FOCUS_IDE_DIR=$($launchers[0].Directory.Parent.FullName)" >> $env:GITHUB_ENV
- name: Run three fresh live conversations without retrying failures
env:
SOLHEIM_API_KEY: ${{ secrets.SOLHEIM_API_KEY }}
REQUIRE_WINDOWS11: ${{ inputs.live_runner == 'windows11-x64' }}
run: |
$plugins = @(Get-ChildItem focus-plugin -Filter *.zip)
if ($plugins.Count -ne 1) { throw 'Expected exactly one plugin distribution' }
# The runner removes the key from its child-process environment.
# Retain it only in this PowerShell process for the next fresh profile.
$liveKey = $env:SOLHEIM_API_KEY
try {
for ($iteration = 1; $iteration -le 3; $iteration++) {
$env:SOLHEIM_API_KEY = $liveKey
& ./jetbrains_plugin/scripts/ui-harness/run-windows.ps1 `
-IdeDir $env:FOCUS_IDE_DIR -PluginZip $plugins[0].FullName `
-Provider solheim -DeadlineSeconds 780 -RequireWindows11:($env:REQUIRE_WINDOWS11 -eq 'true') `
-EvidenceDir "$env:GITHUB_WORKSPACE/live-evidence/run-$iteration"
}
} finally { $liveKey = $null; $env:SOLHEIM_API_KEY = $null }
- name: Upload live focus evidence and tool coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: live-solheim-webstorm-2026.2.1-${{ github.sha }}
path: live-evidence/
if-no-files-found: error
- name: Remove downloaded IDE on self-hosted runners
if: always() && inputs.live_runner == 'windows11-x64'
run: |
if ($env:FOCUS_IDE_DIR -and (Test-Path $env:FOCUS_IDE_DIR)) {
Remove-Item $env:FOCUS_IDE_DIR -Recurse -Force
}
29 changes: 11 additions & 18 deletions docs/KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ The plugin requires Node.js command line tools to function properly. Node.js exe
## 3. Focus Behavior

Measured triggers, fixes, and remaining limits are recorded in
[the validation report](validation/chat-focus-preservation.md). Raw evidence
paths in that report are local, ignored build artifacts; the report includes
the relevant trace excerpts for readers of a clean checkout.
[the validation report](validation/chat-focus-preservation.md), with test setup
and evidence-review instructions in the linked harness README.

### 3.1 Terminal Creation Focus Restoration

Expand Down Expand Up @@ -207,21 +206,15 @@ automatically activate chat.

### 3.3 Intermittent First-Turn Draft Character Loss

Open. Not fixed. Not conclusively attributed. Real provider-backed
conversations intermittently lose one draft character near the first
file-editor or diff opening. The latest run completed both turns but failed
draft preservation: 32/33 characters in the first turn, 6/6 in the follow-up.
The IDE trace recorded the key release without a matching press, with no
browser remount and the Swing owner stable on the chat OSR canvas. The
initiating platform call remains unproven. The same test stream found and fixed
the separate diff `preserveFocus` decoding bug; the live diff now opens with
`preserveFocus=true` and chat focus retained. A pure JDK probe
(`scripts/ui-harness/KeyDropProbe.java`) reproduced release-without-press only
under deliberate focus churn (4/120; control 0/120); it is analogous evidence,
not an IDE reproduction. A later passing run does not clear this issue.
Observed only in the Linux Xvfb/Openbox fixture on IU-253.28294.334. Other
platforms, builds, and live click races are untested. Trace excerpts and
failed-run references are in [the validation report](validation/chat-focus-preservation.md).
Open pending reporter or Windows 11 confirmation. The fix passed in hosted CI,
but the linked run predates the latest workflow, harness, Kotlin, and relay
changes, which require fresh CI validation. An earlier Windows live run lost one character during a preserving normal-file
open before the diff began. Preserving file and diff opens now share the
suspending file-editor API to avoid the synchronous loading loop. The expanded
regression opens 12 Java files followed by diffs while typing. The expanded
local regression, both Windows fixture jobs, and three fresh Windows live Solheim
conversations passed. The reporter's Windows 11 configuration remains unverified. See
[the validation report](validation/chat-focus-preservation.md).

## 4. General Troubleshooting Steps

Expand Down
Loading
Loading