Skip to content

fix(lr-9cfc): address PEACHES blocking findings B1/B2/B3#148

Merged
akuehner merged 2 commits into
mainfrom
fix/lr-9cfc-peaches-b1-b2-b3
May 19, 2026
Merged

fix(lr-9cfc): address PEACHES blocking findings B1/B2/B3#148
akuehner merged 2 commits into
mainfrom
fix/lr-9cfc-peaches-b1-b2-b3

Conversation

@akuehner
Copy link
Copy Markdown
Member

Fixes 3 blocking findings from PEACHES review of PR 147 (lr-9cfc). B1: Remove registerClaim loop from attachAgentSession — pre-existing conversations are display-only per task spec, not auto-claimed. B2: Replace hardcoded X-Relay-Caller-Lead header with CLAGENTIC_OPERATOR_LEAD env var. B3: Wire onNewConversation via startSidecarWatcher (fs.watch on sidecar dir, fires onNewConversation on new conv files). Also: fix relayPost error message undefined bug, add relay-absent and fake-server tests, export claim functions for tests. Task: lr-9cfc

akuehner added 2 commits May 19, 2026 14:02
B1 — remove registerClaim loop from attachAgentSession: pre-existing
conversations are now display-only per task spec. Operator decides
per-conversation; no auto-claim at session open to avoid recreating
the stale-claim/zombie-blocking pattern fixed 2026-05-19.

B2 — replace hardcoded X-Relay-Caller-Lead: "andy" with
CLAGENTIC_OPERATOR_LEAD env var (falls back to empty string). Relay
treats absent header as anonymous operator access — safe for
UI-path sessions. No personal identifier in platform code (rule 11).

B3 — wire onNewConversation call site via sidecar directory watcher
(startSidecarWatcher). Fires onNewConversation when a new sidecar
appears with agentName as participant. Watcher starts in
attachAgentSession (relay-present path) and closes in detachAgentSession.
Self-contained in relay-agent-claims.js; project-sessions.js unchanged.

Nits also addressed:
- Fix error message rendering "undefined: <msg>" when parsed.error
  is missing in relayPost (nit 5).
- Export registerClaim/heartbeatClaim/releaseClaim for test use.
- Add onNewConversation relay-absent no-op tests (nit 6).
- Add fake Unix-socket relay server test covering register/heartbeat/
  release HTTP paths (nit 7).
- Update test header comment to match actual coverage.
…ar watcher

startSidecarWatcher now takes a preExistingConvIds Set (snapshot of convs
open at attach-time) and skips any sidecar event for a conv_id in that set.
This prevents sidecar rewrites (new messages on existing convs) from
triggering auto-claim — operator must explicitly claim pre-existing convs.

Also fixes per-filename debounce (was a single shared closure var; concurrent
events for different files could cancel each other) and removes os.homedir()
fallback to hardcoded "/root" path.

Regression test added: B4 scenario with a fake relay server, pre-existing
sidecar rewrite, and a new conv sidecar — asserts pre-existing not claimed,
new conv is claimed.

Co-Authored-By: akuehner@users.noreply.github.com
@akuehner akuehner merged commit 5bc1e21 into main May 19, 2026
1 check passed
@akuehner akuehner deleted the fix/lr-9cfc-peaches-b1-b2-b3 branch May 19, 2026 18:50
@clagentic-release-bot
Copy link
Copy Markdown

This issue has been resolved in version 1.2.0-beta.2 (beta).

To update, run:

npx @clagentic/console@1.2.0-beta.2

@clagentic-release-bot
Copy link
Copy Markdown

This issue has been resolved in version 1.2.0 (stable).

To update, run:

npx @clagentic/console@1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant