Skip to content

Identity files and Channel interface - #4

Merged
melvincarvalho merged 1 commit into
mainfrom
issue-3-identity-channels
Jun 10, 2026
Merged

melvincarvalho merged 1 commit into
mainfrom
issue-3-identity-channels

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Closes #3

What

Phase 2 of openclaw parity, building on the scheduler/heartbeat from #2.

Identity files (SOUL.md and friends)

The agent runner now loads SOUL.md, IDENTITY.md, AGENTS.md, TOOLS.md, USER.md from the group workspace into the system prompt — same files, same order as openclaw. All optional; JSCLAW_SYSTEM_PROMPT is appended after, so the existing override hook still works. Pure container-side change: the files live in the already-mounted group folder, no new mounts.

Channel interface

src/channel.js formalizes the I/O contract:

  • Channel typedef: name, connect(), disconnect(), sendMessage(jid, text, sender?), ownsJid(jid), isConnected(), optional setTyping()
  • ChannelManager: registration with duplicate/shape validation, connectAll()/disconnectAll() (one failing channel doesn't block others), outbound routing by ownsJid, best-effort typing indicators
  • manager.sendMessage is bound so it drops directly into startIpcWatcher's sendMessage dependency

Telegram example

Rewritten around the Channel interface and the now-complete task loop: TaskStore + createTaskIpcHandler + startTaskScheduler, so an agent on Telegram can schedule its own follow-ups and they actually fire.

Verified

  • ChannelManager functional test: ownsJid routing, unowned-JID rejection, disconnected-channel refusal, connectAll recovery, duplicate/invalid registration throws, disconnectAll
  • Syntax checks on all touched files; 29 package exports

Version bumped to 0.0.3 (not published).

Phase 2 of openclaw parity:

- container/agent-runner.js: load SOUL.md, IDENTITY.md, AGENTS.md,
  TOOLS.md, USER.md from the group workspace into the system prompt
  (all optional, openclaw ordering); JSCLAW_SYSTEM_PROMPT appended after
- src/channel.js: Channel typedef (name, connect, disconnect,
  sendMessage, ownsJid, isConnected, optional setTyping) and
  ChannelManager with ownsJid-based outbound routing, connectAll/
  disconnectAll, best-effort typing indicators; sendMessage binds
  directly as startIpcWatcher's sendMessage dep
- examples/telegram.js: rewritten around the Channel interface and the
  completed task loop (TaskStore + createTaskIpcHandler +
  startTaskScheduler) — agents can now schedule their own follow-ups

Bumps version to 0.0.3 (no npm publish).

Closes #3
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.

Phase 2: SOUL.md identity files and formal Channel interface

1 participant