Repository navigation
Description
Scope expanded 2026-07-06: originally filed as the no-workspace dead-actions bug (kept below as Part 1). Expanded to cover the full extension-side work for Codev IDE mode, because it's all one layer model touching the same files, and fixing Part 1 standalone would mean touching the same code twice. The Codev IDE fork tracks its own side (extension bundling pipeline, fork-side integration verification) on its own board; this issue is self-contained for everything in
packages/vscode.
The underlying model
The extension currently has no concept of a workspace-free layer. Its features split into:
- Tower-level (user-global, workspace-free): connection, status bar, Agents view (Tower state is global —
~/.agent-farm/global.db), dashboard, first-run, CLI walkthrough. - Workspace-level (need a folder): Workspace view, Spawn Builder, New Shell, Backlog/PRs, worktree ops.
Two context keys make the model explicit, and everything below hangs off them:
codev.hasWorkspace: false |
codev.hasWorkspace: true |
|
|---|---|---|
guest (codev.ideMode: false) |
hide workspace-bound views; welcome: "Open a folder to use Codev" | today's normal experience (unchanged) |
IDE (codev.ideMode: true) |
empty-window surface: Open Folder / Open Recent / spawn-your-first-builder; Tower-level views live | full experience |
Part 1 — Workspace sidebar renders non-executable actions when no folder is open (original bug)
When VS Code is opened with no folder, the Codev sidebar still renders the Workspace section with fully-clickable Architects / Spawn Builder / New Shell rows. None are executable (no .codev/config.json, no spawn target); users get a false signal that Codev is ready to act on an implicit workspace.
Root cause: packages/vscode/src/views/workspace.ts:108-124 builds tree items unconditionally in getChildren; nothing gates on vscode.workspace.workspaceFolders?.length > 0.
Fix: view-level gate via when: "codev.hasWorkspace" in contributes.views (matches VS Code conventions — Source Control/Explorer show empty-view content, not dead actions), with viewsWelcome fallback content. Audit Backlog/PRs/Agents views for the same issue.
Part 2 — Dual-mode activation
One codebase, one artifact, two channels: the marketplace vsix, and the same file set baked into the Codev IDE fork as a built-in extension. The behavioral split happens at runtime:
package.json: add"onStartupFinished"toactivationEvents(keep bothworkspaceContainsentries).- Top of
activate()(src/extension.ts:136): computeideMode = vscode.env.appName === 'Codev'— the fork sets this viaproduct.jsonnameLong. Pin the string as a named constant with a comment marking it a cross-repo contract with the fork's product.json: if either side changes it, IDE mode silently dies. - Ordering is the whole risk:
activate()currently constructsConnectionManagerimmediately, which auto-starts Tower (connection-manager.ts,autoStartTowerdefault true). Safe today because activation implies a codev workspace; withonStartupFinishedit runs in every window of every marketplace install. The guest+no-codev-workspace path must remain exactly as dormant as if activation had never fired — no Tower process, no UI mutation, no state writes. setContext('codev.ideMode', …)+setContext('codev.hasWorkspace', …)(tracked onworkspaceFolderschanges).
Part 3 — IDE empty-window surface
When ideMode && !hasWorkspace: focus the Codev view container on startup (workbench.view.extension.codev), viewsWelcome content with Open Folder / Open Recent / "spawn your first builder" pointer; one-time first-run notification gated on globalState; the existing CLI-preflight walkthrough becomes the first-run path. (Home-tab webview is a v1 concept, out of scope here.)
Acceptance
- No-workspace guest window: no dead actions anywhere (Part 1), regardless of how activation happened.
- Marketplace inertness test: activation via
onStartupFinishedunder a vanillaappNamewith no codev project is provably inert (no Tower spawn, no focus steal, no notifications). - IDE mode (simulatable in the Extension Development Host via appName override or a test seam): container focused, welcome content shown, first-run fires once.
- Behavior matrix above covered by tests per quadrant.
- Documented answer for the built-in-vs-marketplace-copy collision inside the IDE (a user-installed marketplace copy shadows the built-in).
Coordination
The fork consumes this work as a built vsix, unpacked into its extensions/ dir by script (extension build output is never committed to either repo). Start trigger: the fork's rebrand lands and locks nameLong: "Codev" — the codev-ide architect will ping when that's done; this issue then becomes the pre-agreed PIR builder's scope (agreed with codev main 2026-07-06).
Activity
[-]vscode: Workspace sidebar renders non-executable actions when no folder is open[/-][+]vscode: IDE-mode foundation — dual-mode activation, workspace/IDE context keys, empty-window surfaces[/+][-]vscode: IDE-mode foundation — dual-mode activation, workspace/IDE context keys, empty-window surfaces[/-][+]vscode: IDE-mode foundation: dual-mode activation, workspace/IDE context keys, empty-window surfaces[/+]amrmelsayed commentedon Jul 7, 2026
Fork-side findings from the rebrand implementation (2026-07-07) that update this issue's context — requirements structure unchanged, two deltas:
Part 3 is now the product's ONLY first-run UX. The fork removes upstream 1.127's core onboarding wizard entirely and ships
workbench.startupEditordefaulting to'none'— a cold first launch is an empty window + the Codev container. The empty-window surface specced here isn't additive polish on top of core onboarding; it is the sole onboarding the IDE has. Treat its acceptance criteria accordingly.New hard constraint (empirically verified in the fork): extension-contributed
configurationDefaultscannot deterministically gate any first-launch surface. Defaults register asynchronously and race whatever renders at startup (observed ~1-in-3 cold-launch leaks before the affected core surfaces were removed in code). Everything in Part 3 must therefore be runtime code (onStartupFinishedhandler →setContext→ explicit container focus / welcome content), never a settings default. The fork currently carries a tiny built-in defaults extension for steady-state settings; if those defaults later migrate intocodev-vscode, migrate steady-state values only — never anything a user sees on first launch.Confirmed current: the detection contract is
vscode.env.appName === 'Codev'(locked in the fork's rebrand, now implemented). Trigger ping coming shortly — rebrand is at final gate checks.amrmelsayed commentedon Jul 7, 2026
On it! Working on this with the PIR protocol (plan + dev-approval gates before PR).
[PIR #1144] Plan draft
[PIR #1144] Dual-mode activation: tier-gated side effects, context ke…
[PIR #1144] Tests: behavior-matrix policy + package.json gating invar…
[PIR #1144] Thread: implement phase log
[PIR #1144] Gate viewsWelcome on codev.stateKnown to kill the pre-act…
[PIR #1144] Replace the raw no-provider message with a Loading Codev …
[PIR #1144] Detection: the opened folder must itself be a codev root …
[PIR #1144] codev.hasWorkspace means codev-workspace-presence, not fo…
[PIR #1144] Review + retrospective
[PIR #1144] Fix stale comment reference to removed findProjectRoot
changelog: IDE-mode foundation — dual-mode activation, empty-window s…
[Bugfix #1169] Test: pin collapsed default for the four lower-priorit…
[Spec 1963][Phase: cockpit_hierarchy] fix: review notes — badge follo…
[Spec 1963][Phase: cockpit_hierarchy] fix: review notes — badge follo…