Skip to content

feat(deepagents): add context.offload hook event and global scope for rules/subagents/skills - #1836

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1815-deepagents-hooks-global
Jun 10, 2026
Merged

feat(deepagents): add context.offload hook event and global scope for rules/subagents/skills#1836
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-1815-deepagents-hooks-global

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Resolves the remaining gaps in the deepagents (dcode) integration described in #1815, verified against the deepagents-code source.

context.offload hook event

dcode dispatches a context.offload hook (alongside context.compact) that rulesync had no canonical mapping for. Add a canonical contextOffload event mapped to context.offload, wired into DEEPAGENTS_HOOK_EVENTS and the deepagents event name maps. The change is additive — no other adapter's event set includes contextOffload, so they are unaffected.

Global scope for rules / subagents / skills

dcode reads user-level context, subagents, and skills from ~/.deepagents/<agent_name>/{AGENTS.md,agents/,skills/} (default agent_name = deepagents), but the rules/subagents/skills adapters hardcoded project paths and the processors marked them supportsGlobal: false. Now:

  • getSettablePaths({ global: true }) emits ~/.deepagents/deepagents/{AGENTS.md,agents,skills} (home resolved via outputRoot).
  • The rules, subagents, and skills processors mark deepagents supportsGlobal: true.
  • Project behavior is unchanged.

Hooks (already resolved)

The issue's hooks concern — a project .deepagents/hooks.json that dcode never reads — is already addressed on main: the hooks processor emits deepagents hooks global-only to ~/.deepagents/hooks.json (supportsProject: false, supportsGlobal: true). No change needed there.

Tests / docs

Unit tests for the new event mapping and global paths, updated processor target-enumeration tests, and the supported-tools.md matrix (rules/subagents/skills gain 🌏). pnpm cicheck fully green (6225 tests).

Closes #1815

🤖 Generated with Claude Code

cm-dyoshikawa and others added 2 commits June 10, 2026 10:56
… rules/subagents/skills

Resolves the remaining gaps in the deepagents (dcode) integration:

- Add a canonical `contextOffload` hook event mapped to dcode's `context.offload`
  (dispatched by dcode alongside `context.compact`), wired into the deepagents
  hook event set and name maps. Other adapters are unaffected.
- Honor global scope for rules, subagents, and skills: dcode reads user-level
  context/agents/skills from `~/.deepagents/<agent_name>/{AGENTS.md,agents,skills}`
  (default agent_name `deepagents`). getSettablePaths now emits
  `~/.deepagents/deepagents/...` in global mode, and the rules/subagents/skills
  processors mark deepagents `supportsGlobal: true`. Project behavior is unchanged.

(The hooks project-vs-global concern from the issue was already resolved: the
hooks processor emits deepagents hooks global-only to ~/.deepagents/hooks.json.)

Tests, processor target enumerations, and the supported-tools matrix updated.

Closes #1815

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…le comment

Address review findings on PR for #1815:
- Add deepagents to the global-mode e2e happy-path matrices for rules,
  subagents, and skills (now that they support global scope), asserting output
  under ~/.deepagents/deepagents/{AGENTS.md,agents/planner/AGENTS.md,skills/...}.
- Update the now-stale fromRulesyncRule comment to mention the global path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit 81e4d35 into main Jun 10, 2026
8 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-1815-deepagents-hooks-global branch June 10, 2026 18:11
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.

Follow up DeepAgents upstream updates: project hooks.json is never read, missing context.offload event, and no global scope

2 participants