Skip to content

fix(agent-runner): open inbound.db fresh per messages_in read#2160

Merged
gavrielc merged 2 commits into
nanocoai:mainfrom
kky:pr/inbound-db-fresh-open
May 1, 2026
Merged

fix(agent-runner): open inbound.db fresh per messages_in read#2160
gavrielc merged 2 commits into
nanocoai:mainfrom
kky:pr/inbound-db-fresh-open

Conversation

@kky
Copy link
Copy Markdown

@kky kky commented Apr 30, 2026

Type of Change

  • Feature skill - adds a channel or integration (source code changes + SKILL.md)
  • Utility skill - adds a standalone tool (code files in .claude/skills/<name>/, no source changes)
  • Operational/container skill - adds a workflow or agent skill (SKILL.md only, no source changes)
  • Fix - bug fix or security fix to source code
  • Simplification - reduces or simplifies source code
  • Documentation - docs, README, or CONTRIBUTING changes only

Description

Cached singleton can return stale rows on virtiofs/NFS mounts, causing follow-up messages to silently never be polled. Add openInboundDb() with mmap_size=0 and switch the three messages_in readers to it. Cost is microseconds per query, so safe as a universal default.

Add openInboundDb() that opens fresh per call with PRAGMA mmap_size = 0 and switch the three messages_in readers to it with try/finally close. The singleton stays for write-once tables (destinations, session_routing) and also gets mmap_size = 0 for safety.

Tested on Apple Silicon + Colima: prior to the fix, follow-up messages silently never reached the agent; after the fix, multi-turn chat works reliably.

Cached singleton can return stale rows on virtiofs/NFS mounts,
causing follow-up messages to silently never be polled. Add
openInboundDb() with mmap_size=0 and switch the three messages_in
readers to it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added follows-guidelines PR was created using the current contributing template PR: Fix Bug fix labels Apr 30, 2026
@gavrielc gavrielc merged commit 20a17cb into nanocoai:main May 1, 2026
@gavrielc
Copy link
Copy Markdown
Collaborator

gavrielc commented May 1, 2026

@kky Thank you for the contribution!!

mzazon added a commit to mzazon/nanoclaw that referenced this pull request May 6, 2026
Brings in 202 upstream commits since our last sync. Key additions:
- Circuit breaker for crash loop protection
- Outbox path-confinement security fix (nanocoai#2001)
- Inbound DB fresh-open fix for virtiofs/NFS (nanocoai#2160)
- Orphan processing_ack cleanup (nanocoai#2151)
- Pre-task scripts on follow-up poll injections (nanocoai#2114)
- Attachment naming/safety refactor
- Setup flow improvements (splash, headless, env reuse)
- Channel approval flow enhancements

Conflict resolution:
- Dockerfile: kept OPENCODE_VERSION, adopted upstream's pinned Vercel 52.2.1
- poll-loop.ts: took upstream's async pre-task handling (subsumes our try/catch guard)
- agent-route.ts: took upstream's factored-out isSafeAttachmentName
- src/index.ts: kept both readEnvFile and new circuit-breaker imports
- setup/verify.ts, agent-ping.ts: took upstream's simplified verify flow
- package.json: took upstream version 2.0.25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

follows-guidelines PR was created using the current contributing template PR: Fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants