Skip to content

Commit a029b62

Browse files
author
DavidQ
committed
Enable Workspace Manager tool buttons from embedded payload baseline - PR 11.27
1 parent d96dec6 commit a029b62

6 files changed

Lines changed: 169 additions & 54 deletions

docs/dev/codex_commands.md

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,52 @@
11
MODEL: GPT-5.3-codex
2-
REASONING: medium
2+
REASONING: high
33

44
TASK:
5-
Apply PR 11.24.
5+
Apply PR 11.27.
66

7-
Find the sample 1902 page/content that renders the visible "Tool Roundtrip Links" section and individual "Open <tool>" links.
7+
Reset the working recovery baseline to:
88

9-
Make the smallest targeted change so sample 1902 exposes only:
9+
4dc2b0f: Show Workspace Manager asset status from embedded tool payloads - PR 11.22
1010

11-
Open with Workspace Manager
11+
Use that as the source of truth because it loaded the JSON and displayed the correct full Workspace Manager workspace.
1212

13-
Do not modify tool implementation files unless the sample entry page delegates rendering there.
14-
Do not change payload schema.
15-
Do not change manifest data except where required to remove direct visible sample links.
16-
Do not add fallback links.
17-
Do not touch start_of_day folders.
13+
Then fix ONLY the remaining issue:
14+
- many Workspace Manager tool buttons are grayed out/disabled even though embedded payload data exists.
1815

19-
VALIDATION:
20-
node --check <changed-js-files>
16+
Do NOT carry forward today's failed changes unless independently required and verified:
17+
- do not reapply PR 11.23 binding/cache behavior that caused palette-only
18+
- do not reapply PR 11.25 forward-fix behavior that still failed
19+
- do not remove payload fan-out
20+
- do not collapse visible tools to palette-only
21+
22+
Do NOT restore or change PR 11.24 page cleanup unless it already exists after resetting. The priority is Workspace Manager correctness from 4dc2b0f.
23+
24+
Implementation guidance:
25+
1. Inspect Workspace Manager/tool launch button disabled logic.
26+
2. Compare status-display rules from 4dc2b0f with button-enable rules.
27+
3. Make enablement consider embedded payload presence as valid launch data.
28+
4. Keep utility tools handled separately as N/A where appropriate.
29+
5. Avoid selectedAssetId/assetRegistry/external-file requirements for embedded-payload tools.
30+
6. Keep the fix surgical and localized.
31+
32+
Validation:
33+
node --check tools/shared/platformShell.js
2134
node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --samples --sample-range=1902-1902 --tools
2235

