Skip to content

feat(*): load portable Agent Plugins 1.0 packages and their MCP servers - #1110

Merged
0xKT merged 28 commits into
mainfrom
feat/agent_plugins_loader
Oct 27, 2026
Merged

0xKT merged 28 commits into
mainfrom
feat/agent_plugins_loader

Conversation

@LivXue

@LivXue LivXue commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Raven learns to read the portable Agent Plugins 1.0 package format: a directory whose root holds a plugin.json that validates against the official manifest schema, with optional skills/ and mcp.json components. It is data only, and it is not the kernel plugin kind (raven-plugin.toml, Python factories that run inside the host), so it lives in its own raven/agent_plugins/ subsystem with its own trust story.

Skills. A package's skills are discovered exactly as the format defines them (the fixed skills/ location, immediate children only), validated against the Agent Skills rules (name rules, name equals directory name, description bounds), and imported into the workspace skill tree under <workspace>/skills/<package name>/. One directory per package mints one source label per package in the pool, so two packages may ship the same skill name without either shadowing the other. The copy is recorded in a ledger (<home>/agent-plugins.json), so remove deletes only directories the ledger claims and check reports a package that changed since the import. Re-importing removes the skills the package no longer ships; when a copy cannot be deleted the import reports the failure and keeps the ledger's claim on it, so a later remove can still clear it.

Trust. A package cannot put text into every turn: the always flag is dropped from the imported copy. A skill on skillForge.blocklist, or one whose body points at another product's home directory, is refused. A target directory the ledger does not own is never written into: a package directory that already exists and is not the ledger's refuses the whole import, and a skill directory that is not the ledger's is skipped and reported. A package may not take a name the skill layers use (workspace, external, builtin): that directory is a pool source label, and a package there would answer as the layer and shadow a shipped skill.

MCP. A package's mcp.json is read and its entries validated against the format's three closed variants (stdio, Streamable HTTP, legacy HTTP+SSE). The configuration's $schema has to name the same Agent Plugins version the package manifest does; a mismatch disables MCP for that package and leaves its skills alone. One unusable entry never takes the others down. The composed server names are <package>__<server>, they run with the package root as their working directory and with PLUGIN_ROOT and PLUGIN_DATA in their environment, and the format's two placeholders are expanded in their arguments, environment and working directory only. Under a sandboxed executor every one of those paths is translated to its guest mount, and the package data root is mounted at /plugin-data when a package stdio server is configured, so PLUGIN_DATA resolves inside the VM. A package's server is a process on the operator's machine, so it starts only for a package named in agentPlugins.mcpPackages; without that, the configuration is parsed, validated and reported and nothing runs.

Surface. raven agent-plugins list | inspect | import | remove | check, each with --json; the new agentPlugins config block (packages, disabled, mcpPackages). MCPServerConfig gained cwd, which the stdio transport passes to the MCP SDK; the boxlite executor translates it, together with the server's command, arguments and environment, to their guest mounts, and refuses a working directory outside every mounted volume by name rather than launching the server in the wrong directory. The loop keeps the package layer apart from the host's own servers, so a live answer about the host's servers never drops them.

Design and reasoning: docs/specs/2026-10-25-agent-plugins-loader-design.md. Operator page: docs-site/docs/agent-plugin-packages.md (and its Chinese page). The vendored official manifest schema sits under schemas/agent-plugins/1.0.0/ with a NOTICE naming its source and licence.

Type

  • Fix
  • Feature
  • Docs
  • CI / tooling
  • Refactor
  • Other

Verification

  • Relevant tests pass locally
  • Relevant lint / type checks pass locally
  • User-facing docs or screenshots are updated when needed
# From the head tree, with the workspace virtualenv and the everos plugin on PYTHONPATH.
python -m pytest tests/test_sandbox_unit.py tests/test_agent_plugins_manifest.py \
  tests/test_agent_plugins_package.py tests/test_agent_plugins_ledger.py \
  tests/test_agent_plugins_skills.py tests/test_agent_plugins_mcp.py \
  tests/test_cli_agent_plugin_commands.py tests/test_mcp_client.py \
  tests/test_mcp_client_transport.py tests/test_mcp_endpoint.py \
  tests/test_agent_loop_mcp_sync.py tests/test_core_runtime_swap.py \
  tests/test_agent_loop_workdir.py tests/test_subagent_workdir.py \
  tests/integration/test_agent_plugins_e2e.py tests/integration/test_agent_plugins_mcp_e2e.py -q
479 passed

python -m pytest tests/test_market.py tests/test_acp_npx_fetch.py -q     -> 174 passed

# Each fix's regression was watched failing before the fix.

ruff check raven evolver agents plugins-dist tests scripts docs-site    -> All checks passed
ruff format --check raven evolver agents plugins-dist tests scripts docs-site
                                                                        -> 2459 files already formatted
ty check raven                                                          -> All checks passed
lint-imports                                                            -> 10 kept, 0 broken
python -m pytest tests/test_living_docs.py -q                           -> 2 passed
python scripts/check_source_language.py origin/main..HEAD               -> exit 0
python scripts/check_large_files.py origin/main..HEAD                   -> exit 0
python scripts/check_commit_messages.py origin/main..HEAD               -> exit 0

End-to-end, not just unit tests:

  • A fixture package ships a FastMCP stdio server; package_mcp_layer composes it, MCPConnectionManager connects it, the tool is callable, and the child process reports the package root as its working directory plus both plugin variables.
  • Against the real agentic-awesome-skills repository (sparse clone, all 30 bundles): 30 packages imported, 365 of 368 skills loaded, 3 refused by the foreign-home lint (environment-setup-guide, ethical-hacking-methodology, writing-skills), and raven agent-plugins check reports every package as current.

tests/test_config_loader.py has 19 failures on this Windows box that are present at the base commit as well (verified by stashing this branch's changes); they are unrelated to this PR.

Risk

  • Security impact considered

  • Backward compatibility considered

  • Rollback path is clear for risky changes

  • A package's skills are third-party instructions that reach the model. That is what a skill is; the mitigations are the dropped always flag, the operator blocklist, the foreign-home lint, and the rule that nothing is imported over a directory the ledger does not own.

  • A package's MCP server is a process on the operator's machine, so it needs an explicit per-package opt-in (agentPlugins.mcpPackages). With no opt-in nothing is started.

  • MCPServerConfig.cwd defaults to the empty string, so every existing tools.mcpServers entry behaves exactly as before. A stdio server that names a working directory inside a mounted volume runs there, with its command, arguments and environment translated to guest paths; a directory outside every mounted volume is refused with a reason instead of being launched in the wrong directory. A caller that supplies its own executor owns that executor's mount table and has to mount the package data root at /plugin-data itself.

  • Imported skills live in the workspace and the ledger in the Raven home; neither is inside this repository, and raven agent-plugins remove <package> deletes what the ledger claims. Reverting the squash commit leaves an empty agentPlugins config and a dormant loader.

  • This is not a conformance submission to the Agent Plugins client directory, and it deliberately does not read the host-native formats (.claude-plugin/, .codex-plugin/) or the repository's flat skills/ folder.

Related Issues

N/A

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking: preserve package containment, installed-skill ownership, and both host and sandboxed MCP behavior before merge.

I reviewed github/main...HEAD plus the affected callers and history. I covered the repository rules and canonical terminology, the full diff, CLI/runtime/MCP callers, live-reload and generation assembly behavior, backward compatibility for existing MCP servers, test-strength changes, and the documented package-boundary architecture. I found five concrete failures, marked inline.

Verification:

  • PYTHONPATH=plugins-dist/everos-memory uv run pytest tests/test_agent_plugins_manifest.py tests/test_agent_plugins_package.py tests/test_agent_plugins_ledger.py tests/test_agent_plugins_skills.py tests/test_agent_plugins_mcp.py tests/test_cli_agent_plugin_commands.py tests/integration/test_agent_plugins_e2e.py tests/integration/test_agent_plugins_mcp_e2e.py -q - 189 passed.
  • PYTHONPATH=plugins-dist/everos-memory uv run pytest tests/test_agent_loop_mcp_sync.py tests/test_mcp_client.py tests/test_mcp_client_transport.py tests/test_core_runtime_swap.py -q - 80 passed.
  • scripts/check_source_language.py github/main...HEAD and scripts/check_large_files.py github/main...HEAD both passed when run directly through uv (make is unavailable in this environment).
  • The first test attempt could not collect because the plain dev environment omitted raven_everos; rerunning with its workspace source on PYTHONPATH produced the results above.

Comment thread raven/agent/loop/mcp_glue.py Resolved
Comment thread raven/mcp/client.py Resolved
Comment thread raven/agent_plugins/skills.py Resolved
Comment thread raven/agent_plugins/skills.py Resolved
Comment thread raven/core/runtime.py Resolved
@LivXue

LivXue commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

@d:/tmp/pr-note.md

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking: finish sandbox path translation and preserve ledger ownership when stale-skill deletion fails.

I reviewed the complete 82712ca..c79a119 delta and rechecked its surrounding MCP, sandbox, package import, CLI, and generation-assembly callers. I also checked the repository rules and canonical terms, backward compatibility for host MCP configurations, the new tests for weakening or gaps, and the package-containment/runtime architecture.

Three prior blockers are resolved and their threads are closed: the live no-answer sentinel, package descendant containment, and host/package MCP name collisions. Two threads remain open because the original failures are only partially fixed:

  • Boxlite translates the package cwd but still receives host-absolute package commands, placeholder-expanded arguments, and environment paths.
  • Stale cleanup ignores deletion errors, reports success, and lets the next ledger write forget a directory that remains on disk.

Verification:

  • PYTHONPATH=plugins-dist/everos-memory uv run pytest tests/test_agent_loop_mcp_sync.py tests/test_agent_plugins_manifest.py tests/test_agent_plugins_package.py tests/test_agent_plugins_ledger.py tests/test_agent_plugins_skills.py tests/test_agent_plugins_mcp.py tests/test_cli_agent_plugin_commands.py tests/test_mcp_client.py tests/test_mcp_client_transport.py tests/test_sandbox_unit.py tests/test_core_runtime_swap.py tests/integration/test_agent_plugins_e2e.py tests/integration/test_agent_plugins_mcp_e2e.py -q - 390 passed.
  • git diff --check github/main...HEAD passed.
  • Source-language and large-file gates passed when run directly through uv.
  • Both remaining failures were reproduced directly and documented in their existing threads.

@LivXue
LivXue force-pushed the feat/agent_plugins_loader branch from c79a119 to 3043207 Compare October 26, 2026 07:20
@LivXue
LivXue requested a review from gloryfromca October 26, 2026 07:20

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

I reviewed the current github/main...HEAD change, the two final fix commits and their callers, repository rules and canonical terminology, backward compatibility, test strength, and the package/MCP/sandbox architecture. Both remaining blockers are fixed: package paths are consistently translated into sandbox mounts, and failed stale-skill deletion retains ledger ownership and surfaces a command failure. I found no new blocker meeting the fourth-round bar.

All five threads I opened are now resolved.

Verification:

  • PYTHONPATH=plugins-dist/everos-memory uv run pytest tests/test_agent_loop_mcp_sync.py tests/test_agent_loop_workdir.py tests/test_agent_plugins_manifest.py tests/test_agent_plugins_package.py tests/test_agent_plugins_ledger.py tests/test_agent_plugins_skills.py tests/test_agent_plugins_mcp.py tests/test_cli_agent_plugin_commands.py tests/test_mcp_client.py tests/test_mcp_client_transport.py tests/test_mcp_endpoint.py tests/test_sandbox_unit.py tests/test_core_runtime_swap.py tests/integration/test_agent_plugins_e2e.py tests/integration/test_agent_plugins_mcp_e2e.py -q - 442 passed.
  • git diff --check github/main...HEAD passed.
  • Source-language and large-file gates passed through uv.

@LivXue
LivXue force-pushed the feat/agent_plugins_loader branch from 3043207 to d459ddc Compare October 26, 2026 07:29
@LivXue

LivXue commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

The commit messages check failed only on fix(agent_loop): ... (073bb9c53), whose scope is not in commitlint's enum. I rewrote that subject to fix(agent) and force-pushed; the tree is byte-identical to 30432078a0bd.

Because the rewrite replayed every later commit, the two fix commits named in the resolved threads now have new ids: the sandbox path translation is c15e02bd324f (was 846c371263f9) and the stale-skill retention is 4cee150562b1 (was e8d10949744e). The review evidence from 30432078a0bd still applies unchanged.

@LivXue
LivXue requested a review from gloryfromca October 26, 2026 07:29

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

The force-push changed commit history only: 30432078a0bd and d459ddce9b38 have the same tree object, and their tree diff is empty. The rewritten fix(agent): ... subject passes the repository's commitlint configuration. Because the code is byte-identical, the prior 442-test and repository-gate evidence applies unchanged. I also confirmed that all five review threads I opened remain resolved.

@0xKT

0xKT commented Oct 26, 2026

Copy link
Copy Markdown
Member

Merge conflict: @LivXue this PR no longer merges cleanly into main.

Measured just now with git merge-tree --write-tree of main 807de029 and this head d459ddce. Main moved with #1053 (fall back to mirrors when a download host cannot be reached), which changed how raven/mcp/client.py decides a launch mirror before fetching an npx package. Conflicting files: raven/mcp/client.py only.

After a rebase onto current main I re-check what moved before the grade comes back.

@gloryfromca

Copy link
Copy Markdown
Member

Blocking: rebase onto current main and resolve the raven/mcp/client.py conflict.

I independently confirmed the report against github/main at 807de029f: git merge-tree --write-tree HEAD github/main exits 1 with a content conflict in raven/mcp/client.py. This changes my standing stance from clean to blocker on mergeability only; the prior code findings remain settled. No tests were rerun because the branch tree has not changed and there is no resolved integration tree to test yet.

@LivXue
LivXue force-pushed the feat/agent_plugins_loader branch from d459ddc to 23333a4 Compare October 26, 2026 08:31
@LivXue

LivXue commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

Rebased onto 9efb879963a8. One conflict in raven/mcp/client.py: main now resolves a stdio server's command and arguments through mirrors.package_launch_async, and this branch passes cwd. The resolution composes both: the mirror-resolved command/args reach start_process and StdioServerParameters, with the configured working directory attached.

Main's _SpawningExecutor in tests/test_mcp_client_transport.py predated the cwd argument, so 23333a43e adds it and records the value (a host server still passes None). At this head the PR's 16-file suite is 455 passed, and ruff, format, ty, lint-imports, source-language, large-file and commit-message gates all pass.

@LivXue
LivXue requested a review from gloryfromca October 26, 2026 08:32
@gloryfromca

Copy link
Copy Markdown
Member

No blockers; this can merge as far as I am concerned.

Verified the rebase onto 9efb879963a8: current main is an ancestor and git merge-tree --write-tree HEAD github/main is clean. The conflict resolution preserves mains mirror-selected command and arguments while forwarding the package working directory, and the inherited fake now checks the added cwd value. The focused suite passes (414 tests), as do commit-message, source-language, large-file, and Ruff checks. This closes my mergeability objection.

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the rebase delta, conflict resolution, affected callers, history/range-diff, backward compatibility, test assertions, and the repository rules in AGENTS.md and CONTEXT.md; no new architecture issue or weakened test remains. The resolution composes main's mirror launch selection with the package cwd, current main is an ancestor, and the merge simulation is clean. Verification: 414 focused tests passed; commit-message, source-language, large-file, and Ruff checks passed. All five review threads I opened remain resolved.

@LivXue
LivXue requested a review from gloryfromca October 26, 2026 08:46

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the delta from the previously clean revision, including the mirror helper contract, callers, process-launch behavior, regression assertions, history, backward compatibility, and repository rules. Passing the configured server cwd into registry resolution aligns the mirror probe with the directory used for launch, and the new test verifies both values without weakening prior coverage. Current main remains an ancestor and the merge simulation is clean. Verification: 415 focused tests passed; commit-message, source-language, large-file, and Ruff checks passed. All five review threads I opened remain resolved.

@LivXue

LivXue commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

A background security review flagged the cwd alignment in 2e968b301: passing a package's configured directory into mirrors.package_launch_async lets a .npmrc inside third-party package content choose the registry and the payload. b57327864 reverts that part -- the probe runs without the cwd while start_process and StdioServerParameters still receive it, so the server runs where it was told to -- and refuses a cwd on a catalogue entry in market/vetting.py, mirroring the package loader's containment.

The regression now asserts the probe gets None and the executor still gets the configured directory; the market suite covers the catalogue refusal. At this head the PR's 16-file suite is 456 passed and the market/mirror suites are 174 passed.

@LivXue
LivXue requested a review from gloryfromca October 26, 2026 09:13

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the security delta against the mirror helper, PlugHub vetting path, portable-package trust model, callers, history, backward compatibility, and test assertions. Registry resolution no longer reads third-party package-root configuration, while the actual server process still receives its configured cwd; catalogue entries now independently reject a working directory, alongside the existing registry-changing environment and argument restrictions. The tests preserve both sides of that boundary without weakening prior coverage. Current main remains an ancestor and the merge simulation is clean. Verification: 544 focused tests passed; commit-message, source-language, large-file, and Ruff checks passed. All five review threads I opened remain resolved.

@LivXue
LivXue requested a review from 0xKT October 26, 2026 09:49
Comment thread raven/agent_plugins/skills.py Resolved
Comment thread raven/agent_plugins/manifest.py Resolved
Comment thread raven/agent_plugins/__init__.py Resolved
@0xKT

0xKT commented Oct 26, 2026

Copy link
Copy Markdown
Member

Not a blocker (non-blocking points and nits from the same acceptance pass on head b573278 onto main 9efb879; the three blocking points are in their own threads. This pass was read-only, so the test record is this PR's CI.)

Severity of this one finding, not a verdict on the pull request. Any blocking findings from this pass are review threads on the changed files; GitHub renders those collapsed, as a file name with no text.

Non-blocking:

  1. import (and inspect) re-walk the roots themselves, so the rules discover_packages owns do not apply there. Those rules are: disabled names are left out (package.py:136), and the first package wins a name collision (:138-144). cli/agent_plugin_commands.py:260-314 uses candidate_roots + load_package directly. As a result:
    • import <dir> copies a disabled package's skills;
    • two roots with the same manifest name are imported one over the other, and the second deletes the first's skills through _remove_stale_skills.
  2. The MCP opt-in is keyed by manifest name, and discovery gives that name to whichever configured package claims it first. Directory names need not match manifest names (package.py:106, mcp.py:436-448). In the documented "packages": ["/opt/agent-plugins"] layout, a sibling directory that sorts first and declares the opted-in name gets its command started instead.
  3. The ledger stores the source as typed. It is relative to the import's cwd (cli :259, package.py:77, cli :307). check from another directory then reports "missing", or fingerprints an unrelated tree. After import ., check from ~ rglobs the whole home directory (package.py:156-171).
  4. Ledger ownership is by name only (ledger.py:112-117). It records no workspace and no path. After a workspace change, or after the operator deletes <ws>/skills/<pkg> by hand, an import or remove can delete an operator's own same-named skill directory.
  5. A read-only SKILL.md breaks drop_always_flag after the copy is live. copy2 keeps a 0444 mode, and the write at skills.py:394 is unguarded. The import crashes before ledger.save() (cli :331), leaving an always-on, unowned copy in the pool.
  6. "Never code" contradicts the code. The new CONTEXT.md entry (:1773-1774), agent_plugins/__init__.py:5-6 and config/raven.py:2080 say a package contributes "never code". But ./ commands from the package run as the server process (mcp.py:198-205, client.py:223-232), and the design doc itself calls mcp.json arbitrary code execution from a third-party directory.
  7. The registry probe dropped cwd for every stdio server, not only package servers (b573278, mcp/client.py:219-221). The mirror decision now reads raven's process cwd (mirrors.py:644) while the server runs in cfg.cwd. In an npmjs outage, a configured server's own .npmrc registry is not seen by the decision.
  8. PLUGIN_DATA misses VM translation when RAVEN_HOME is spelled through a symlink. cwd is translated by resolved containment (boxlite_executor.py:541-548), while command/args/env are translated by a literal regex over the resolved roots (:523-529). PLUGIN_ROOT is resolved (mcp.py:280), but PLUGIN_DATA is not (mcp.py:436).

Nits:

  • Name regex. manifest.py:39 uses $, which in Python also accepts a trailing newline, so "acme\n" is a distinct package. The model also accepts null for fields the vendored schema types as strings.
  • Host-wins-on-collision. The rule is decided at three points with different inputs (mcp.py:397, mcp_glue.py:446-447, runtime.py:218), and reserved_names defaults to empty, so list (cli :69) counts a dropped server as running.
  • list says "running" from the opt-in list alone (cli :98). It does not show server problems, although the CHANGELOG says it does.
  • Docs and code disagree.
    • The docs page says MCP servers come "in a later phase", but this PR ships them.
    • NOTICE.md says mcp.schema.json joins "with the phase that reads mcp.json", yet the file is absent.
    • The design doc still says "nothing implemented".
    • _translate_cwd's docstring still says workspace first, but the code is now longest-root first.
    • manifest.py:80 uses "portable plugin", which the PR's own _Avoid_ list rules out.
  • get_package_data_dir (config/paths.py:81) has no caller. The rule is restated inline at cli :80 and mcp.py:436.
  • Untested. No test builds a runtime with a configured package (mutants in runtime.py:209-218 survive). Neither the boxlite sibling-prefix boundary nor ledger atomicity (tmp + replace) is pinned.

@gloryfromca

Copy link
Copy Markdown
Member

Blocking: resolve the three new review threads on always-skill isolation, malformed-package containment, and layer seating.

These unresolved threads make my previous clean stance stale. I independently measured that the one-line JSON metadata form survives strip_always_keys, invalid UTF-8 escapes discover_packages as UnicodeDecodeError, and raven.agent_plugins is absent from the import-linter roster. The 86 related skill/package/layer tests pass, which confirms the current suite does not catch those reproductions. I am not re-grading or resolving another reviewers findings; they remain the standing blockers.

LivXue and others added 2 commits October 26, 2026 15:31
The portable Agent Plugins 1.0 package format is published and read by
several hosts, and Raven has no reader for it. The design states what a
package is, how its skills are discovered and validated against the Agent
Skills rules, why an import copies into the workspace skill tree rather
than mounting the package in place, and what the trust boundary around a
third-party package is.

Co-authored-by: Claude (claude-fable-5) <noreply@anthropic.com>
Raven now reads a package directory whose root holds a plugin.json that
validates against the official Agent Plugins 1.0.0 manifest schema. The
manifest is validated with the specification's own failure boundaries: an
unknown top-level field is reported and ignored, a version this build does
not implement is refused, and any other violation rejects the package.

The package's skills are discovered the way the specification defines them
-- the fixed skills/ location, its immediate children only -- validated
against the Agent Skills rules, and imported into the workspace skill tree
under <workspace>/skills/<package name>/. One directory per package mints
one source label per package in the skill pool, so two packages may ship
the same skill name without either shadowing the other.

The copy is recorded in a ledger, so remove deletes only what the ledger
claims and check reports a package that changed since the import. A package
cannot put text into every turn: the always flag is dropped from the
imported copy. A blocked skill, a skill pointing at another product's home
directory, and a target directory the ledger does not own are all refused.

raven agent-plugins list | inspect | import | remove | check is the
operator surface; agentPlugins.packages says where the packages live. The
MCP configuration of a package is not started yet.

Co-authored-by: Claude (claude-fable-5) <noreply@anthropic.com>

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking: the remaining always-skill thread still requires its author or a maintainer to settle it.

I reviewed the new delta and found no additional defect. split_frontmatter now uses the registry's ----only boundary, so the decision and rewrite include the same block; the copy is then re-read through the registry parser, and any surviving always flag fails the import and removes the copy. The ... escape and a forced no-op rewrite are both covered. Verification: 449 focused tests passed; commit-message, source-language, large-file, Ruff, merge-simulation, and import-linter checks passed, with all 10 contracts kept.

Threads 4377069837 and 4377070448 are resolved. Thread 4377069244 remains open and belongs to @0xKT, so I am not re-grading or resolving it; the verdict remains blocker until that reviewer or a maintainer settles it.

@LivXue

LivXue commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

Windows compatibility review — PR #1110 @ 7c7aa75e0281d37f7f7f9a33cc50778ecf472ada

Scope: full base-to-head diff (4718421324 → this head), with line-by-line reading of the new raven/agent_plugins/ subsystem (package, manifest, ledger, skills, mcp, CLI), the runtime/MCP wiring (core/runtime.py, agent/loop/main.py, agent/loop/mcp_glue.py, mcp/client.py), the changed sandbox translation, and all existing review threads (8, all resolved). Reviewed at this exact head.

Two actionable Windows findings, most severe first.


1. Re-import and remove fail on Windows when the imported skill holds a read-only file (medium)

Files: raven/agent_plugins/skills.py:236-249 (shutil.rmtree(target, ignore_errors=True) then copytree), raven/agent_plugins/skills.py:307 (stale-skill removal), raven/cli/agent_plugin_commands.py:374 (shutil.rmtree(child) in remove).

Affected scenario: a package whose skill directory contains a file with the read-only attribute — e.g. copied from a read-only source, an archive, or set by the operator — is imported once, then updated or removed. shutil.copytree (copy2) preserves that attribute on the workspace copy.

Mechanism: NTFS refuses DeleteFile for a read-only file; POSIX unlink only needs write permission on the parent directory, so the same copy is deletable there. Consequently:

  • re-import: rmtree(..., ignore_errors=True) silently stops at the read-only file, the old copy stays, and copytree raises FileExistsError [WinError 183] — the update is reported as failed and can never succeed until someone clears the attribute by hand;
  • agent-plugins remove: shutil.rmtree(child) has no handler and no onerror, so PermissionError [WinError 5] escapes the command as a traceback (the command has no OSError handling) and the package cannot be removed.

Evidence (reproduced on native Windows 11, CPython 3.12.13, this head): package with skills/demo-skill/data.txt read-only (no always flag), workspace ledger owned:

first import: installed= ('demo-skill',) failed= ()
copied exists: True mode: 0o100444
re-import: installed= () failed= (('demo-skill', "[WinError 183] ...demo-skill"),
                                  ('demo-skill', "could not be removed: [WinError 5] ...data.txt"))
remove: rmtree raised PermissionError [WinError 5] ...data.txt

The related variant with a read-only SKILL.md carrying always: true also leaves an unowned copy behind (orphan dir exists: True | owned by ledger: False), because the cleanup rmtree(..., ignore_errors=True) after a failed drop_always_flag write cannot delete the 0444 file. That overlap with the existing non-blocking note is noted; the cleanup half is the Windows-only part.

Remedy direction: one shared delete helper with an onexc/onerror handler that clears the read-only bit (os.chmod(path, stat.S_IWRITE)) and retries the failing operation, used at all three rmtree sites; and catch OSError in remove_package to report a failed deletion instead of a traceback (leave the ledger entry in place, as the failed-import path already does).


2. New sandbox path translation emits mixed-separator guest paths on Windows; the new test fails there (low; latent)

Files: raven/sandbox/boxlite_executor.py:547-548 (rel_str = str(rel) → f"{guest_root}/{rel_str}"), raven/sandbox/boxlite_executor.py:513-528 (_translate_process_path replaces only the host-root prefix).

Mechanism: on Windows Path.relative_to() yields a WindowsPath whose str() uses \, so a cwd under the workspace becomes /workspace/sub\dir; args/env values become /workspace\packages\demo\bin\server. Inside the Linux guest those are one filename containing backslashes, not a path.

Evidence (native Windows, this head vs base 471842132):

head: 15 failed, 100 passed   tests/test_sandbox_unit.py
base: 14 failed,  96 passed   tests/test_sandbox_unit.py
only in head: TestBoxliteStartProcessBridges::test_start_process_translates_command_args_and_env
   AssertionError: assert '/workspace\\...\\bin\\server' == '/workspace/packages/demo/bin/server'

The new TestBoxliteTranslateProcessCwd tests pass only because their relative paths are single components (no separator), so they do not exercise the join.

Reachability: pyproject.toml gates the boxlite extra with sys_platform != 'win32', so this cannot run on a Windows host today. It is a portability/latent defect and a red test for anyone running the suite on Windows, not a shipping regression. The pre-existing _translate_cwd (:570) has the same pattern, and its test (TestBoxliteTranslateCwd::test_subdir_translates_correctly) already fails at base — inherited, not introduced by this PR.

Remedy direction: build the guest path from POSIX components (rel.as_posix()), and in _translate_process_path normalize the separators of the matched path suffix (or rewrite through PurePosixPath) instead of replacing only the host-root prefix.


Other checks (no issue found):

  • Package containment holds against Windows directory junctions (the Windows link type that needs no privilege): a skills/<skill>/data junction pointing outside the package is rejected with ... resolves outside the package root, the skill is skipped, and no outside content is copied. The suite's symlink variants are skipped on this host (this platform cannot create a symlink), which is the coverage gap this probe fills.
  • package_fingerprint, ledger.save (tmp + replace), is_contained, and the owns_directory checks use pathlib/resolve() and behave correctly with NTFS case canonicalization.
  • The MCP cwd plumbing reaches both the MCP SDK (StdioServerParameters.cwd exists in the installed SDK) and BoxliteExecutor.start_process; no other SandboxExecutor implements start_process.

Verification commands and results (isolated detached worktrees D:\tmp\rv-1110 and D:\tmp\rv-1110-base, scratch HOME/USERPROFILE, PYTHONUTF8=1, CPython 3.12.13):

pytest tests/test_agent_plugins_ledger.py tests/test_agent_plugins_manifest.py \
       tests/test_agent_plugins_mcp.py tests/test_agent_plugins_package.py \
       tests/test_agent_plugins_skills.py tests/test_cli_agent_plugin_commands.py
→ 204 passed, 2 skipped (symlink creation unavailable)

pytest tests/integration/test_agent_plugins_e2e.py tests/integration/test_agent_plugins_mcp_e2e.py
→ 6 passed

pytest tests/test_sandbox_unit.py   (head vs base, failing IDs diffed as above)

Limitations: boxlite cannot be installed on win32, so finding 2 is test/code-level only; symlink-based containment tests skip on Windows and were replaced by the junction probe; no Windows CI job runs the unit suite (only installer, self-upgrade, and ACP stdio), so neither finding would appear red in this PR's checks.

@LivXue

LivXue commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

[Ask for Windows bot support]

Please fix the two Windows findings from the Windows compatibility review on this head (7c7aa75e0281), posted at issuecomment-6421316677.

1. Re-import and remove fail when an imported skill holds a read-only file (medium). raven/agent_plugins/skills.py:236-249 removes the old copy with shutil.rmtree(..., ignore_errors=True) and then copytrees onto it; on NTFS a read-only file refuses deletion, so the rmtree half-deletes, copytree raises FileExistsError [WinError 183], and the update can never succeed. raven/agent_plugins/skills.py:307 (stale-skill removal) and raven/cli/agent_plugin_commands.py:374 (remove) perform the same deletion; remove has no OSError handler, so PermissionError [WinError 5] escapes as a traceback. The read-only SKILL.md with always: true variant leaves an unowned copy behind for the same reason.

Remedy: one shared delete helper with an onexc/onerror handler that clears the read-only bit (os.chmod(path, stat.S_IWRITE)) and retries, used at all three rmtree sites; and catch OSError in remove_package, report the failure, and leave the ledger entry in place as the failed-import path already does.

2. Sandbox path translation emits mixed-separator guest paths on Windows (low, latent). raven/sandbox/boxlite_executor.py:547-548 builds f"{guest_root}/{rel_str}" from str(rel), and _translate_process_path (:513-528) replaces only the host-root prefix; on Windows the relative path uses backslashes, so the guest sees /workspace/sub\dir and /workspace\packages\demo\bin\server. The new test_start_process_translates_command_args_and_env fails on Windows for this reason. The boxlite extra is gated to non-Windows, so this is latent rather than a shipping regression.

Remedy: build the guest path from rel.as_posix(), and normalize the separators of the matched suffix in _translate_process_path (for example through PurePosixPath) instead of replacing only the host-root prefix.

Please push the fix to this branch (it is the author's own PR) and reply with what changed and the tests you ran.

@gloryfromca

Copy link
Copy Markdown
Member

No blockers; this can merge as far as I am concerned.

Fixed and pushed in 922d9d8.

  • Package skill removal now uses one read-only-aware tree deletion helper at replacement, cleanup, stale-skill removal, and CLI removal sites. It clears the Windows read-only bit and retries the failed operation.
  • A failed CLI removal now reports the affected skill, exits non-zero, and keeps the ledger entry so the directory remains owned and retryable.
  • Boxlite path translation now converts only matched mounted-path suffixes to POSIX separators, and cwd translation builds guest paths from path components.
  • Added regressions for the Windows read-only retry, ledger retention on failed removal, Windows-style process paths, and Windows-style guest cwd joining.

Verification: 453 focused plugin/MCP/sandbox/runtime tests passed; Ruff, commitlint, commit-message, source-language, large-file, and import-linter checks passed (10 contracts kept). Current main is an ancestor and the merge-tree check is clean.

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the new Windows-fix delta against current main, including the package import/removal callers, ledger ownership behavior, sandbox mount translation, backward compatibility of CLI output, commit history, tests, and the repository's architecture and source rules. The read-only retry is confined to permission failures, failed removal preserves the ledger claim, and guest path normalization retains mount precedence. No tests were weakened.

Verification on this revision: the three affected suites pass (192 tests), Ruff passes, all 10 import-linter contracts are kept, every review thread is resolved, and the merge-tree check against current main is clean.

@LivXue

LivXue commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

Windows compatibility re-review — PR #1110 @ 922d9d81cf3246c07d431bb93e443fa94fdd4cfa

Scope: the delta from the previously reviewed head 7c7aa75e (6 files: raven/agent_plugins/skills.py, raven/cli/agent_plugin_commands.py, raven/sandbox/boxlite_executor.py, three test files), with both findings I reported at 7c7aa75e re-tested at this head; the rest of the base-to-head diff is unchanged.

Result: both previously reported Windows findings are fixed at this head, verified on native Windows. No new Windows issue in the delta.

1. Read-only files no longer break re-import or remove — fixed

remove_tree() (raven/agent_plugins/skills.py:43) now runs shutil.rmtree(onexc=...) and retries a PermissionError after os.chmod(path, stat.S_IWRITE). It is used for the pre-copy cleanup (:252), the two failure cleanups (:258, :268), stale-skill removal (:328), and agent-plugins remove (raven/cli/agent_plugin_commands.py:377). remove_package also now collects failures, reports them (text and --json), exits 1, and keeps the ledger entry when a deletion fails instead of forgetting a package whose directory survives.

Reproduced at this head with the same package as before (a skill containing a read-only data.txt):

first import : installed= ('demo-skill',) failed= ()
re-import   : installed= ('demo-skill',) failed= () skipped= ()
remove_tree  : ok, exists= False

Previously: re-import failed with [WinError 183] and remove raised PermissionError [WinError 5]. The new regression tests pass: test_remove_tree_retries_a_read_only_entry_as_writable, test_remove_reports_a_failed_deletion_and_keeps_the_ledger_entry.

2. Sandbox guest paths now use POSIX separators — fixed

_guest_mount_path (raven/sandbox/boxlite_executor.py:574) joins relative.parts with /, and _translate_process_path (:513) rewrites the matched host-root suffix's backslashes to /; both _translate_process_cwd (:532) and the pre-existing _translate_cwd (:553) now use the helper. Direct probe on Windows paths at this head:

translate command: /workspace/packages/demo/bin/server
translate arg    : /workspace/packages/demo/assets
translate PATH   : /workspace/packages/demo/bin:/usr/bin
translate cwd    : /workspace/packages/demo/bin
translate sub    : /workspace/sub/dir

The test_start_process_translates_command_args_and_env failure I reported at 7c7aa75e is gone, and the pre-existing Windows failure TestBoxliteTranslateCwd::test_subdir_translates_correctly now passes as well. test_sandbox_unit.py at this head has 13 failures, all on the inherited base list (12 TestDirectExecutor + TestSandboxConfigValidators), versus 14 at the base; no new failing ID. Reachability is unchanged: the boxlite extra is sys_platform != 'win32', so this is a portability fix exercised through the helpers/tests, not a shipping Windows path.

No other Windows-relevant change in the delta; shutil.rmtree(onexc=...) requires Python 3.12+, which the project requires.

Verification (native Windows 11, CPython 3.12.13, isolated worktree D:\tmp\rv-1110-new at this head, scratch HOME/USERPROFILE, PYTHONUTF8=1):

pytest tests/test_agent_plugins_skills.py tests/test_cli_agent_plugin_commands.py \
       tests/test_agent_plugins_package.py tests/test_agent_plugins_mcp.py \
       tests/test_agent_plugins_ledger.py tests/test_agent_plugins_manifest.py \
       tests/test_sandbox_unit.py -q
→ 13 failed, 310 passed, 2 skipped          (all 13 inherited; see above)

pytest <the two new read-only regression tests> -q
→ 2 passed

Limitations: boxlite cannot be installed on win32, so the translation fix is verified through the helper tests and direct calls, not a VM; the read-only reproduction uses a handcrafted package and calls the same remove_tree the CLI command uses; no full CLI/gateway run.

@LivXue

LivXue commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

This answers the request in issuecomment-6422696743.

State at pickup. No change was needed from me: the PR head already implements both remedies from the request. At the time of this run the head is 922d9d81cf3246c07d431bb93e443fa94fdd4cfa (fix(*): handle Windows plugin cleanup and guest paths, authored by zhanghui <zhanghui@shanda.com>, committed 2026-10-26 17:25 UTC, five minutes after the request). I made no new commit and pushed nothing; everything below is independent verification of that head on this native Windows host (Windows 11, Python 3.13.12, uv 0.13.0).

Finding 1 - read-only files blocked re-import and remove.

  • raven/agent_plugins/skills.py:43 adds remove_tree(), which calls shutil.rmtree(..., onexc=...). The handler retries only PermissionError after os.chmod(path, stat.S_IWRITE) and re-raises anything else. onexc needs Python 3.12+, which matches requires-python = ">=3.12".
  • It is used for the owned-target delete before copytree, for both failure cleanups in import_package, for stale-skill removal (skills.py:328), and by remove_package (raven/cli/agent_plugin_commands.py:377).
  • remove_package now collects OSErrors into failed, reports them (including in --json), exits 1, and calls ledger.forget(name) only when failed is empty, so a failed removal keeps the ledger entry.
  • Real NTFS probe, not mocked: created a tree with a read-only file (chmod(S_IREAD), read-only attribute verified), then ran
    HOME=D:/tmp/rv-winbot-1110-home USERPROFILE=D:/tmp/rv-winbot-1110-profile PYTHONUTF8=1 uv run --no-sync python D:/tmp/rv-winbot-probe-script/probe_remove_tree.py
    Output: before: read-only attr = True, skill dir exists after remove_tree: False, exit 0.

Finding 2 - mixed-separator guest paths.

  • _guest_mount_path() builds the suffix with "/".join(relative.parts); _translate_process_path() now captures the matched suffix and replaces \ with / in it.
  • TestBoxliteStartProcessBridges::test_start_process_translates_command_args_and_env passes at head and fails at the pre-fix head 7c7aa75e, so the regression is gone.

Tests.

  • Environment setup: uv sync --frozen --offline --all-extras --no-extra segmenter --dev
  • HOME=D:/tmp/rv-winbot-1110-home USERPROFILE=D:/tmp/rv-winbot-1110-profile PYTHONUTF8=1 uv run --no-sync pytest tests/test_agent_plugins_skills.py tests/test_cli_agent_plugin_commands.py tests/test_sandbox_unit.py -q
    • head 922d9d81: 13 failed, 179 passed in 41.93s
    • baseline 7c7aa75e (separate detached worktree, same command): 15 failed, 173 passed in 35.46s
    • The two extra baseline failures are exactly TestBoxliteStartProcessBridges::test_start_process_translates_command_args_and_env and TestBoxliteTranslateCwd::test_subdir_translates_correctly. The other 13 fail identically at both heads (12 TestDirectExecutor process-group/stdin/env tests and TestSandboxConfigValidators::test_extra_volumes_valid), so they are pre-existing on this host and not caused by the commit.
  • Focused run of the six relevant tests (the four new/updated unit tests plus the two Windows regressions): 6 passed in 8.05s.
  • HOME=... USERPROFILE=... PYTHONUTF8=1 uv run --no-sync pytest tests/test_agent_plugins_ledger.py tests/test_agent_plugins_manifest.py tests/test_agent_plugins_mcp.py tests/test_agent_plugins_package.py -q: 131 passed, 2 skipped in 8.47s. Both skips are test_agent_plugins_mcp.py symlink tests ("this platform cannot create a symlink") because this host cannot create symlinks without elevation.

Limitations.

  • boxlite is a non-Windows extra, so the guest-path behavior is covered by unit tests and by the command-translation logic, not by a live Boxlite VM on Windows.
  • I did not run the whole repository test suite; the run above covers every file touched by the commit plus the rest of the agent-plugin unit tests.
  • No commit was pushed by me because the head already contained the fix. If any part should be reworked, say which and it can be added on this branch.

ruff format joins the two lines the Windows fix wrapped shorter than the
repository width. No behaviour change.

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the delta from the last accepted head and the current-main integration. This revision only applies formatter output to two Windows regression tests; assertions, fixtures, production code, callers, backward compatibility, and architecture boundaries are unchanged, and no test was weakened. The repository rules and commit history were also checked.

Verification: the affected suites pass (163 tests), Ruff and formatter checks pass, commitlint and the repository commit-message gate pass, and the merge-tree check against current main is clean.

@LivXue

LivXue commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Windows compatibility re-review — PR #1110 @ 000fd0006318cc31ddda469374a9d8b9fa38c810

Scope: delta from the previously reviewed head 922d9d81 — two test files, formatting only (def signature and one call re-joined onto single lines). No production code, test logic, assertions, or fixtures changed; the rest of the base-to-head diff is unchanged.

Result: no new Windows-relevant code; both fixes reported at the previous heads remain in place.

  • The read-only deletion path (remove_tree with rmtree(onexc=...) in raven/agent_plugins/skills.py) and the sandbox guest-path translation (_guest_mount_path / _translate_process_path) are byte-identical to the head I verified at 922d9d81.
  • Re-ran the affected tests at this exact head on native Windows:
pytest tests/test_agent_plugins_skills.py \
       tests/test_sandbox_unit.py::TestBoxliteTranslateProcessCwd \
       tests/test_sandbox_unit.py::TestBoxliteTranslateProcessPath \
       tests/test_sandbox_unit.py::TestBoxliteStartProcessBridges -q
→ 55 passed in 9.65s

The Windows read-only re-import/remove reproduction and the guest-path probe from the 922d9d81 review remain valid — neither path changed in this delta.

Limitations: as before, boxlite cannot be installed on win32, so the translation fix is exercised through the helper tests rather than a VM; the delta itself is non-functional.

@0xKT

0xKT commented Oct 27, 2026

Copy link
Copy Markdown
Member

Not a blocker -- two follow-ups on the Windows fix in 922d9d8 (re-checked at 000fd00). Neither stops the merge; both are cheap to fix here or in a follow-up.

Severity of this one finding, not a verdict on the pull request. Any blocking findings from this pass are review threads on the changed files; GitHub renders those collapsed, as a file name with no text.

1. _translate_process_path now misses a second host path in the same string, and rewrites backslashes that are not path separators. raven/sandbox/boxlite_executor.py:526 adds a suffix group (?:[\\/][^:;]*)? to the root pattern. That group runs to the next : or ;, so re.sub resumes scanning after everything it swallowed. Any later occurrence of the same mount root in that argv element or env value is left as a host path, and every \ in the swallowed tail becomes /. Measured with the exact pattern (stdlib re, host root /Users/u/.raven/workspace, guest /workspace):

in : cd <root>/pkgs/p && node <root>/pkgs/p/server.js
old: cd /workspace/pkgs/p && node /workspace/pkgs/p/server.js
new: cd /workspace/pkgs/p && node /Users/u/.raven/workspace/pkgs/p/server.js

in : --require <root>/a.js --require <root>/b.js
new: --require /workspace/a.js --require /Users/u/.raven/workspace/b.js

in : --data=<root>/d --sep=\t
new: --data=/workspace/d --sep=/t

The previous head translated both occurrences, which is what the docstring promises ("Rewrite every mounted host root inside text"). It is reachable: expand_placeholders (raven/agent_plugins/mcp.py:95) expands ${PLUGIN_ROOT} / ${PLUGIN_DATA} inside each string. So a package server declared as sh -c "cd ${PLUGIN_ROOT} && node ${PLUGIN_ROOT}/server.js", or carrying ${PLUGIN_ROOT} twice in one NODE_OPTIONS, hands the VM a host path under boxlite. The Windows case the new test pins (C:\workspace\... -> /workspace/...) does work. One way: stop the suffix at the next occurrence of the root, (?:[\\/](?:(?!<escaped root>)[^:;])*)?, and only normalise \ when the host root itself contains one. Checked against the cases above: both occurrences translate, POSIX tails are left alone, and the Windows test case still gives /workspace/packages/demo/bin;C:\outside\bin; a Windows tail such as --sep=\t would still be rewritten, since the tail cannot be told apart from a path with spaces. A test with the same root twice in one argument would pin the first part.

2. On POSIX, a failed remove_tree now leaves the retained skill unreadable. raven/agent_plugins/skills.py:46-50 retries every PermissionError with os.chmod(failing_path, stat.S_IWRITE), which sets the mode to exactly 0o200. On NTFS that clears the read-only attribute as intended. On POSIX the unlink fails because the parent directory is not writable, so the retry fails as well. rmtree then reports the directory to the same handler, and that directory is set to 0o200 too. Measured with the same helper on macOS (Python 3.13), on a skill copied by shutil.copytree from a source whose directory is 0o555 (copytree keeps that mode):

onexc unlink  skill/SKILL.md  PermissionError
onexc scandir skill           PermissionError
raised PermissionError
skill dir mode 0o200   -> not listable
SKILL.md   mode 0o200   -> not readable

_remove_stale_skills and agent-plugins remove then correctly keep the skill, but as a directory that can no longer be listed or read. Before this change the same failure left the modes alone. Guarding the retry to Windows (if os.name != "nt" or not isinstance(error, PermissionError): raise error) keeps the Windows fix and leaves POSIX as it was.

Both measured outside the PR's code (the pattern and the helper copied into a scratch script); local tests of the PR were not run, CI is green on this head.

The suffix added for Windows separators ran to the next : or ;, so re.sub
resumed after it and a second occurrence of the same root in one argument
or environment value stayed a host path. It also rewrote every backslash
in the tail, including one that was not a separator, on POSIX hosts.

The suffix now stops at the next occurrence of the root, so the scan
resumes there, and only a Windows host root normalises its tail. A POSIX
tail keeps its backslashes.

Regressions cover the same root twice in one string and a --sep=\t tail;
the Windows single-root case still passes.
remove_tree retried every PermissionError with chmod(S_IWRITE), which
clears NTFS's read-only attribute but sets a POSIX path to exactly 0o200.
On POSIX the failure means the parent directory is not writable, so the
retry failed too and left the retained skill unreadable.

The retry is now gated on the platform that has the attribute. A POSIX
PermissionError is re-raised unchanged, so the caller keeps the skill with
its modes intact.
@LivXue

LivXue commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Both follow-ups are fixed in 410c356 and dab409c.

  1. _translate_process_path now stops the suffix at the next occurrence of the same root, so re.sub resumes there and translates every occurrence; the tail is normalised only when the host root itself contains a backslash, so a POSIX --sep=\t is left alone. Regressions: the same root twice in one argument, a POSIX tail with a backslash, and the existing Windows single-root case (dab409c).

  2. remove_tree only retries with chmod(S_IWRITE) on the platform that has the read-only attribute; on POSIX the PermissionError is re-raised unchanged, so a retained skill keeps its modes. The Windows retry test now states the platform explicitly, and a POSIX test pins that chmod is not called (410c356).

At this head the PR's 16-file suite is 479 passed; ruff, format, ty, lint-imports, source-language, large-file and commit-message gates pass.

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the two-commit delta from 000fd00 through 410c356 against the full PR, the affected callers, commit history, repository rules, backward compatibility, test changes, and architecture boundaries. The Windows-only deletion retry preserves POSIX modes, and path translation now handles repeated mounted roots without rewriting unrelated POSIX backslashes. I found no test weakening or new architectural dependency.

Verification: 166 affected tests passed; Ruff check and format check passed; diff check, commitlint, and the repository commit-message gate passed. Current main is an ancestor and the merge tree is clean. All review threads are resolved.

@LivXue

LivXue commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Windows compatibility re-review — PR #1110 @ 410c356b6dbcdc4d18a38b91f884df4491ad7c3f

Scope: delta from the previously reviewed head 000fd000 (4 files): remove_tree now retries read-only entries only on NTFS (_RETRIES_READ_ONLY_ENTRIES = os.name == "nt"), _translate_process_path stops its suffix at the next occurrence of the same root and converts backslashes only on a Windows host, plus three new tests. The rest of the base-to-head diff is unchanged.

One new finding (low, test-only); the two Windows fixes remain correct.

test_a_posix_tail_keeps_its_backslashes fails on Windows by construction

File: tests/test_sandbox_unit.py:1122 (assertion at :1129).

Mechanism: the test builds the executor from root = str(tmp_path.resolve()). On Windows that root itself contains backslashes, so _translate_process_path correctly treats the host as Windows and rewrites the suffix's \t to /t; the assertion expects the POSIX behaviour (--sep=\t kept). The premise "a POSIX tail" is not guaranteed by the fixture used.

Evidence (native Windows 11, this head):

pytest tests/test_sandbox_unit.py::TestBoxliteTranslateProcessPath::test_a_posix_tail_keeps_its_backslashes -q
→ AssertionError: assert '--data=/workspace/d --sep=/t' == '--data=/workspace/d --sep=\t'

Run of the affected files: 1 failed, 57 passed. The other new test (test_every_occurrence_of_one_root_is_translated) and the POSIX-mode deletion test pass on Windows.

Remedy direction: make the test independent of the host fixture — e.g. construct the mount table with a POSIX-shaped root (PurePosixPath("/srv/work") or monkeypatch _mount_roots to return a /-rooted path) — or mark it skipif(os.name == "nt") with the reason. The product behaviour it exercises is only reachable on a POSIX host today (boxlite is sys_platform != 'win32').

Unchanged, re-verified at this head: the read-only deletion fix still works end to end — package with a read-only data.txt: first import installed, re-import installed with no failures, and remove_tree removes the tree (remove_tree ok, exists= False). The new _RETRIES_READ_ONLY_ENTRIES refinement correctly leaves a POSIX PermissionError to the caller.

Verification commands and results (isolated worktree D:\tmp\rv-1110-n3 at this head, scratch HOME/USERPROFILE, PYTHONUTF8=1):

pytest tests/test_agent_plugins_skills.py \
       tests/test_sandbox_unit.py::TestBoxliteTranslateProcessCwd \
       tests/test_sandbox_unit.py::TestBoxliteTranslateProcessPath \
       tests/test_sandbox_unit.py::TestBoxliteStartProcessBridges -q
→ 1 failed, 57 passed in 10.65s   (the failure above)

Limitations: boxlite cannot be installed on win32, so the translation path is exercised through the helpers only; the read-only reproduction uses a handcrafted package and remove_tree directly, as before.

@gloryfromca

Copy link
Copy Markdown
Member

No blockers; suggestions only, and they are marked inline.

The native Windows result adds one concrete test-only follow-up, so my stance on this unchanged revision is now nonblocking rather than clean. The production fixes remain verified; the remaining issue is that test_a_posix_tail_keeps_its_backslashes constructs a Windows-shaped mount root on Windows while asserting POSIX-only behavior. No local rerun can reproduce that native Windows condition, and the branch has not changed since my prior passing Linux verification.

The test built its mount root from tmp_path, which on Windows contains
backslashes; the translator then took the Windows branch and normalised the
tail, while the assertion expected the POSIX one. The mount table is now
POSIX-shaped explicitly, so the test exercises the same branch on every
host.

No production code changes.

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the delta from 410c356 through dcaf2c2 against the full PR, affected helper and tests, history, repository rules, backward compatibility, test integrity, and architecture boundaries. The fixture now supplies a POSIX-shaped mount root on every host and retains the original backslash-preservation assertion, so it closes the native-Windows test failure without weakening coverage. No production code or architecture changed.

Verification: 166 affected tests passed; Ruff check and format check passed; diff check, commitlint, and the repository commit-message gate passed. Current main is an ancestor and the merge tree is clean. All review threads are resolved.

@LivXue

LivXue commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Windows compatibility re-review — PR #1110 @ dcaf2c246015fc9c1f7abddfc2eb5cf7faf62f09

Scope: delta from the previously reviewed head 410c356b — one test file. test_a_posix_tail_keeps_its_backslashes now monkeypatches _mount_roots to a POSIX-shaped root (PurePosixPath("/srv/work") → /workspace), so the premise the assertion states holds on every host instead of depending on tmp_path being POSIX-shaped. No production code changed.

Result: the one finding from the 410c356b review is fixed; no new Windows issue.

  • Re-ran the affected files at this exact head on native Windows:
pytest tests/test_agent_plugins_skills.py \
       tests/test_sandbox_unit.py::TestBoxliteTranslateProcessCwd \
       tests/test_sandbox_unit.py::TestBoxliteTranslateProcessPath \
       tests/test_sandbox_unit.py::TestBoxliteStartProcessBridges -q
→ 58 passed in 13.71s

The previously failing assertion and the POSIX-mode deletion test both pass here now. The read-only import/re-import/remove verification and the guest-path probe from the earlier reviews still apply — neither production path changed in this delta.

Limitations: boxlite cannot be installed on win32, so translation remains helper-level verification; no full CLI/gateway run.

@0xKT
0xKT merged commit 26352da into main Oct 27, 2026
24 checks passed
@0xKT
0xKT deleted the feat/agent_plugins_loader branch October 27, 2026 06:12
0xKT added a commit that referenced this pull request Oct 27, 2026
## Summary

Bump the package version from 0.2.5 to 0.2.6 for the next release. Only
pyproject.toml and uv.lock change.

Since v0.2.5, main merged 70 PRs: 15 features, 48 fixes, three test, two
docs,
one perf and one chore. The larger features are portable Agent Plugins
1.0
packages with their MCP servers (#1110), the compacting history strategy
with
source refs and checkpoints (#1031), sub-agent runs as their own
trajectory
spans and tabs (#1091, #1094, #1096, #1100), download mirror fallback
(#1053),
Keenable as a keyless web_search and web_fetch vendor (#1088), Opper as
an
OpenAI-compatible gateway (#869), and the MiniMax image and video roles
(#1013).
None carries a BREAKING CHANGE footer. The maintainer chose a patch
bump, the
way v0.2.1 through v0.2.5 were for their features.

A v0.2.6-rc1 tag goes first to dry-run the release pipeline, as v0.2.5
did. The
stable tag and release notes follow once this lands.

uv.lock is regenerated with uv 0.12.12, which leaves only the raven
version
line changed (uv 0.9.x rewrites unrelated dependency markers and uv
0.13.x
raises the lock revision).

## Type

- [ ] Fix
- [ ] Feature
- [ ] Docs
- [ ] CI / tooling
- [ ] Refactor
- [x] Other

## Verification

- `uvx --from uv==0.12.12 uv lock` on a clean worktree cut from
origin/main:
  Updated raven v0.2.5 -> v0.2.6
- `git diff --numstat origin/main..HEAD`: one line each in
pyproject.toml and
  uv.lock
- `uvx --from uv==0.13.3 uv lock --check`: exit 0, so the
  `uv export --locked` step in release.yml accepts the lock
- `PYTHONPATH=. python3 scripts/check_commit_messages.py
origin/main..HEAD`:
  exit 0
- `npx commitlint --from origin/main --to HEAD --config
commitlint.config.cjs`:
  exit 0
- No test run: the change is version metadata only.

- [ ] Relevant tests pass locally
- [x] Relevant lint / type checks pass locally
- [ ] User-facing docs or screenshots are updated when needed

## Risk

No code change. Rollback is reverting this commit before any v0.2.6 tag
is
pushed.

- [ ] Security impact considered
- [x] Backward compatibility considered
- [x] Rollback path is clear for risky changes

## Related Issues

N/A

Co-authored-by: Claude (claude-fable-5-1) <noreply@anthropic.com>
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