mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
3 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3f761a822a
|
fix(agents): finished subagents fail to wake their parent when registry writes overlap (#163195)
* fix(subagents): preserve completion during concurrent registry writes Replace speculative row staging with per-row FIFO planning, immutable post-ACK publication, digest CAS, and bounded conflict replanning. Route registry and native completion writes through the same owner, and commit eligible terminal signals with their terminal rows. Retain runtime custody across metadata publication and acknowledged collector rekeys. Fence retired Gateway incarnations and unknown writes until canonical reconciliation. This local checkpoint has independent review clean through P2, core and selected test type checks, typed caller lint, and focused worker/lifecycle proof. Main integration and complete validation remain in progress; descriptorless recovery fixture setup and warm restoration failures remain recorded in the task notes for the next checkpoint. * fix(subagents): preserve reset and stop ownership after publication Prepare reset revocation after session generation checks and revalidate current child captures before commit. Reacquire queued Stop rows through their runtime owner after terminal publication. Adapt remaining fixtures to immutable registry observations and awaited acknowledgements. * fix(subagents): retain cancellation and completion custody across acknowledgements Preserve semantic kill ownership during replanning, allow confirmation of the same cancellation, and retain grace callbacks through their own terminal acknowledgement. Keep compact projections noncustodial and accept current runtime owners in Stop. Complete immutable-row fixture cutovers and join acknowledged terminal work during teardown. * test(subagents): assert committed cancellation failure boundaries * fix(agents): retain retirement receipts and lifecycle attempt custody Keep acknowledged quiet deletion receipts through publication recovery and bind delayed terminal grace to its admitted execution attempt. Adapt immutable publication fixtures and requester reply proof to the integrated yield policy. * refactor(agents): centralize canonical subagent restoration Keep restore admission, immutable row installation, and uncertain write recovery in the registry mutation owner. Retain cache and notification ownership in state without the reverse import, and migrate all callers and fixtures to the owning contracts. * fix(agents): preserve child ownership during collector settlement Resolve collector usage through the existing child-session owner before terminal publication. Cover recorded child agents and configured defaults for unscoped session keys through real queued registration failure settlement. * fix(subagents): retain Gateway custody after lifecycle commits Return the acknowledged published row from lifecycle mutations instead of their private planning draft. The draft has no Gateway binding, so cleanup could leave an owned managed-worktree session behind after falling back to raw RPC. The real production-boundary deletion case failed before this fix and now deletes the session/worktree while preserving its result snapshot. Separate raw row hashing and mutation contracts from persisted record types to remove static import cycles. Finish the cutover by removing obsolete exports, eliminate a redundant assertion, and give sweep deletion a unique export name. Keep fixture checks on actual published rows and provide the scheduler logger's trace method. No test guard, budget, baseline, or schema change is needed. Final focused proof: five affected files / 311 cases, including all 25 spawn production-boundary cases. Additional unchanged-contract CI repair tests retain their passing replays. Core and all 27 affected test graphs, typed lint, architecture/dependency and assertion guards, formatting, diff checks, and isolated review through P2 pass. * test(agents): align registry proof with owner lifetimes Keep requester replay guards until isolated database teardown, avoiding schema writes while worker cleanup is active. Update benchmark imports to the extracted registry contract and row owners. |
||
|
|
84c6eb8fc5
|
improve: sessions_send delivers a peer's reply once instead of running automatic agent ping-pong (#162227)
* refactor(agents): replace peer announcement loops with one reply delivery
Deliver delayed peer results once to the requester and return waited replies inline without a continuation. Preserve child completion custody and same-session generation-bound channel delivery. Use exact-key saved-route lookup, retire legacy peer control tokens from runtime decisions, and retain historical display suppression.
Simplify the announce owner, preserve required missing child output, and keep wake retries within the remaining operation budget. Update session guidance and the opt-in live peer scenario.
Candidate regression scenarios pass. Broad focused tests and changed-lane validation remain incomplete under host load; original-code regression proof is still pending. No live provider test was run.
* refactor(subagents): consolidate completion custody and lifecycle owners
Share terminal-effect persistence and requester-wake settlement adapters while preserving their distinct authority, frozen-wave, and publication guards. Remove unused preparation and accessor paths and reuse existing parameter contracts.
Propagate unknown SQLite write outcomes before scheduling interrupted completion recovery during restart drain. The focused candidate regression passes; original-code failure proof and the broader validation matrix remain pending.
* test(agents): align completion assertions with reply ownership
Assert that an ACP target already owned by its requester keeps task completion and starts no detached reply. Keep isolated cron fallback routing and participant-store checks while asserting no detached wait.
Remove assertions on the retired duplicate steerMessage field; retain complete source-reply content, ordering, exclusions, visibility and batch settlement checks. Remove the redundant inner same-session return while retaining the enclosing branch exit.
Validation: scoped Codex review at P2, formatting and diff checks passed. Two attempts on the coordinator Testbox lease failed during file sync before installation or tests. Baseline regression proof, the full matrix and the changed-lane gate remain pending.
* test(agents): inject the gateway caller into same-session delivery routing tests
* test(subagents): route direct requester-yield callers through prepared cron authority
* refactor(subagents): keep the requester wake currency assertion module-private
* fix(agents): fence failed and delayed subagent cleanup
Restore the previous resident row when same-ID registration persistence fails.
Carry collector cleanup authority into attachment removal, and bind lifecycle
grace timers to their captured registration and generation.
Regression coverage exercises failed writes, retirement during cleanup, and
same-ID successors without changing storage or timer durations.
* fix(agents): retain paused state in compact registry reads
Read pauseReason from existing stored JSON for ordinary and private-parent
records so cold projections preserve the resident paused status. Derive compact
SQL row types from the query and shrink the removed-assertion allowance.
No schema, serialized representation, or migration changes are required.
* fix(agents): preserve spawn cleanup and request scope
Route fork lookup failures through provisional-child cleanup. Reuse the spawn
admission owner for visible work with the resolved requester agent identity.
Pass trusted-creation transport timeouts through the argument the transport reads.
Consolidate in-process dispatch while preserving creation custody, source
fencing, per-interface deadlines, and signed fallback behavior.
* refactor(agents): simplify subagent registry and spawn owners
Remove unused registry APIs, callback declarations, presentation adapters,
registration inputs, and bootstrap scaffolding. Share registration ACK control
flow while retaining both durable writes and the original settlement error owner.
Complete keyed capability lookups, reuse heartbeat and timeout owners, carry
resolved model references, and remove obsolete ACP transcript work and relay
options. Preserve legacy stored attachment safety and protocol-v4 fallbacks.
* refactor(agents): simplify completion consumers and registry publication
Move full-registry fixture writes into test support and require named production mutations. Consolidate publication subscriptions while preserving projection ordering and persistence observer exception isolation. Remove duplicate completion retry scaffolding, runtime barrels, test-only exports, duplicate types, and single-caller adapters.
* chore(agents): shrink retired test API assertion allowance
* test(gateway): preserve real registry operations in agent fixtures
* test(subagents): preserve named publication fixture preconditions
Name all retired fixture rows when replacing describe/list facts. Warm the compact cache before its initial publication so the existing ordering assertion still detects an unintended SQL reload.
* fix(plugin-sdk): preserve capability store compatibility
Retain the public record-or-lookup store contract, including normalized first-match identity lookup and canonical depth fallback for partial records. Keep migrated internal callers on keyed lookups. Restore the base handoff declarations and requester query/caller linkage so the existing SDK declaration gate stays unchanged.
* test(gateway): publish fixture memory ownership
Publish the staged in-memory owner through commitOwnership before asserting describe and list projections. Named durable writes no longer trigger the whole-index rebuild that accidentally discovered the fixture row. Preserve the existing assertions.
* refactor(agents): tighten completion projections and ownership facts
Project only formatter-consumed child fields without mutating authoritative rows, and carry the session resolver's required requesterOwned boolean directly. Preserve formatting, nested identity references, authority checks, and public signatures while resolving the full core lint findings.
* test(agents): retire obsolete benchmark registry mock
Remove the full-registry writer no-op from the memory benchmark's typed module mock after the production writer cutover. Preserve the named-write mock and benchmark behavior.
* test(agents): await requester settlement in live fixtures
Child cleanup can publish before the requester delivery acknowledgement. Join persistence publications until the requester wake settles, preserving the existing delivery assertions and deadlines.
* refactor(agents): retire hidden sessions_send message aliases
Require the canonical message argument already declared by the public tool schema. Remove alias-only reasoning stripping and keep canonical message indentation unchanged.
* fix(agents): decode compact subagent metadata canonically
Replace the separate compact decoder with the canonical codec and session-list projector. Keep bounded SQL metadata projection, private envelopes, and duplicate-key last-value semantics without transferring retained results. Add real-reader duplicate-key and retained-content regression coverage. Schema, persisted bytes, and update behavior are unchanged.
* refactor(agents): remove redundant delivery comments
* perf(agents): restore compact reader after benchmark regression
Revert
|
||
|
|
d0d3ddec2f
|
test: move subagent fixtures to module boundaries (#155727)
Co-authored-by: Peter Steinberger <steipete@gmail.com> |