Skip to content

refactor(vscode): move the extension to vscode/ and skip the Python CI for extension-only changes - #126

Merged
zy1233 merged 2 commits into
feat/vscode-markdown-renderfrom
refactor/move-vscode-to-root
Nov 13, 2026
Merged

zy1233 merged 2 commits into
feat/vscode-markdown-renderfrom
refactor/move-vscode-to-root

Conversation

@zy1233

@zy1233 zy1233 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #124. Merge #124 first. When its branch is deleted, GitHub moves this PR to main. This PR shows only its own two commits against #124.

Summary

Commit Change
fe25785 The extension moves from packages/pi-vscode/ to vscode/
a67d0ad ci.yml skips Ruff and pytest for a change that only touches the extension or the docs (can be dropped alone)
 /
 ├── packages/            # the Python packages: each has a pyproject.toml
 │   ├── pi-agent-cli/  pi-agent-harness/  pi-dynamic-workflows/
 │   ├── pi-goal-x/     pi-mcp/            pi-web-access/
-│   └── pi-vscode/       # TypeScript, no pyproject.toml, in no list
 ├── tui/                 # own CI
 ├── web/                 # own CI
+├── vscode/              # own CI (vscode-extension.yml)

packages/ is the Python part of the repository: the uv workspace and the pytest testpaths in pyproject.toml name its packages one by one. web/ and tui/ are already at the root.

The move alone does not stop the unneeded CI. ci.yml had no paths filter, so every pull request ran Ruff and pytest on three Python versions (about 15 minutes of runner time), also one that only changes web/. The second commit is the fix:

on:
  pull_request:          # and the same list for push to main
    paths:
      - "**"
      - "!vscode/**"
      - "!docs/**"
      - "!.github/workflows/vscode-extension.yml"
      - "**/*.py"        # Ruff reads 3 Python files inside vscode/
changed files                                   ci.yml (Ruff, pytest)
only vscode/** (no .py), docs/**, extension workflow   skipped
a .py file, anywhere (also in vscode/)                 runs
any other file (AGENTS.md, README.md, ci.yml ...)      runs

What the move changed (the rest is 80 pure renames):

vscode/scripts/lib.mjs                REPO_ROOT          ../..  ->  ..
vscode/test/packaging.test.ts         path of workflow   ../../.github  ->  ../.github
vscode/test/real-*.test.ts (3)        repo root          ../../..  ->  ../..
vscode/package.json                   repository.directory   packages/pi-vscode -> vscode
vscode-extension.yml                  trigger path, 8 x working-directory, artifact path
                                      3 x ../../vsix/  ->  ../vsix/    (no "pi-vscode" in the text)
README.md, AGENTS.md, design document (D38, D39), the agent-context record   the new folder

Kept: the workflow file name vscode-extension.yml and the environment vscode-publish. Both registries name them (with the repository), not a folder, so the trusted publishers stay valid.

Evidence

Before: a search for pi-vscode finds 12 mentions in the workflow. It does not find three more paths that depend on the folder: ../../vsix/*.vsix. Two of them are in the publish job, which does not run in a pull request. A wrong value there shows only in a real release.

After: a test reads the workflow and the real layout (points every path of the workflow at the real layout).

every working-directory == "vscode", trigger "vscode/**", artifact "vscode/out/*.vsix"
every ../vsix hop resolves to <repo>/vsix

mutation: edit the workflow, run the test, restore the file byte for byte
  last publish step   ../vsix -> ../../vsix            test fails
  one working-directory -> packages/pi-vscode          test fails
  trigger path -> packages/pi-vscode/**                test fails
  artifact path -> packages/pi-vscode/out/*.vsix       test fails

Tests

  • Windows, Node 24: npm run check = typecheck + eslint + 334 tests passed (333 before, and the new one). 18 skipped (opt-in). The same counts as before the move.
  • real-agent.test.ts (opt-in, the real Python agent) passes on Windows: 7 tests. The other two opt-in files need Linux. A script checks that all three compute the repository root with ../...
  • npm run notices (production build) passes. REPO_ROOT finds LICENSE and web/public/favicon.svg.
  • Git: 80 pure renames, 8 renames with a small edit, 5 edits (53 lines added, 35 removed).
  • Filter: every workflow parses as YAML. A model of the documented rule (the patterns in order, ! takes out, a later pattern puts back), run on 18 paths and 7 sets of paths: the files of feat(vscode): render Markdown in the chat and enrich the status row #124 are skipped, the 3 Python files run, "extension + AGENTS.md" runs.
  • Filter on GitHub: a throwaway pull request on top of this branch (test: probe the paths filter of ci.yml (do not merge) #127, now closed, branch deleted). One line changed in vscode/PACKAGING.md, in one docs/ file and in vscode-extension.yml: only VS Code extension started, CI did not. After one more commit (a docstring line in vscode/scripts/python_licenses.py): CI started.
  • CI of this pull request: all green. Ruff. pytest on 3.11, 3.12 and 3.13. vscode-extension.yml: type check, lint and unit tests, VSIX linux-x64, and the smoke test that starts the agent from ../vsix/*.vsix. Publish is skipped, as it must be.
  • Dry run of the release workflow on this branch with publish=false (run 43355249352): the five targets (linux-x64, linux-arm64, darwin-arm64, darwin-x64, win32-x64) build, the smoke test passes, Publish is skipped. Nothing was published.

Not verified

  • The push form of the filter (a merge to main). It has the same patterns as the pull_request form that the probe tested. This PR changes ci.yml, so it runs the Python CI itself.
  • A real publish from the new folder. The publish job runs from main with a reviewer. Its edits are of the same two kinds as in the jobs that CI runs (working-directory, ../vsix), and the new test checks them. A wrong ../vsix would point at no file, so the step would fail and nothing would be uploaded.

Merge Danger

Door: two-way. A revert moves the folder back, and Git keeps the history of each file. No change of the wire, the agent, the pins (agent-assets.json), stored data or the registry entries.

Blast Radius: links and open work, not behaviour.

  • Old GitHub links to packages/pi-vscode/... stop working (GitHub does not redirect a folder). The README of 1.0.0 names the old folder as plain text, and no shipped link points into it.
  • feat(vscode): render Markdown in the chat and enrich the status row #124 is the only open pull request that touches the extension. This PR is stacked on it. If this PR merges first, feat(vscode): render Markdown in the chat and enrich the status row #124 needs a rebase.
  • The filter can only hurt if it skips a run that should run. It skips only vscode/ without .py, docs/, and one workflow file. No Python test reads them, and Ruff excludes docs. No check is required on main, so a skipped run blocks no merge. Drop the second commit to keep the old behaviour.
  • On Windows an editor can lock the old folder. Here the file watcher locked src and node_modules; I moved the files one by one. Reinstall with npm ci in vscode/.

sim added 2 commits November 13, 2026 10:45
packages/ holds the Python packages: each has a pyproject.toml, and the uv
workspace and the pytest paths name them one by one. The extension is not
Python and is in neither list. web/ and tui/ are at the root for the same
reason, and each has its own CI, as the extension has.

No file changes inside the extension (80 pure renames, 8 renames with a
small edit). What the new place needed:

- scripts/lib.mjs: REPO_ROOT is one folder up now (package.mjs reads
  LICENSE from it, make-icon.mjs reads web/public/favicon.svg).
- test/packaging.test.ts reads the workflow; real-agent, real-first-run
  and real-thinking find the repository with ../.. (was ../../..).
- package.json: repository.directory is vscode.
- vscode-extension.yml: the trigger path, 8 working-directory values, the
  artifact path, and three ../../vsix/ paths (now ../vsix/). The three have
  no "pi-vscode" in the text, so a search by name misses them. Two of them
  are in the publish job, which does not run in a pull request.
- README.md, AGENTS.md, the design document (decision D38) and the record
  of the agent context usage name the new folder.

A new test (points every path of the workflow at the real layout) checks
the folder, the trigger path, the artifact path and every ../vsix hop
against the real layout. Four wrong values of the workflow (the old folder
in a working-directory, in the trigger and in the artifact path, and
../../vsix in the last publish step) each make it fail.

The workflow file name (vscode-extension.yml) and the environment
(vscode-publish) do not change: the two registries name them, not a
directory. This commit does not change which CI runs: ci.yml has no paths
filter.
…ension or the docs

ci.yml had no paths filter, so every pull request ran the whole Python CI
(Ruff, and pytest on three Python versions: about 15 minutes of runner
time), also a pull request that only changes vscode/ or web/. Moving the
extension to the root does not change that. This does.

The filter is a `paths` list with `!` patterns, on push and on
pull_request:

    - "**"
    - "!vscode/**"
    - "!docs/**"
    - "!.github/workflows/vscode-extension.yml"
    - "**/*.py"

