Skip to content

feat(memory): re-enable ADR-012 cycle-reflection trailer via commonly_log_cycle#307

Closed
samxu01 wants to merge 2 commits intomainfrom
feat/cycles-tool-forward-fix
Closed

feat(memory): re-enable ADR-012 cycle-reflection trailer via commonly_log_cycle#307
samxu01 wants to merge 2 commits intomainfrom
feat/cycles-tool-forward-fix

Conversation

@samxu01
Copy link
Copy Markdown
Contributor

@samxu01 samxu01 commented May 9, 2026

Summary

Why

Phase 2.J (#295) instructed agents to call commonly_save_my_memory({sections:{cycles:{append:...}}}), but that tool accepts neither the cycles section nor the nested {sections:{...}} shape. Agents burned 3+ tool-call turns per heartbeat hunting for a missing surface and dropped DM responses (Nova on 2026-05-04). PR #296 reverted the trailer to a no-op while a forward fix was built.

The forward fix is a one-call surface that maps directly onto the kernel's contract ({cycles:{append:{content,podId?}}} via /memory/sync, mode: 'patch'). Append-only by construction at the tool boundary.

After merge

  1. gh workflow run deploy-dev.yml --ref main — rebuilds gateway + backend with the bumped submodule
  2. reprovision-all — pushes new HEARTBEAT.md to all dev agents
  3. Observe a heartbeat window for cycles[] writes from at least one dev agent (Nova/Pixel/Aria). Original Phase 2 observation logged 0 agent-authored cycle entries across 25 agents in +10min.

Test plan

  • CI green (TS compile + tests)
  • Post-deploy: at least one dev agent calls commonly_log_cycle in their next heartbeat session log
  • GET /api/agents/runtime/memory for that agent shows the new cycles[] entry
  • No DM regression — same agent answers a fresh @<agent> hey ping within the heartbeat window

🤖 Generated with Claude Code

samxu01 added 2 commits May 8, 2026 22:56
…cycle tool

Pairs with the trailer re-enable in the next commit. The bumped openclaw
extension exposes commonly_log_cycle({content, podId?}) — a dedicated,
append-only writer for AgentMemory.cycles[] per ADR-012 Phase 2.

Team-Commonly/openclaw PR #7 (squash-merged as a67f0df6).
…y_log_cycle

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 shipped in Team-Commonly/openclaw#7 (a67f0df6, submodule bumped
in the previous commit): adds a dedicated commonly_log_cycle({content,
podId?}) tool that maps directly onto the kernel's
{cycles:{append:{content,podId?}}} contract via /memory/sync.

This commit:
- 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).
samxu01 added a commit 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>
@samxu01
Copy link
Copy Markdown
Contributor Author

samxu01 commented May 9, 2026

Squash-merged via local push as f4b7a48 per repo merge convention.

@samxu01 samxu01 closed this May 9, 2026
@samxu01 samxu01 deleted the feat/cycles-tool-forward-fix branch May 9, 2026 07:15
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