Skip to content

Conversation

@delorenj
Copy link
Contributor

@delorenj delorenj commented Jan 4, 2026

  • openrouter
  • Fix race condition causing worker startup failures
  • Add database-level deduplication to prevent duplicate observations
  • chore: modify; code; in; plugin,; remove; obsolete; .swarm/memory.db\n\n 10 files changed, 268 insertions(+), 294 deletions(-)\n

delorenj and others added 6 commits December 28, 2025 16:51
Removed redundant worker start commands from UserPromptSubmit, PostToolUse,
and Stop hooks that were causing multiple worker instances to race for port
37777. Worker now starts only during SessionStart; hook scripts use
ensureWorkerRunning() to poll for readiness instead of launching new processes.

This eliminates the "Process died during startup" error that occurred when
hooks fired concurrently.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Multiple hook executions from different plugin versions and duplicate
hook registrations in ~/.claude/settings.json were causing the same
observations to be saved multiple times with identical timestamps.

Changes:
- Add deduplication check in SessionStore.storeObservation() that prevents inserting duplicate observations within a 1-second window
- Check for existing observation with same session, title, and timestamp before INSERT
- Return existing observation ID instead of creating duplicate
- Change worker host binding from 127.0.0.1 to 0.0.0.0 for network accessibility
- Rebuild plugin artifacts with updated deduplication logic

This is a defense-in-depth fix that complements the cleanup of:
- Removed duplicate hook registrations from ~/.claude/settings.json
- Cleaned up old plugin versions (7.4.0, 8.2.0)
- Updated plugin registry to use only v8.2.5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…n\n 10 files changed, 268 insertions(+), 294 deletions(-)\n
Copilot AI review requested due to automatic review settings January 4, 2026 18:53
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79f0f75832

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1247 to +1251
if (observation.title) {
const existing = this.db.prepare(`
SELECT id, created_at_epoch FROM observations
WHERE sdk_session_id = ? AND title = ? AND ABS(created_at_epoch - ?) < 1000
`).get(sdkSessionId, observation.title, timestampEpoch) as { id: number; created_at_epoch: number } | undefined;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Dedup query references missing sdk_session_id

The new deduplication block in storeObservation queries observations using sdk_session_id and passes sdkSessionId, but the table schema defines memory_session_id (see earlier migration) and this method only receives memorySessionId. Because sdkSessionId is undefined and the column does not exist, any observation with a title will hit this path and SQLite will throw no such column: sdk_session_id before the insert, preventing observations from being stored. The dedup check should use the correct column/parameter or be removed.

Useful? React with 👍 / 👎.

- Add `scripts/dev-sync.sh` for deterministic plugin build/sync/restart
- Add `mise.toml` with tasks for sync, logs, and health checks
- Add session warning when plugin is updated mid-session
- Update `context-hook` to prepend update warning if needed
- Add `.swarm/` to .gitignore
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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