Bug Description
gbrain embed (both --stale and --all) hangs indefinitely on PGLite backend without making any HTTP requests to the embedding provider. The process runs for 90+ seconds with zero output and zero network activity, then requires SIGTERM to kill. gbrain dream --dry-run correctly detects unstale chunks, but the actual embed execution deadlocks internally.
Environment
- gbrain version: 0.35.1.0
- OS: macOS 12.7.6 (Intel Core i7-6700HQ)
- Backend: PGLite (
~/.gbrain/brain.pglite)
- Embedding providers tested: Ollama (nomic-embed-text), MiniMax (embo-01), custom OpenAI-compatible proxy → all same behavior
- Installation method:
bun add -g gbrain
Steps to Reproduce
-
Have a brain with unstale chunks (any page with embeddings not yet generated):
gbrain dream --dry-run # confirms N chunks pending embed
-
Run embed:
gbrain embed --stale
# or
gbrain embed --all
-
Observe: process hangs with no output. No HTTP requests reach the embedding provider (verified via proxy logs and network monitoring).
-
SIGTERM required to stop the process (kill <pid>).
Expected Behavior
gbrain embed --stale should iterate through unstale chunks, send embedding requests to the configured provider, and update the vector index in PGLite.
Actual Behavior
Process hangs silently. Key observations:
- No HTTP requests are ever sent — verified with a local proxy (
http://localhost:4000) that logs every incoming request. Zero requests logged.
- No stdout/stderr output — not even progress indicators or error messages.
gbrain dream --dry-run works correctly — it detects the unstale chunks, so the database query path is functional.
- Same behavior across all providers — Ollama (local), MiniMax (remote), and a custom OpenAI-compatible proxy all exhibit identical behavior, ruling out provider-specific issues.
- PGLite-specific — this appears to be a deadlock or blocking issue in the PGLite embed execution path.
Additional Context
gbrain doctor and gbrain stats work normally on the same PGLite database.
gbrain search (keyword/tsvector) works fine.
- The issue is not a provider timeout — no requests leave the process at all.
- Previous attempts included splitting large pages into smaller ones (2-3 chunks each) to rule out payload size issues — same result.
- Multiple Ollama restarts and full system reboots were attempted — no change.
Workaround
None found. Keyword search (gbrain search) works, but semantic/vector search is unavailable until embed completes.
Bug Description
gbrain embed(both--staleand--all) hangs indefinitely on PGLite backend without making any HTTP requests to the embedding provider. The process runs for 90+ seconds with zero output and zero network activity, then requires SIGTERM to kill.gbrain dream --dry-runcorrectly detects unstale chunks, but the actual embed execution deadlocks internally.Environment
~/.gbrain/brain.pglite)bun add -g gbrainSteps to Reproduce
Have a brain with unstale chunks (any page with embeddings not yet generated):
gbrain dream --dry-run # confirms N chunks pending embedRun embed:
gbrain embed --stale # or gbrain embed --allObserve: process hangs with no output. No HTTP requests reach the embedding provider (verified via proxy logs and network monitoring).
SIGTERMrequired to stop the process (kill <pid>).Expected Behavior
gbrain embed --staleshould iterate through unstale chunks, send embedding requests to the configured provider, and update the vector index in PGLite.Actual Behavior
Process hangs silently. Key observations:
http://localhost:4000) that logs every incoming request. Zero requests logged.gbrain dream --dry-runworks correctly — it detects the unstale chunks, so the database query path is functional.Additional Context
gbrain doctorandgbrain statswork normally on the same PGLite database.gbrain search(keyword/tsvector) works fine.Workaround
None found. Keyword search (
gbrain search) works, but semantic/vector search is unavailable until embed completes.