feat(openclaw): enable observation feed for OpenClaw agent sessions
Three fixes to make OpenClaw agent observations work end-to-end: 1. Session init in before_agent_start — the worker's privacy check requires a stored user prompt; without calling /api/sessions/init, all observations were skipped as "private" 2. Race condition fix in agent_end — await summarize before sending complete, preventing session deletion before in-flight observation POSTs arrive 3. OAuth token pass-through in buildIsolatedEnv — spawned Claude CLI processes now receive CLAUDE_CODE_OAUTH_TOKEN from the worker's env when no explicit API key is configured Also adds agent-specific emoji mapping and dynamic project naming for the Telegram observation feed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -346,7 +346,7 @@ describe("Observation I/O event handlers", () => {
|
||||
assert.equal(initRequests.length, 1, "should re-init after compaction");
|
||||
});
|
||||
|
||||
it("before_agent_start does not call init", async () => {
|
||||
it("before_agent_start calls init for session privacy check", async () => {
|
||||
const { api, fireEvent } = createMockApi({ workerPort });
|
||||
claudeMemPlugin(api);
|
||||
|
||||
@@ -354,7 +354,7 @@ describe("Observation I/O event handlers", () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
|
||||
const initRequests = receivedRequests.filter((r) => r.url === "/api/sessions/init");
|
||||
assert.equal(initRequests.length, 0, "before_agent_start should not init");
|
||||
assert.equal(initRequests.length, 1, "before_agent_start should init session");
|
||||
});
|
||||
|
||||
it("tool_result_persist sends observation to worker", async () => {
|
||||
|
||||
Reference in New Issue
Block a user