Skip to content

fix(experts): share one agents home for publish and execution - #68

Merged
techflag merged 1 commit into
techflag:mainfrom
Frank-zhu2000:fix/55-agents-home-default
Oct 18, 2026
Merged

techflag merged 1 commit into
techflag:mainfrom
Frank-zhu2000:fix/55-agents-home-default

Conversation

@Frank-zhu2000

Copy link
Copy Markdown
Contributor

Summary / 摘要

Expert publish and the execution guard now use one agents directory. If DSH_AGENTS_HOME is unset and DSH_HOME is set, presets are written and read under $DSH_HOME/agents instead of ~/.agents. That removes the 旧目录预设 ENOENT that happened when a team preset was published on the persisted home and later opened from the user home. Unrestricted execution still requires an explicit permission choice. The removed deploy/docker recipe is not restored.

Related Issues / 关联 Issue

Refs #55

The docker recipe and the decision not to default DSH_PERMISSION_MODE to danger-full-access are already on main (489f8bad08 and the self-hosted README section). This change only closes the remaining agents-home split. It does not by itself make a container's bash tool work without a sandbox backend.

Type / 类型

  • Bug fix / 问题修复
  • Feature / 新功能
  • Documentation / 文档
  • Release or packaging / 发布或打包
  • Tests only / 仅测试
  • Other / 其他

Platforms / 影响平台

  • Windows installer / Windows 安装包
  • Windows portable ZIP / Windows 便携版 ZIP
  • macOS Apple Silicon
  • macOS Intel
  • macOS Universal package / macOS 通用安装包
  • Linux
  • Not platform-specific / 与平台无关

The lookup is the same on every OS. It matters most for a self-hosted process that sets DSH_HOME and does not set DSH_AGENTS_HOME.

Verification / 验证

Node.js 22.23.2 (CI pin). I mirrored .github/workflows/ci.yml locally on Linux: the changes job, check (corepack yarn install --immutable, corepack yarn check), and web-source-check (pnpm install, build, typecheck, versions, Playwright Chromium, browser tests, integration, library, office, workbenches, quality analysis, tabular, runtime-isolated, enterprise identity).

  • corepack yarn check:layout
  • corepack yarn typecheck
  • corepack yarn test
  • corepack yarn check (fails on unmodified main too, see below)
  • Platform package smoke / 平台打包或启动冒烟
  • Manual test / 人工测试

Regression test:

  • RED, before the fix: node --test --test-concurrency=1 --test-name-pattern='publish and the execution guard read' tests/integration/expert-manager.test.mjs failed. The unscoped preset dir was ~/.agents/..., while the manager had published under $DSH_HOME/agents/....
  • GREEN: the same command passes; tests/integration/expert-manager.test.mjs is 29 pass, 0 fail; corepack pnpm --filter workdsh-plugin-experts typecheck passes.

Local CI mirror on this branch (bb58979e08):

  • changes, yarn install --immutable, and every web-source-check step (build, typecheck, versions, Playwright, browser tests, library, office, workbenches, quality, tabular, runtime-isolated, enterprise identity) exit 0.
  • pnpm test:integration: 147/147 pass, including the new test. One earlier run had a single failure in the unchanged DOCX import idempotency case in office-import.test.mjs (two imports gave different operationId digests); it passed on rerun and in isolation, so I read it as flaky rather than related.

Baseline failure, same on unmodified main (81527723ab):

  • corepack yarn check fails on both this branch and main with the same assertion: apps/desktop/tests/owned-process.spec.ts > "kills a real tool descendant that ignores SIGTERM even after its parent exits", expected NaN to be greater than 0 at line 16 (1 failed, 163 passed, 2 skipped on both). That spec is outside this diff and looks specific to my Linux runner. Because of it, enterprise-plugin (which needs: check) was not run locally.
  • Not run: desktop-windows, desktop-macos packaging (other OS) and publish-desktop-release (tag-only).

Release Notes / 发布说明

Self-hosted experts follow $DSH_HOME/agents when DSH_AGENTS_HOME is unset, including execution of a published team preset. Set DSH_AGENTS_HOME only when that directory is also on persistent storage. Permission mode is unchanged: WorkDSH does not silently select unrestricted execution.

AI assistance: implementation and the regression test were drafted with Grok in a local worktree. No GitHub writes were made from that session.

When DSH_HOME is set and DSH_AGENTS_HOME is not, published presets were
written under $DSH_HOME/agents while preset reads and the execution
guard still opened ~/.agents and failed as a missing legacy preset.
@techflag
techflag merged commit 069110d into techflag:main Oct 18, 2026
8 checks passed
@techflag

Copy link
Copy Markdown
Owner

非常感谢,已经合并到main

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.

2 participants