Skip to content

test: add two-IDE shared history and subtask e2e test - #20

Open
edelauna wants to merge 5 commits into
mainfrom
issue/6
Open

edelauna wants to merge 5 commits into
mainfrom
issue/6

Conversation

@edelauna

@edelauna edelauna commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Issue #6 reports that two IDEs corrupt the shared task history. Both IDEs write to one ~/.zoo-code/globalStorage.

The upstream fix is merged (Zoo-Code#1261). This PR adds an end-to-end test so the fix stays in place. The test runs two real IDEs against one history store. Each IDE runs a parent task that delegates to a subtask.

This PR is partial work for #6. It does not close the issue. See "Not covered".

What the test does

  1. Start IDE A and IDE B together. Each IDE starts its own parent task with a webview newTask message.
  2. The fixture provider holds both parents at a barrier. Both IDEs then call new_task at the same time.
  3. Both subtasks stream together. Each parent then resumes and finishes.
  4. check_history_store.py checks the shared store.

The driver uses no keyboard in this test. On Windows, a second IDE opens behind the first and gets no native focus.

What the checker verifies

  • No _index.json file is written.
  • Every history_item.json is valid JSON and has a real title.
  • Every item has size above zero.
  • Each parent lists only its own subtask. Each subtask names only its own parent.
  • Each subtask is completed. No parent still waits on a subtask.
  • The provider log shows both barriers released, no disconnect, and six completed streams.
  • The IDE logs have no invalid status transition and no failed persist message.
  • The webview shows the task order parent, subtask, parent in each IDE.

Changes

  • streaming_fixture.py: new history-race scenario with new_task delegation and a barrier.
  • HarnessDriver.java: new history mode. It starts tasks with newTask, records task order in the page, and does no focus checks.
  • check_history_store.py: new store checker, with unit tests.
  • run-windows.ps1: new -HistoryRace switch and -ExpectExtensionVersion.
  • windows-chat-focus.yml: new step in windows-e2e. The extension version is now one workflow-level value.
  • run-windows.ps1 fails when the extension inside the plugin ZIP has an unexpected version. The ZIP name does not set that version.

Evidence

These are one-time local runs on Linux with Xvfb. They used run-history-race.sh, which is no longer in the repo, so they cannot be reproduced from it. The reproducible evidence is the Windows CI artifact windows-history-race-* from run 43562237505 (see "Windows CI"). IDEA IU 2026.2.1 (build 262.9437.185, archive SHA-256 dac2021204c8bf3bd8d66567a1ae36a341da0050b6006c32d42006c6577eb29a).

Extension in the plugin Result Reason
3.84.0 (inside the 3.96.0 plugin ZIP) PASS 4 clean tasks. Parent, subtask, parent in both IDEs.
3.68.0 (before the fix) FAIL tasks/_index.json was written.

The plugin ZIP names do not match their contents. ZooCode-3.78.0.zip and ZooCode-3.96.0.zip both bundle extension 3.84.0 in the local build. The first negative control used them and was invalid. The version check prevents this mistake.

Unit tests run without an IDE: python3 -m unittest test_streaming_fixture test_check_history_store. 20 tests pass in the two history test files.

Windows CI

Commit 5a494cf: the history step passed on IDEA 2026.1.5.1 and 2026.2.1 (4 tasks, no failures, both IDEs PASS). The real parent and child items from that run are fixtures in test_check_history_store.py. The first run failed once in the older focus step on 2026.1.5.1 (No loaded, mounted chat browser after indexing). It passed on rerun, and live-solheim passed after approval.

Not verified

  • The reporter used Windows 11, PhpStorm, and WebStorm. CI uses Windows Server with IDEA.
  • The old extension did not show visible corruption in one run. The test fails on the shared index file only. The race depends on timing. The checks for placeholder titles, size 0, wrong links, and invalid transitions have only unit tests with made-up data.
  • The older focus step is flaky on 2026.1.5.1. This PR does not change it.

Not covered from #6

  • The reporter's ui_message.json corruption is not tested.
  • The symptom "subtask window opens, then flips back to the parent" is only partly covered. The test fails on an aborted subtask, a stuck delegation, or more than three task switches. It cannot see a view that changes to the parent during the subtask and stays there until the parent resumes.
  • The reporter's retest with a current plugin build is still open.

Next steps

  1. Ask the reporter to retest with a current plugin build.
  2. If the subtask flip still happens, open a separate issue.

Refs #6

@edelauna edelauna changed the title test: add two-IDE shared history race test with subtasks test: add two-IDE shared history and subtask e2e test Nov 14, 2026
@edelauna edelauna added the live-solheim Opt in to maintainer-approved live Solheim focus validation label Nov 14, 2026

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

live-solheim Opt in to maintainer-approved live Solheim focus validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant