feat(commonly): commonly_log_cycle tool — ADR-012 Phase 2 append-only cycles writer#7
Closed
samxu01 wants to merge 1 commit into
Closed
feat(commonly): commonly_log_cycle tool — ADR-012 Phase 2 append-only cycles writer#7samxu01 wants to merge 1 commit into
samxu01 wants to merge 1 commit into
Conversation
… cycles writer
Adds a dedicated, append-only tool for agents to write to their AgentMemory
`cycles[]` section per ADR-012 Phase 2. The previously-deployed Phase 2.J
trailer attempted to reuse `commonly_save_my_memory` with a nested
`{sections:{cycles:{append:...}}}` shape, but that tool neither accepts the
`cycles` section nor the nested envelope — agents wasted 3+ tool-call turns
per heartbeat hunting for a missing surface before falling back, exhausting
their turn budget and dropping DM responses. Trailer was rolled back in
commonly commit e4b1dd91ba / PR openclaw#296.
This tool gives agents a one-call surface that matches the kernel's actual
contract: `{cycles: {append: {content, podId?}}}` via the existing
`/api/agents/runtime/memory/sync` endpoint with `mode: 'patch'`. Append-only
by construction at the tool boundary, so the kernel's `cycles_append_only`
guard is never tripped on the happy path.
The commonly trailer in `backend/routes/registry/presets.ts` is being
re-enabled in a paired commonly PR to call this tool directly.
Author
|
Squash-merged via local push as a67f0df per repo merge convention. |
samxu01
added a commit
that referenced
this pull request
May 9, 2026
… cycles writer (#7) Adds a dedicated, append-only tool for agents to write to their AgentMemory `cycles[]` section per ADR-012 Phase 2. The previously-deployed Phase 2.J trailer attempted to reuse `commonly_save_my_memory` with a nested `{sections:{cycles:{append:...}}}` shape, but that tool neither accepts the `cycles` section nor the nested envelope — agents wasted 3+ tool-call turns per heartbeat hunting for a missing surface before falling back, exhausting their turn budget and dropping DM responses. Trailer was rolled back in commonly commit e4b1dd91ba / PR openclaw#296. This tool gives agents a one-call surface that matches the kernel's actual contract: `{cycles: {append: {content, podId?}}}` via the existing `/api/agents/runtime/memory/sync` endpoint with `mode: 'patch'`. Append-only by construction at the tool boundary, so the kernel's `cycles_append_only` guard is never tripped on the happy path. The commonly trailer in `backend/routes/registry/presets.ts` is being re-enabled in a paired commonly PR to call this tool directly.
4 tasks
samxu01
added a commit
to Team-Commonly/commonly
that referenced
this pull request
May 9, 2026
…_log_cycle (#307) Phase 2.J's withCyclesDirective trailer was rolled back in e4b1dd9 / PR #296 because it instructed agents to call: commonly_save_my_memory({sections:{cycles:{append:...}}}) That tool neither accepts the `cycles` section nor the nested `{sections:{...}}` envelope — agents wasted 3+ tool-call turns per heartbeat hunting for the missing surface before falling back to commonly_write_agent_memory, exhausting their turn budget and dropping DM responses (Nova on 2026-05-04). Forward fix: - Bumps `_external/clawdbot` to a67f0df6 (Team-Commonly/openclaw#7) — adds a dedicated `commonly_log_cycle({content, podId?})` tool that maps directly onto the kernel's {cycles:{append:{content,podId?}}} contract via /memory/sync, mode: 'patch'. Append-only by construction. - Rewrites CYCLES_REFLECTION_TRAILER to call commonly_log_cycle directly, no nested envelope, no missing surface. - Restores withCyclesDirective from no-op to template + trailer. - Replaces the rollback comment block with a re-enable note that preserves the failure-mode archaeology for future readers. After Deploy Dev + reprovision-all, dev agents should produce cycles[] writes inside the next heartbeat window — closing the empirical gap from the original Phase 2 observation (0 agent-authored cycle entries across 25 deployed agents in the +10min window). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
commonly_log_cycle({content, podId?})to the commonly extension — a dedicated, append-only tool for agents to write to theirAgentMemory.cycles[]section per ADR-012 Phase 2.Why
Phase 2.J's heartbeat trailer (commonly PR openclaw#295) attempted to reuse
commonly_save_my_memorywith a nested{sections:{cycles:{append:...}}}shape, but that tool neither accepts thecyclessection nor the nested envelope. Agents wasted 3+ tool-call turns per heartbeat hunting for a missing surface, exhausted their turn budget, and dropped DM responses. The trailer was rolled back in commonly commit e4b1dd91ba / PR openclaw#296.This tool gives agents a one-call surface that matches the kernel's actual contract:
{cycles: {append: {content, podId?}}}posted to/api/agents/runtime/memory/syncwithmode: 'patch'. Append-only by construction at the tool boundary, so the kernel'scycles_append_onlyguard is never tripped on the happy path.What's next
Paired commonly PR will:
_external/clawdbotsubmodule pointer to this branch's merge commitwithCyclesDirectiveinbackend/routes/registry/presets.tsto callcommonly_log_cycledirectlyTest plan
commonly_log_cyclein their next heartbeat session logcycles[]entry round-trips viaGET /api/agents/runtime/memory🤖 Generated with Claude Code