Skip to content

build: package the mobile workbench as an isolated web target - #345369

Merged
Osvaldo Ortega (osortega) merged 36 commits into
mainfrom
osortega/agents/mobile-stack/03-build
Nov 11, 2026
Merged

Osvaldo Ortega (osortega) merged 36 commits into
mainfrom
osortega/agents/mobile-stack/03-build

Conversation

@osortega

@osortega Osvaldo Ortega (osortega) commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Scope

Follow-up to #345368, which has landed. This draft now targets main directly
and includes main through 9e6a19855be06678429f9878893122bda91c74f9, using merges
rather than rewriting the existing branch.

Add an isolated mobile target to the existing esbuild-based tooling:

  • Bundle the dedicated mobile Agents entry with its own localization output.
  • Package selected browser extensions, workers and runtime libraries.
  • Package the same built-in skill definitions as desktop.
  • Record the ordinary source commit, quality and file-integrity metadata.
  • Enforce output ownership, emitted dependency boundaries and size limits.
  • Reject full-workbench and ordinary-entry presentation implementations.
  • Support current pnpm dependency records and published source maps whose
    original paths point into a pnpm store entry, while still rejecting unknown
    dependencies and requiring their license metadata.

pnpm run bundle-mobile produces out-mobile/ with the inventory mobile.json
(kind: "sessions-mobile"). The target, scripts, helpers, policy and package
identity use mobile, independently of release quality or rollout status.
pnpm run test-mobile runs the focused package tests.

The retained inventory supports completeness and local-development cache
invalidation; its checksum is not a production release ID. This PR has no
uploader, release registry, production hostname or standalone publication
pipeline. Renaming the target does not enable it in production.

Mobile background exclusion

The current-main package exposed approximately 19.28 MB of gzipped koi
animations inherited from the ordinary resource list. Instead of dropping
assets and leaving broken choices, the dedicated mobile composition omits
the background implementation and media:

  • Background controls, settings, rendering, tint and appearance tools are
    registered only by the regular entry.
  • Shared chat and grid components use the existing entry-selected chat-view
    factory; the regular factory supplies background surfaces and sticky replicas,
    while the mobile factory does not.
  • Mobile does not advertise unavailable controls in accessibility help.
  • Mobile retains the same built-in skills and shared prompts service as desktop,
    with the existing enablement rules. The mobile-only prompts subclass and
    background-skill packaging exception have been removed.
  • The unchanged background skill already tells the agent to explain when
    required tools are unavailable rather than generating an image it cannot
    apply. The actual feature boundary is the missing implementation and tools,
    not a mobile check in the skill.
  • The mobile resource list is independent of the ordinary workbench resource
    list and contains no animated or static koi/background assets.
  • Source-graph tests and emitted-module policy checks protect this boundary.

The ordinary desktop and ordinary web Agents background behavior is preserved.
This necessary composition change means the PR is no longer strictly build-only.

Validation

Final package source: 49e2c1a069f59243cdc1048fc3a6d72358618c81, local dev
quality.

Passed: 120 package/resource tests, including exact-limit acceptance,
one-byte overflow rejection, both pnpm layouts, extension resources,
entry/resource isolation, shared skill definitions and service selection,
and preserving legacy output during the rename:

TMPDIR=/private/tmp npm exec --yes [email protected] -- pnpm run test-mobile build/next/test/resources.test.ts build/next/test/bundle.test.ts build/lib/test/sessionsPresentationDependencies.test.ts

The two updated mobile regressions failed against the previous mobile-only
behavior and passed after the rework.

Current application checks:

  • npm run transpile-client: passed, refreshing the test output.
  • npm run typecheck-client: passed.
  • npm exec --yes [email protected] -- pnpm -C build run typecheck:
    passed.

Passed: 73 Chromium tests for shared skill enablement, workspace overrides,
harness forwarding and accessibility help:

npm run test-browser-no-install -- --run src/vs/sessions/contrib/chat/test/browser/appearanceTools.test.ts --run src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts --browser chromium

Passed: 4 Node checks for the unchanged background skill's metadata,
missing-tool guidance and workflow, including the runner's error guard:

npm run test-node -- --run src/vs/sessions/contrib/chat/test/node/chatBackgroundSkill.test.ts
  • npm run -s precommit: passed through the normal commit hook.
  • git diff --cached --check: passed before the signed rework commit.
  • Focused review of the shared-skill rework found no blocking issues. Earlier
    independent reviews covered the background extraction and target rename.

Earlier background-extraction validation on 7810cdeefab, before this
shared-skill rework, also passed the wider 281-test Chromium selection:

npm run test-browser-no-install -- --run src/vs/sessions/contrib/mobile/test/browser/mobilePresentation.test.ts --run src/vs/sessions/contrib/chat/test/browser/appearanceTools.test.ts --run src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts --run src/vs/sessions/contrib/chat/test/browser/chatView.test.ts --run src/vs/sessions/test/browser/sessionsPart.test.ts --run src/vs/sessions/test/browser/mobileSessionsPart.test.ts --browser chromium

npm run valid-layers-check and npm run define-class-fields-check passed
during that earlier extraction validation; they were not rerun for this
shared-skill simplification.

Passed: the real package build from the exact committed source:

BUILD_SOURCEVERSION="$(git rev-parse HEAD)" npm exec --yes [email protected] -- pnpm run bundle-mobile

The success manifest identifies that exact commit and inventories 501 assets,
17 extensions and all 14 desktop built-in skills
. Every packaged skill is
byte-identical to its unchanged source. All asset paths, raw/gzip sizes and
SHA-256 hashes were checked against disk, along with extension resource
completeness and the configured budgets. The ownership marker and manifest
identity were verified. There are no symlink assets, background images,
forbidden implementation modules or the removed mobile prompts service in
the packaged source maps.

Temporary size guards

Gzipped bytes Measured Limit
Main JavaScript 5,557,991 5,600,000
Stylesheet 237,537 240,000
Initial JS + CSS + language bundle 6,142,637 6,200,000
Core runtime, including initial files 14,528,970 14,600,000
Extensions 712,440 800,000

After inspecting the remaining growth, only the temporary JavaScript and
initial-download limits were adjusted, from 5.5 to 5.6 MB and from 6.1 to 6.2 MB.
The stylesheet, runtime and extension limits and all dependency checks remain
unchanged. A comment directly beside the limits explicitly calls for lowering
them further to improve the mobile experience. The target rename and shared-skill
rework do not change any of these limits; the policy remains byte-identical.

These are temporary growth guards, not mobile performance targets, hosting
limits or existing VS Code product requirements. They sum independently gzipped
files; they do not measure all actual startup downloads, phone responsiveness or
memory. Reducing the downloads needed for a usable session list and composer is
separate work. See build/next/MOBILE.md.

Verification limits

This update did not run a signed-in provider flow, physical-phone test, production
product-mixin build, live Azure publication or deployment. The skill tests check
the existing instructions, not a live model's response. No application server
was launched and no downstream publication or testing branch was changed.

Keep the existing workbench presentation by default while allowing isolated entries to adapt session headers, pickers, chat edits and layout. Preserve provider-owned repository authentication and scoped model configuration.

Co-authored-by: Copilot <[email protected]>
Compose the mobile entry from shared services without adding it to production entry points or resource inventories. Adapt phone sheets, host selection, chat edits and the shared composer to current chat-scoped configuration APIs, preserving enterprise checks and provider-advertised agent identities.

Co-authored-by: Copilot <[email protected]>
Package the mobile entry with its own localization, selected browser extensions and integrity inventory. Keep normal web/native outputs unchanged. This target produces files only; publication remains a separate change using the standard build system.

Co-authored-by: Copilot <[email protected]>
Allow the current-main shared registrations after inspecting their activation boundaries. Document isolated packaging, source identity and experimental size guardrails without changing the existing size limits.

Co-authored-by: Copilot <[email protected]>
Restore required shared composer, policy continuation, artifact, and MCP OAuth registrations. Reuse provider-aware custom agent normalization across both pickers, suppress stale background notifications after permission requests, and handle rejected pull-to-refresh operations.

Co-authored-by: Copilot <[email protected]>
The corrected package measures 5,950,374 initial and 14,320,714 runtime gzip bytes. Keep size enforcement with a small reviewed allowance over those measurements; leave the extension limit and dependency isolation intact. Include the required shared composer registration.