36+
Manual validation:
37+
Open sample 1902.
38+
Open Workspace Manager.
39+
Confirm:
40+
- full workspace is visible
41+
- not palette-only
42+
- payload-backed editor buttons are enabled/openable
43+
- asset/status labels are still visible
44+
2345
REPORT:
24-
Write docs/dev/reports/PR_11_24_validation.txt with:
25-
- changed files
26-
- before behavior
27-
- after behavior
46+
Write docs/dev/reports/PR_11_27_validation.txt with:
47+
- baseline commit used
48+
- files changed
49+
- root cause of grayed-out buttons
50+
- why payload presence now enables launch
2851
- validation commands/results
52+
- manual validation notes

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Make sample 1902 launch only through Workspace Manager - PR 11.24
1+
Enable Workspace Manager tool buttons from embedded payload baseline - PR 11.27
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
PR 11.27 Validation Report
2+
3+
PASS/FAIL: PASS
4+
5+
Baseline commit used:
6+
- 4dc2b0f1e5dda41c4220626910964c2c492aa7f6
7+
- Subject: Show Workspace Manager asset status from embedded tool payloads - PR 11.22
8+
- Baseline file reset: tools/shared/platformShell.js
9+
10+
Files changed:
11+
- tools/shared/platformShell.js
12+
- docs/dev/reports/PR_11_27_validation.txt
13+
14+
Root cause of grayed-out buttons:
15+
- Workspace-context tool disablement in tools/shared/platformShell.js used a global palette gate:
16+
- non-palette tools were disabled whenever shared palette handoff was not ready.
17+
- This gate ignored whether a tool already had valid embedded payload state in manifest.tools[toolId].
18+
- Result: payload-backed tools appeared in Workspace Manager with embedded status labels, but links remained disabled/grayed out.
19+
20+
Why payload presence now enables launch:
21+
- Tool-disable logic now checks in this order:
22+
1) workspace readiness (still required)
23+
2) palette-browser always enabled
24+
3) if manifest.tools[toolId] exists, tool is enabled (payload = data present)
25+
4) if no tool state and no palette handoff, tool remains disabled
26+
- This keeps utility/unsupported cases gated while allowing payload-backed tools to open without selectedAssetId/assetRegistry/external file requirements.
27+
28+
Validation commands/results:
29+
- node --check tools/shared/platformShell.js -> PASS
30+
- node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --samples --sample-range=1902-1902 --tools -> PASS
31+
- Summary: PASS=19 FAIL=0 TOTAL=19
32+
33+
Manual validation notes:
34+
- Manual browser validation is required for final visual confirmation of enabled/openable payload-backed buttons.
35+
- Expected manual checks:
36+
- Open sample 1902
37+
- Open Workspace Manager
38+
- Confirm full workspace is visible (not palette-only)
39+
- Confirm payload-backed editor buttons are enabled/openable
40+
- Confirm asset/status labels remain visible
41+
- In this CLI run, automated validation passed and the enablement logic now aligns with embedded payload presence.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PR 11.27 Validation
2+
3+
Baseline:
4+
- 4dc2b0f: Show Workspace Manager asset status from embedded tool payloads - PR 11.22
5+
6+
Files changed:
7+
-
8+
9+
Root cause:
10+
-
11+
12+
Before:
13+
- Full workspace displayed, but many payload-backed tool buttons were grayed out.
14+
15+
After:
16+
- Full workspace displayed and payload-backed tool buttons are enabled/openable.
17+
18+
Validation:
19+
- node --check tools/shared/platformShell.js
20+
- node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --samples --sample-range=1902-1902 --tools
21+
22+
Manual:
23+
- sample 1902 -> Workspace Manager
24+
- full workspace visible
25+
- payload-backed buttons enabled
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# PR 11.27 — Baseline 4dc2b0f and Enable Workspace Tool Buttons
2+
3+
## Purpose
4+
Restart the recovery lane from the last known good Workspace Manager baseline:
5+
6+
4dc2b0f: Show Workspace Manager asset status from embedded tool payloads - PR 11.22
7+
8+
## Known Good at Baseline
9+
- Sample 1902 loads JSON.
10+
- Workspace Manager displays the correct full workspace.
11+
- Embedded payload status is visible.
12+
13+
## Remaining Defect
14+
- Many Workspace Manager tool buttons are grayed out/disabled even though their embedded payload data exists.
15+
16+
## Required Change
17+
Start from commit `4dc2b0f` and make the smallest targeted fix so workspace-supported tools with embedded payload data are enabled/openable.
18+
19+
## Scope
20+
- Use `4dc2b0f` as the baseline.
21+
- Do not include today’s failed PR 11.23 / 11.24 / 11.25 forward-fix logic.
22+
- Do not collapse workspace display to palette-only.
23+
- Do not remove or rewrite JSON payload.
24+
- Do not change schema unless a local enablement defect is proven.
25+
- Do not add fallback sample data.
26+
- Do not use hidden defaults.
27+
- Do not touch start_of_day folders.
28+
- Keep sample 1902 focused on Workspace Manager behavior.
29+
30+
## Key Rule
31+
payload = data present
32+
33+
Enablement must not require:
34+
- selectedAssetId
35+
- assetRegistry
36+
- external file reference
37+
38+
Those may be useful metadata, but they are not required for enabling a tool when embedded payload exists.
39+
40+
## Investigation Targets
41+
Check button disabled logic in Workspace Manager/platform shell:
42+
- Does it require an external asset reference?
43+
- Does it require selectedAssetId?
44+
- Does it treat embedded payload-only tools as missing assets?
45+
- Does it mark true utility tools differently from payload-backed editor tools?
46+
- Does status display and open enablement use different rules?
47+
48+
## Acceptance
49+
- Workspace Manager from sample 1902 still shows the full workspace, not palette-only.
50+
- Tools with embedded payload data are enabled/openable.
51+
- Buttons are not grayed out solely because data is embedded instead of external.
52+
- True unsupported/missing tools may remain disabled only with documented reason.
53+
- Asset/status labels continue to show from embedded payload.
54+
- Runtime smoke test passes.

tools/shared/platformShell.js

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -679,34 +679,6 @@ function summarizeEmbeddedToolPayloadDocument(toolId = "", scopedToolState = nul
679679
return null;
680680
}
681681

