feat(delegation): add parent-scoped live controls - #76512
Conversation
Related to #66046: both expose live delegation controls, but this PR adds a deferred |
|
Thanks for the security-focused live-control proposal. Current Suggested changes
This is an automated hermes-sweeper review. |
SummaryOne PR directly addresses #76508. #76512 adds the missing model-facing list, cancel, and steer controls, with authority derived from the canonical profile and compression-only parent lineage while retaining the existing async registry and terminal-result delivery path. Related pull requests
DuplicatesNo duplicates among the listed PRs. #66046 is related, but its argument/overlay model differs from #76512's deferred Suggested consolidationKeep #76512 open with a salvage path: resolve the documented contract choice against #66046, then rebase onto main or split out the viable portion while preserving the parent-scoped authority resolver, bounded control API, callback serialization, lifecycle-race handling, and adversarial tests, and reconciling the cited post-base lifecycle commits. There are no listed duplicate PRs to close. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I76508(["issue #76508 (open)"])
P76512["PR #76512 (open)"]
P76512 -->|best fix| I76508
class I76508 open
class P76512 open
class P76512 best
class P76512 target
click I76508 "https://github.com/NousResearch/hermes-agent/issues/76508"
click P76512 "https://github.com/NousResearch/hermes-agent/pull/76512"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 57 kB of PR diffs, 12 kB of issue/PR text, <1 kB of discussion (1 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
|
Thanks for building this, @0xbWy — you were ahead of us on the exact user story here, and the three-verb surface you designed (list / cancel / steer, parent-scoped) is precisely the shape that just landed. Live subagent orchestration merged in #85232, folded into Closing this as superseded by the merged implementation. The adversarial-testing mindset in your branch is genuinely appreciated — if you spot ownership or lifecycle gaps in what shipped, a focused follow-up PR against current |
Fixes #76508
Summary
delegate_controlsurface withlist,cancel, andsteeractions for live asynchronous delegations.delegationtoolset, outside_HERMES_CORE_TOOLS, with leaf-agent exclusion.Design
Trusted parent authority
Dispatch records capture a trusted compound owner:
The new read-only SessionDB resolver follows only proven compression edges. It fails closed for missing or malformed state, non-compression ancestry, ambiguous continuations, cycles, explicit branch/delegate markers, and delegate/subagent/tool sources. Model arguments and discovery cursors never establish authority.
Complete
deleg_<8 lowercase hex>IDs remain useful user-facing handles, but possession is not authorization. Malformed, foreign, missing, terminal, and inaccessible targets all return opaquenot_found.Bounded live chooser
listreturns newest-first pages containing only:It exposes
total_live,truncated, andnext_cursorrather than silently truncating. It does not expose prompts, context, results, errors, routes, models, ownership/session fields, callbacks, credentials, or completion-delivery internals.Race-safe cancellation and steering
pending,accepted, or stable non-retriableindeterminatestates truthfully./stop, and stale-lifecycle cancellation supersede an overlapping steer and cannot miss a child temporarily marked as steering.Narrow-waist integration
delegate_controlis registered in the existingdelegationtoolset and remains absent from_HERMES_CORE_TOOLS. Normal progressive disclosure discovers it throughtool_search; eager exposure remains possible when tool search is disabled but delegation is enabled. Existing child toolset policy keeps it unavailable to leaf agents.No parallel registry, persistence schema, configuration key, dependency, service, or migration is introduced.
Verification
Final frozen patch:
Executed evidence:
301/301broader affected SessionDB/delegation/model-tool/gateway/lifecycle tests passed in the final security review.66/66adversarial authority cases passed, including normalized delegate/subagent/tool sources, malformed marker values, valid parent roots, multi-hop compression, ambiguous ancestry, foreign profiles, and real control-owner resolution.3/3lifecycle overlap regressions passed.git diff --checkpassed.HERMES_HOMEmodel-tool integration exercised dispatch, listing, pagination, steering, cancellation, compression continuity, and foreign-profile opacity.The repository-wide runner was also executed on the preceding frozen candidate. It completed with 34 test failures across 22 files plus 14 collection/import failures in known untouched-base optional-dependency/environment categories; no changed delegation-control test failed. After the final localized authority/lifecycle deltas, the focused and broader affected suites above were rerun on the exact final bytes. This PR does not claim repository-wide baseline health.
Related work
Non-goals