Skip to content

fix(studio): isolate concurrent experiment run ownership - #180

Merged
phodal merged 6 commits into
QoderAI:mainfrom
U1oSun:fix/experiment-run-ownership
Sep 22, 2026
Merged

phodal merged 6 commits into
QoderAI:mainfrom
U1oSun:fix/experiment-run-ownership

Conversation

@U1oSun

@U1oSun U1oSun commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Reserve experiment IDs before asynchronous preflight. Concurrent same-ID requests now receive one 200 and one 409, with only one runner. Cleanup releases only its own controller. Cancelled or disconnected preflight requests cannot start a runner.

Why

Focused concurrency fix: duplicate requests previously shared output directories and overwrote cancellation ownership. No issue is being closed.

Traceability and Scope

Spec: docs/specs/2026-09-17-experiment-run-ownership.md (AC-1 through AC-4).
Owners: Studio experiment routing and server integration tests.
Non-goals: cross-process locks, queues, scheduling, schema changes, or serializing different IDs.

Change Type

  • Bug fix

Test and Review Evidence

Windows Node 22.20.0 and npm 10.9.3.

  • Real HTTP preflight race failed against old code (200/200).
  • Ownership regressions: 5 passed, independently rerun.
  • Server tests: 61 passed.
  • Studio build and tests: 736 passed, 1 skipped.
  • Typecheck passed; doc-link tests 8 passed.
  • Package verification passed: 735 npm entries, 996 runtime entries.
  • Root suite: 1767 passed, 1 unchanged local DSH baseline failure, 8 skipped.
  • Independent agent review: no unresolved P1/P2.
  • Core CI for this commit on the previously closed PR fix(studio): isolate concurrent experiment run ownership #179 passed all four jobs across Windows, macOS and Linux. Desktop checks were still running when last checked.
  • Local preview could not start because Canvas SDK was unavailable. No UI changed.

Risk and Recovery

Ownership is in-process and retained until preflight or the runner settles. No stored-data migration is required. Revert the commit to restore prior behavior.

AI Involvement

Level: Assisted. Implementation and independent review used GPT-5.6 agents.

Checklist

  • Focused source, tests and spec only.
  • Documentation and package boundaries checked.
  • Cross-platform behavior verified by core CI.
    Changelog unchanged under AGENTS.md scope rules.

U1oSun and others added 2 commits September 22, 2026 10:49
Reserve experiment ids before asynchronous preflight and release only the
owning controller. Cancelled or disconnected preflight requests cannot start
a runner, and failed or settled requests leave the id available for retry.

Implements docs/specs/2026-09-17-experiment-run-ownership.md. A real HTTP
preflight barrier reproduced two successful requests before the fix. Server
tests passed 61, Studio tests passed 736 with one skip, and typecheck,
doc-link and package verification passed. The root suite retained one
unrelated local DSH baseline failure.

Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
Windows and Linux desktop smoke spawn esbuild-wasm's worker from inside
app.asar, where plain Node cannot read bin/esbuild, so AgentReact preview
stops. Load the engine from app.asar.unpacked on the live linker, the
artifact compiler, and trusted renderer compilation.

The config contract test now expects appsHostEnabled, and plural parity
accepts an i18next _one key beside _other. Studio tests passed 743 and
typecheck passed.

Co-authored-by: Grok (Grok 4.7) <grok@x.ai>
@phodal
phodal force-pushed the fix/experiment-run-ownership branch from 1ea5ef4 to 95d1f52 Compare September 22, 2026 03:47
phodal and others added 4 commits September 22, 2026 11:53
cordis-plugin-group 1.0.3, published 2026-09-22, peers on cordis ^4.0.3.
The exact 4.0.2 pin failed npm install with ERESOLVE before either native
smoke could run. Both pins now track that floor. DSH owners stay at
0.1.1-rc.2.

A dry resolve at 4.0.2 still ERESOLVEs. At 4.0.3 the install selects
cordis 4.0.3 and cordis-plugin-group 1.0.3. test:dsh-native reports
discovery verified, and test:dsh-configured-assets-native reports both
native-dsh and better-harness-comparison pass.

Spec: docs/specs/2026-09-22-dsh-native-smoke-cordis-peer-floor.md

Co-authored-by: Grok (Grok 4.7) <grok@x.ai>
Studio depends on private @qoder-ai/harness-studio-apps, which is not on
the npm registry. Desktop staging only packed harness and harness-studio,
so the production install 404ed before Electron packaging. Pack the apps
host tarball into the same install.

Local stage completed and the staged app resolves
@qoder-ai/harness-studio-apps/server.

Spec: docs/specs/2026-09-22-desktop-stage-studio-apps.md

Co-authored-by: Grok (Grok 4.7) <grok@x.ai>
The file-viewer effect and its props memo ran only after the catalog
arrived, so React saw a new hook on the second render and unmounted the
page. Desktop smoke then never found the artifact row, and the browser
artifact suite waited on a tab that never mounted. Both hooks now run on
every render, and a disabled app is not mounted because its UI bundle is
not served.

Local desktop smoke passed, including the native AgentReact preview.

Co-authored-by: Grok (Grok 4.7) <grok@x.ai>
The default last-30-day window no longer contains the August 2026 fixture
sessions, so the artifact catalog dropped a row and the Inspector calendar
had no days. Stamp those sessions relative to today. End in the sidebar
now lands on Components, which is the last View.

The four previously failing browser tests passed locally.

Co-authored-by: Grok (Grok 4.7) <grok@x.ai>
@phodal
phodal merged commit 4f482f8 into QoderAI:main Sep 22, 2026
7 checks passed
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.

2 participants