682-
function resolveWorkspaceManifestToolStateForStatus(toolId = "") {
683-
const normalizedToolId = normalizeTextValue(toolId).toLowerCase();
684-
if (!normalizedToolId) {
685-
return null;
686-
}
687-
const manifest = getManifest();
688-
const tools = manifest && typeof manifest === "object" && manifest.tools && typeof manifest.tools === "object" && !Array.isArray(manifest.tools)
689-
? manifest.tools
690-
: null;
691-
if (!tools) {
692-
return null;
693-
}
694-
695-
const exactMatch = tools[normalizedToolId];
696-
if (exactMatch && typeof exactMatch === "object" && !Array.isArray(exactMatch)) {
697-
return exactMatch;
698-
}
699-
700-
if (normalizedToolId === "palette-browser") {
701-
const singularPalette = tools.palette;
702-
if (singularPalette && typeof singularPalette === "object" && !Array.isArray(singularPalette)) {
703-
return singularPalette;
704-
}
705-
}
706-
707-
return null;
708-
}
709-
710682
function installWorkspaceScopedSamplePresetFetchShim(currentToolId, samplePresetPath) {
711683
if (typeof window === "undefined" || typeof window.fetch !== "function") {
712684
return;
@@ -729,7 +701,6 @@ function installWorkspaceScopedSamplePresetFetchShim(currentToolId, samplePreset
729701
const rawPreset = await response.clone().json().catch(() => null);
730702
const scopedPreset = selectWorkspaceScopedToolPreset(rawPreset, normalizedToolId);
731703
if (!scopedPreset) {
732-
workspaceScopedToolPresetForStatus = null;
733704
return response;
734705
}
735706
workspaceScopedToolPresetForStatus = scopedPreset;
@@ -757,19 +728,16 @@ async function primeWorkspaceScopedToolPresetForStatus(toolId, samplePresetPath)
757728
try {
758729
const response = await window.fetch(normalizedSamplePresetPath, { cache: "no-store" });
759730
if (!response.ok) {
760-
workspaceScopedToolPresetForStatus = null;
761731
return null;
762732
}
763733
const rawPreset = await response.json();
764734
const scopedPreset = selectWorkspaceScopedToolPreset(rawPreset, normalizedToolId);
765735
if (!scopedPreset) {
766-
workspaceScopedToolPresetForStatus = null;
767736
return null;
768737
}
769738
workspaceScopedToolPresetForStatus = scopedPreset;
770739
return scopedPreset;
771740
} catch {
772-
workspaceScopedToolPresetForStatus = null;
773741
return null;
774742
}
775743
}
@@ -1467,11 +1435,9 @@ function isAssetCompatibleWithTool(toolId = "", asset = null) {
14671435

14681436
function renderToolAssetBadge(toolId = "") {
14691437
const normalizedToolId = normalizeTextValue(toolId).toLowerCase();
1470-
const workspaceBoundToolState = resolveWorkspaceManifestToolStateForStatus(normalizedToolId);
1471-
const statusSourceToolState = workspaceBoundToolState || workspaceScopedToolPresetForStatus;
14721438
const embeddedPayloadSummary = summarizeEmbeddedToolPayloadDocument(
14731439
normalizedToolId,
1474-
statusSourceToolState
1440+
workspaceScopedToolPresetForStatus
14751441
);
14761442
const acceptedKinds = resolveAcceptedAssetKindsForTool(normalizedToolId);
14771443
if (normalizedToolId === "palette-browser") {
@@ -1572,7 +1538,13 @@ function renderToolLinks(currentToolId) {
15721538
if (!lockState.workspaceReady) {
15731539
return true;
15741540
}
1575-
if (!lockState.paletteReady && toolId !== "palette-browser") {
1541+
if (toolId === "palette-browser") {
1542+
return false;
1543+
}
1544+
if (lockState.hasToolState(toolId)) {
1545+
return false;
1546+
}
1547+
if (!lockState.paletteReady) {
15761548
return true;
15771549
}
15781550
return false;
@@ -2262,7 +2234,6 @@ function ensureRuntimeMonitoring() {
22622234
}
22632235

22642236
async function initPlatformShell() {
2265-
workspaceScopedToolPresetForStatus = null;
22662237
ensureRuntimeMonitoring();
22672238

22682239
const currentToolId = document.body.dataset.toolId || "";

0 commit comments

Comments
 (0)