Co-authored-by: Copilot <[email protected]>
Use required entry-selected repository, list and edit presentations. Keep input sizing in component options and clipboard behavior in entry registrations, preserving ordinary UI and async lifetimes.

Co-authored-by: Copilot <[email protected]>
Use focused entry-owned presentations, component input options, and dedicated clipboard registration. Preserve automation prompt metrics and keep normal and mobile implementations isolated.

Co-authored-by: Copilot <[email protected]>
Keep the tested mobile source unchanged and add a regression check for clipboard registration after restoration.

Co-authored-by: Copilot <[email protected]>
Reject ordinary entry-owned presentation implementations in the mobile package, and cover the added boundaries with the existing package tests.

Co-authored-by: Copilot <[email protected]>
Bring in current main, including the sticky request bubble test fix from #345320. Preserve both presentation and pinned canvas services.

Co-authored-by: Copilot <[email protected]>
Retain per-page stylesheet discovery using the dependency-free upstream collector.

Co-authored-by: Copilot <[email protected]>
Use the shared lockfile fixture and hoisted dependency metadata after merging the upstream pnpm migration.

Co-authored-by: Copilot <[email protected]>
Normalize new-group and rename results at the shared list boundary, with coverage for whitespace and disposed lists. Register the default chat edit presentation in fixture services and support its editor-open requests.

Co-authored-by: Copilot <[email protected]>
Track newly created Quick Input widgets by identity instead of assuming the shared test document is empty. Seed four unrelated hidden widgets to cover full-suite execution without weakening the no-fallback assertion.

Co-authored-by: Copilot <[email protected]>
Use DOM events with local touch coordinates instead of native Touch constructors, which WebKit rejects. Preserve both touchend and touchcancel rejection and indicator-reset assertions.

Co-authored-by: Copilot <[email protected]>
Merge main at 498770f. Preserve reactive chat font sizing and live height calculation while honoring explicit presentation metrics, with regression coverage for mobile overrides.

Co-authored-by: Copilot <[email protected]>
Base automatically changed from osortega/agents/mobile-stack/02-workbench to main November 10, 2026 23:38
Keep the landed mobile workbench unchanged while updating the isolated package target's dependency boundaries and pnpm dependency-source handling.

Co-authored-by: Copilot <[email protected]>
Published dependency maps can reference sources above their installed package root. Match those pnpm store entries to already-enumerated dependencies instead of treating the virtual store as a package; fail explicitly when no dependency supplies the license.

Cover the published-map shape in both dependency layouts and reject unidentified store entries.

Co-authored-by: Copilot <[email protected]>
Keep background rendering, settings, actions, tint and appearance tools in the regular entry through the existing chat-view factory. Exclude mobile background media and the built-in generation skill without hiding user-authored skills or changing the ordinary workbench.

Co-authored-by: Copilot <[email protected]>
Allow the reviewed current-main package after excluding chat backgrounds, while retaining the other budgets and dependency checks. Mark these limits as temporary and explicitly note that they must be lowered to improve the mobile experience.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 02:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The mobile resource list omits retained built-in skills, causing packaged commands such as /commit, /create-pr, and /code-review to disappear.

1 open issue
What changed in this PR

Adds an opt-in mobile package to VS Code’s esbuild tooling, building on the isolated mobile Agents entry. It also separates optional chat backgrounds from shared components so mobile can omit the feature without changing regular Agents behavior.

Changes:

  • Packages mobile-specific localization, selected extensions, workers, and runtime libraries.
  • Enforces output ownership, dependency boundaries, integrity metadata, and preview size limits.
  • Moves background presentation and registrations to the regular entry, with isolation and regression tests.
