Workflow-App/Workflow/app
sjcoetzeesj-coder 92dcae5122 fix(cipc): stop deadlocking wrapper on agent-browser daemon start
runAb() in scripts/_cipc_service.js resolved only on proc.on('close'),
but agent-browser is a daemon-per-session CLI. When it has to START the
session browser daemon (first call after a reboot, after the daemon died,
or after the app restarts), the new daemon inherits the spawned CLI
stdout pipe. The pipe then never reaches EOF, so Node 'close' event
never fires - even though the CLI exited cleanly with code 0. The 30s
timeout in runAb called proc.kill(SIGTERM), but the process had already
exited, so the kill was a no-op and the promise never settled. The
wrapper serialised mutex then held inFlight forever, every later request
queued behind it, and CIPC search silently 500-ed for days with no log
line to show why - which is what made this look like a flaky / restart-
only issue.

Fixes:
  - runAb now settles on 'exit' (with a 250ms flush grace for stdio to
    drain), escalates the timeout kill to SIGKILL, and guarantees an
    unconditional forced settle if neither fires. The promise can no
    longer remain pending.
  - app/api/cipc/search/route.ts: ensureWrapperService() now probes port
    6002 on every search and respawns the wrapper (rate-limited to once
    per 30s) if it is down. Hot reloads still no-op once a wrapper is up,
    but a dead wrapper now self-heals instead of 500-ing forever.

Verified end to end: killed the browser daemon and the wrapper, started
a fresh wrapper, its first isWarm() spawned a new daemon (the previous
deadlock path) and returned in under 1s. A real enterprise search of
K2018435959 came back in 31.7s on the cold path and 50.9s on the warm
path with full company + director data.
2026-10-19 13:40:36 +02:00
..
(public) feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
(public-register) feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
api fix(cipc): stop deadlocking wrapper on agent-browser daemon start 2026-10-19 13:40:36 +02:00
bizportal feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
bizportal-2 feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
cipc fix: resolve all 7 type errors that broke the production build 2026-10-18 15:48:50 +02:00
cipc-2 fix: resolve all 7 type errors that broke the production build 2026-10-18 15:48:50 +02:00
companies feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
compliance feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
directors feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
groups feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
login feat(auth): password gate replacing the IP-only middleware guard 2026-10-18 18:39:27 +02:00
notes fix(notes): sort by -id instead of -created (PB 400 on fresh collection sort=created) 2026-09-17 13:19:15 +02:00
onboarding feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
registrations feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
resign/[token] feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
resolutions feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
resolve-sign/[token] feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
sars-registrations feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
sars-returns feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
sign/[token] feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
step2/[id] feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
tasks feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
voice-demo feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
error.tsx feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
global-error.tsx feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
globals.css feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
icon.png feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
layout.tsx feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
not-found.tsx feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
page.tsx feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00
providers.tsx feat: commit Workflow app source; move CIPC credentials to env 2026-10-18 15:21:45 +02:00