Skip to content

🤖 refactor: skill write tools and the catalog clone use HostFiles and HostPaths - #7338

Merged
ThomasK33 merged 1 commit into
phase5/a-skill-readfrom
phase5/a-skill-write
Oct 23, 2026
Merged

ThomasK33 merged 1 commit into
phase5/a-skill-readfrom
phase5/a-skill-write

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

5a PR 7 of phase 5 (Loop host I/O) of the agent-loop refactor. The skill write tools and the skills catalog clone now use HostFiles and HostPaths (#7319) for their file calls. tools/agent_skill_delete.ts, tools/agent_skill_write.ts and tools/skillsCatalogFetch.ts import no fs/promises or os any more, so their 4 frozen pairs of local/no-host-imports leave the allow map. The map goes from 37 pairs in 23 files (5a PR 6, #7329) to 33 pairs in 20 files. Behavior does not change: each call goes to the Node layers, which read the node:fs/promises and node:os namespaces at call time.

Order

This PR is stacked on 5a PR 6 (#7329), as in the plan. It does not use code from #7329, but both PRs remove neighboring lines of the same allow map. 5a PRs 3 and 4 still wait for #7277, and this PR changes none of their files.

Implementation

  • tools/agent_skill_delete.ts, tools/agent_skill_write.ts: nodeHostFiles.promises in place of the fs/promises namespace import.
  • tools/skillsCatalogFetch.ts: the named fs/promises imports (lstat, mkdtemp, readFile, readdir, realpath, rm, stat) become nodeHostFiles.promises calls, and tmpdir() becomes nodeHostPaths.tmpDir(). The git and fetch calls stay. 5a PR 9 moves them onto HostProcesses.
  • tools/agent_skill_write.test.ts:2 imports node:os as a namespace, like agentSkillsService.ts since 🤖 refactor: skill read tools use HostFiles and HostPaths #7329. The test's spyOn(os, "homedir") then reaches the home that agentSkillsService.ts reads, so the test no longer reads the real ~/.mux/skills. A scratch probe showed that the test also passes with the old default import, because the real home holds no skill of that name. So no assertion detects this change.
  • eslint.config.mjs, .oxlintrc.json and scripts/noHostImports.test.ts: the 4 pairs leave the allow map and the frozen list.

Validation

  • bun test of the plan's list (agent_skill_delete, agent_skill_write, skillsCatalogFetch, plus scripts/noHostImports.test.ts): 124 pass, 0 fail. The 16 spyOn(fsPromises, ...) spies of skillsCatalogFetch.test.ts still control the clone directory and the reads, so the namespace calls reach them.
  • An import scan with the module list of local/no-host-imports (phases 2 and 4 included): 39 pairs in 23 files before, 35 in 20 after.
  • make typecheck, make static-check, make lint-eslint.
  • make test (host suite lock, host load average near 66): 27699 pass, 7 skip, 4 fail. All 4 were 5-second timeouts. Alone, under the lock, compactionPreparationLifecycle.test.ts and agentPlugins/installService.installMethods.test.ts pass 104 of 104.
  • The ui line (scripts/ tests and the others of CI's line): 726 pass, 0 fail.
  • Loop-test tripwire, 3 runs against 5a PR 6 (b03fa1a): 0 trips.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $74.48

@ThomasK33
ThomasK33 added this pull request to stack #7339 October 23, 2026 11:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T11:47:41.967815Z e8fbcb9 Manual request
🔒 Security Review ✅ Completed 2026-10-23T11:49:33.134533Z e8fbcb9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: e8fbcb9de2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: e8fbcb9de2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

27 agent steps · 7 replayed from cache · 32 model calls · 229.8k tokens (71% cached)
Spend: $0.10 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 2 steps · 5 calls 26.1s
🟢 a chat survives a restart of the server 2 steps · 5 calls 26.1s
🟢 compaction.e2e.ts · 1 passed 3 steps · 7 calls 47.7s
🟢 /compact replaces the old chat with a summary 3 steps · 7 calls 47.7s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 9.7s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 9.7s
🟢 settingsRoundTrip.e2e.ts · 1 passed 3 steps · 5 calls 30.2s
🟢 a chat survives trips through Settings 3 steps · 5 calls 30.2s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 5.6s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 5.6s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.6s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.6s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 6.9s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 6.9s
🟢 todoNudge.e2e.ts · 1 passed 2 steps · 4 calls 25.8s
🟢 the agent finishes open TODO items after the turn-end nudge 2 steps · 4 calls 25.8s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 27.7s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 3.7s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.2s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 6.3s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 6.8s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.5s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 3.2s

e2e 0.20.0 · 3m 5s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 8.1k tokens (21% cached)
Spend: $0.02 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 6.3s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 6.3s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 6.5s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 6.5s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 5.0s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 5.0s

e2e 0.20.0 · 19.8s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 24f5c93 Oct 23, 2026
37 of 38 checks passed
@ThomasK33
ThomasK33 deleted the phase5/a-skill-write branch October 23, 2026 12:17
azaj01 pushed a commit to azaj01/mux that referenced this pull request Oct 25, 2026
…eof (coder#7351)

## Summary

5a PR 3 of phase 5 (Loop host I/O) of the agent-loop refactor.
Agent-loop tools no longer use `instanceof LocalBaseRuntime` or
`instanceof RemoteRuntime`. They read a new `Runtime.location` field
instead. So `tools/bash.ts`, `tools/skillFileHint.ts` and
`tools/agent_skill_read_file.ts` no longer import a runtime class, and
their 3 frozen pairs of `local/no-host-imports` leave the allow map. On
main (7265ac0) the map holds 22 pairs in 13 files. On this branch it
holds 19 pairs in 11 files. Every runtime gives the same answer as
`instanceof` did, so behavior does not change.

## Order

The plan order of stack 5a is PR 1 to PR 14. This PR waited for phase 3
PR 8 (coder#7277, merged at 11:41 UTC), because `bash.ts` changed there. 5a
PRs 5, 6 and 7 (coder#7319, coder#7329, coder#7338) merged before this PR. They change
no source file of this PR. coder#7329 and coder#7338 removed neighboring allow-map
lines, so merge commit d156ebc keeps the deletions of both sides. 5a
PR 4 is stacked on this PR.

## Implementation

- `runtime/Runtime.ts`: optional `readonly location?: "local" |
"devcontainer" | "remote"`, and two helpers.
`isLocalBaseRuntime(runtime)` is true for "local" and "devcontainer".
`isRemoteRuntime(runtime)` is true for "remote".
- `LocalBaseRuntime.ts`, `DevcontainerRuntime.ts`, `RemoteRuntime.ts`:
`location` is a prototype getter. Subclasses and the
`Object.create(...prototype)` doubles of tests inherit it.
`MultiProjectRuntime` and plain object doubles leave it absent, and
`instanceof` is false for them too.
- `tools/bash.ts:1041` and `:1064`, `tools/skillFileHint.ts`,
`tools/agent_skill_read_file.ts`: the helpers in place of `instanceof`.
- `utils/ipAddress.ts`: one more change (commit 4927205). The check
of the impossible `net.isIP` answer now uses the shared `assert` helper
instead of a hand-written `throw`, as the repo's assertion style asks.
It changes no reachable path.
- `eslint.config.mjs`, `.oxlintrc.json` and
`scripts/noHostImports.test.ts`: the 3 pairs leave the allow map and the
frozen list.

## Validation

- `src/node/runtime/runtimeLocation.test.ts` (new): a table of 12
runtime classes (the 8 runtime classes, `MultiProjectRuntime` and the 3
test doubles of `tools/testHelpers.ts`). For each class,
`isLocalBaseRuntime` and `isRemoteRuntime` give the `instanceof` answers
on an `Object.create` instance. A runtime without `location` takes
neither branch.
- `bun test` of the plan's list (`src/node/runtime/`, `bash`,
`skillFileHint`, `agent_skill_read_file`) plus `ipAddress.test.ts` and
`scripts/noHostImports.test.ts`: 760 pass, 0 fail.
- `make typecheck`, `make static-check`, `make lint-eslint`.
- `make test` (host suite lock), on head b2593a1 (main b3911c8
merged in, before the merge of the current main): 27765 pass, 7 skip, 0
fail, and every isolated file passes.
- The ui line on that head: 732 pass, 0 fail.
- Loop-test tripwire on that head, 3 runs against main: 0 trips.
- After merging main (d156ebc): `make typecheck`, `make
static-check`, `make lint-eslint` and the targeted list (760 pass)
again. 5a PR 4 contains this tree, and its full gates ran on its final
head.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high` • Cost: `$85.60`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high
costs=85.60 -->
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