File Description
src/​vs/​workbench/​contrib/​sessions/​browser/​parts/​sessionsGridContent.ts Delegates grid backgrounds to the entry-selected factory.
src/​vs/​workbench/​contrib/​sessions/​browser/​parts/​chatView.ts Defines optional background presentation contracts.
src/​vs/​workbench/​contrib/​sessions/​browser/​chatViewFactory.ts Adds optional grid-background creation.
src/​vs/​workbench/​contrib/​sessions/​browser/​chat/​defaultChatViewFactory.ts Supplies regular-entry backgrounds and replicas.
src/​vs/​workbench/​contrib/​sessions/​browser/​chat/​chatView.ts Uses injected background presentation options.
src/​vs/​sessions/​test/​browser/​sessionViewTestUtils.ts Preserves backgrounds in shared test fixtures.
src/​vs/​sessions/​MOBILE.md Documents background ownership and isolated packaging.
src/​vs/​sessions/​contrib/​mobile/​test/​browser/​mobilePresentation.test.ts Tests mobile background exclusion and factory options.
src/​vs/​sessions/​contrib/​mobile/​browser/​mobilePromptsService.ts Filters the built-in background-generation skill.
src/​vs/​sessions/​contrib/​mobile/​browser/​mobile.contribution.ts Registers mobile prompts and tailored accessibility help.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sessionsChatAccessibilityHelp.test.ts Checks that mobile help omits unavailable controls.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​chatView.test.ts Adapts background tests to the factory contract.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​appearanceTools.test.ts Tests skill exclusion while preserving workspace skills.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsChatAccessibilityHelp.ts Makes background guidance composition-dependent.
src/​vs/​sessions/​contrib/​chat/​browser/​chatBackground.contribution.ts Extracts background actions, settings, and services.
src/​vs/​sessions/​contrib/​chat/​browser/​chat.desktop.contribution.ts Registers regular-entry backgrounds and help.
src/​vs/​sessions/​contrib/​chat/​browser/​chat.contribution.ts Removes background-specific shared registrations.
package.json Adds mobile packaging and test commands.
build/​next/​test/​mobilePreview.test.ts Tests packaging, boundaries, budgets, and output safety.
build/​next/​resources.ts Defines an independent mobile resource list.
build/​next/​mobilePreviewPolicy.json Specifies dependencies, extensions, libraries, and budgets.
build/​next/​mobilePreview.ts Implements package preparation, validation, and inventory.
build/​next/​MOBILE.md Documents package contents, safeguards, and limitations.
build/​next/​index.ts Integrates mobile bundling and isolated localization.
build/​lib/​test/​sessionsPresentationDependencies.test.ts Checks background module and asset isolation.
build/​lib/​esbuild.ts Adds the mobile target without native bootstraps.

Review effort: Balanced

Comment thread build/next/resources.ts Resolved
Use mobile consistently for the target, build and test commands, package output, manifest, policy and helpers. Keep release quality and rollout separate from the target name, without changing the existing size limits or package boundaries.

Co-authored-by: Copilot <[email protected]>
Copy the built-in skill definitions consumed by MobilePromptsService while excluding background generation. Cover retained commands, the excluded skill and unrelated files with a resource-inventory regression test.

Co-authored-by: Copilot <[email protected]>
Reuse the shared prompts service and package the same skill definitions as desktop. Keep background tools, controls, rendering and media excluded; the existing skill already explains when required tools are unavailable.

Co-authored-by: Copilot <[email protected]>
@osortega
Osvaldo Ortega (osortega) marked this pull request as ready for review November 11, 2026 03:20
Osvaldo Ortega (osortega) added a commit that referenced this pull request Nov 11, 2026
Bring #345370 onto the current #345369 mobile target. Align archive and CDN paths with mobile.json, preserve the upstream Web archive retry guard, and apply that same guard to the optional mobile archive.

Co-authored-by: Copilot <[email protected]>
@osortega
Osvaldo Ortega (osortega) merged commit b1e880f into main Nov 11, 2026
53 of 54 checks passed
@osortega
Osvaldo Ortega (osortega) deleted the osortega/agents/mobile-stack/03-build branch November 11, 2026 04:28
@vs-code-engineering vs-code-engineering Bot added this to the 1.147.0 milestone Nov 11, 2026
Osvaldo Ortega (osortega) added a commit that referenced this pull request Nov 11, 2026
Resolve the documentation conflict after #345369 landed, preserving the mobile build instructions and optional publication section. The remaining PR diff contains only the reviewed publication changes.

Co-authored-by: Copilot <[email protected]>
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.

3 participants