GitHub reads the patterns in order: a `!` pattern takes a file out, and a
later positive pattern puts it back. The workflow runs when at least one
changed file is left in. So:

- Only vscode/, docs/ and the extension workflow, with no .py file: skipped.
  (The extension has its own workflow.)
- Any .py file runs it. This matters: Ruff reads three Python files inside
  vscode/ (scripts/python_licenses.py, test/support/fake_model.py,
  test/support/pty_answers.py). A paths-ignore on vscode/** would skip them.
- Any other file runs it, also AGENTS.md, README.md and ci.yml itself.

Why it is safe:

- No check is required on main (the ruleset only forbids a deletion and a
  force push), so a skipped run blocks no merge.
- docs/ has Markdown only, and it is in `extend-exclude` of Ruff and outside
  `testpaths` of pytest. No Python test reads vscode/ or docs/.

Checked: every workflow parses as YAML, and a model of the documented rule
(patterns in order) gave the expected result for 18 single paths and 7 sets
of paths, among them the files of the pull request 124 (skipped), the three
Python files (run) and "extension + AGENTS.md" (run). Not verified: the
effect on GitHub. This commit changes ci.yml, so its own pull request runs
the workflow. The first pull request that touches only the extension shows
the effect.

AGENTS.md: the row of vscode/ said that ruff does not read the extension.
It reads the three Python files. The row says so now, and says what the
filter does. Design document: decision D39.
@zy1233
zy1233 merged commit 2b28720 into feat/vscode-markdown-render Nov 13, 2026
20 checks passed
@zy1233
zy1233 deleted the refactor/move-vscode-to-root branch November 13, 2026 06:59
zy1233 added a commit that referenced this pull request Nov 13, 2026
…124)

Chat answers are drawn as Markdown. markdown-it is a parser only: raw HTML stays text, an image is not loaded (it shows as a link), and a link opens through the host for http, https and mailto only. A streamed answer is drawn at most once each 80 ms. The status row shows the turn time and the folder. It also shows the context use when an agent sends usage_update (agent 0.9.1 does not). The record of the agent side is docs/specs/2026-11-13-agent-context-usage.md.

The extension moves from packages/pi-vscode/ to vscode/ in the same merge (#126). ci.yml skips Ruff and pytest for a change that only touches vscode/ without .py files, docs/ or vscode-extension.yml.

The version stays 1.0.0 and the CHANGELOG entry is Unreleased. No publish runs on this merge.
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.

1 participant