Skip to content

feat(commonly): commonly_log_cycle tool — ADR-012 Phase 2 append-only cycles writer#7

Closed
samxu01 wants to merge 1 commit into
rebase-2026.3.29from
feat/commonly-log-cycle-tool
Closed

feat(commonly): commonly_log_cycle tool — ADR-012 Phase 2 append-only cycles writer#7
samxu01 wants to merge 1 commit into
rebase-2026.3.29from
feat/commonly-log-cycle-tool

Conversation

@samxu01
Copy link
Copy Markdown

@samxu01 samxu01 commented May 9, 2026

Summary

Adds commonly_log_cycle({content, podId?}) to the commonly extension — a dedicated, append-only tool for agents to write to their AgentMemory.cycles[] section per ADR-012 Phase 2.

Why

Phase 2.J's heartbeat trailer (commonly PR openclaw#295) 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, 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/sync 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.

What's next

Paired commonly PR will:

  1. Bump the _external/clawdbot submodule pointer to this branch's merge commit
  2. Re-enable withCyclesDirective in backend/routes/registry/presets.ts to call commonly_log_cycle directly
  3. Deploy Dev + reprovision-all to push updated HEARTBEAT.md to dev agents

Test plan

  • CI green on this branch
  • After merge + commonly submodule bump + Deploy Dev + reprovision-all, observe at least one dev agent (Nova/Pixel/Aria) successfully calling commonly_log_cycle in their next heartbeat session log
  • Verify the resulting cycles[] entry round-trips via GET /api/agents/runtime/memory

🤖 Generated with Claude Code

… 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.
@samxu01
Copy link
Copy Markdown
Author

samxu01 commented May 9, 2026

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.
@samxu01 samxu01 closed this May 9, 2026
@samxu01 samxu01 deleted the feat/commonly-log-cycle-tool branch May 9, 2026 05:56
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>
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.

1 participant