Skip to content

Feature request: hook events and AGENTS.md context for subagents (Agent/Task tool) #986

Open

Description

@Insightify2029

Environment: ZCode 3.14.5.7961 (Windows 10), config-file hooks (hooks.enabled: true) + plugin hooks, user-scope + workspace AGENTS.md.

What we measured (live sessions, subagent rollout file inspection):

  1. Subagents receive no hook events at all. The main agent fires SessionStart / UserPromptSubmit / PreToolUse / PostToolUse hooks, but agents launched via the Agent/Task tool trigger zero hook invocations — their rollout files contain no hook references whatsoever.

  2. AGENTS.md context is inconsistent across subagent types:

    • Explore subagent: ~14,045 chars injected (skills list only — zero AGENTS.md content)
    • general-purpose subagent: ~55,696 chars (full AGENTS.md from both scopes)

So a governance layer built on hooks (policy injection, delivery receipts, memory index) works for the main agent and is completely invisible to subagents — including read-only Explore agents that then operate without the project's rules.

Request:

  1. Fire hook events for subagent sessions (or add a dedicated SubagentStart / SubagentPromptSubmit event), or provide a config option to enable it.
  2. Make AGENTS.md delivery consistent (or configurable) across subagent types.
  3. Bonus: a per-subagent-type context budget/allowlist setting.

This matters for teams using ZCode in governed environments where compliance hooks must cover every agent that touches the repo.

Activity

  1. github-actions commented on Oct 10, 2026

    @github-actions

    👋 感谢你的反馈,我们已经收到。

    • 维护者看到后会尽快回复你。
    • 状态保持为 status: 待评估,你可以随时补充信息。
    • 信息不全时我们会打上 needs: 更多信息 标签并 @ 你。

    👋 Thanks — we've received your issue.

    • A maintainer will get back to you as soon as we can.
    • Status stays at status: 待评估 (Triage); feel free to add context.
    • If we need more details, we'll add needs: 更多信息 and ping you.
  2. dominiclafleur commented on Oct 30, 2026

    @dominiclafleur

    工具级 Hook 的根因分析与经单测验证的修复分支见 #361 (comment) (子代理 runtime 配置漏继承 hooks / workspace 快照;补丁含回归测试)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions