Skip to content

feat(adapters): openclaw adapter #116

Description

@aktasbatuhan

Goal

Add an adapter so watchmen captures openclaw sessions alongside Claude Code, Codex, pi.dev, OpenCode, and Cursor (#113). One corpus across tools.

Adapter contract

Per src/watchmen/adapters/init.py, a new adapter is a module exposing:

  • NAME: str
  • discover() -> Iterable[FileEntry] (walk the install path, yield sessions; return [] when openclaw isn't installed)
  • scan(entry) -> (session_dict, prompts, tool_calls)

It registers in the ADAPTERS tuple. claude_code / codex are the cleanest references for a JSONL-on-disk source; cursor.py is the reference for a SQLite key-value store.

Open questions (resolve before coding)

  • Where does openclaw persist sessions on disk, and in what format (JSONL per session? a SQLite store? something else)?
  • Does it expose per-turn token usage / cost reliably? (If not, leave those at 0 rather than guessing from a price table, like the cursor adapter.)
  • Is there a tool-call + outcome signal we can map to is_error / friction signatures (feat: friction ledger — recurring mistakes grouped by error signature (#110) #110)?
  • How are skills detected (SKILL.md path heuristic, like the non-Claude adapters)?

Acceptance criteria

  • Document the on-disk session format
  • Implement discover() + scan() against synthetic fixtures
  • Register in ADAPTERS and add to the README agent list
  • Unit tests covering the conversation shape(s), tool calls, and skill detection
  • Full suite green, no regressions

Note: storage location/format is unconfirmed; first task is to nail that down before writing the parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions