a1a7f442a7d40e4c468a075cea17627e6f7cfefe
Previously the endpoint returned a single JSON object at the end. Apache+ PHP-FPM buffers the entire body until PHP exits, so a 160s azure_full run caused the browser to drop the fetch as "Failed to fetch" while the server was still synthesising — the response then arrived to a dead socket. Switch to application/x-ndjson with one event per line. The endpoint emits 'progress', 'start', 'step' (running/complete/warning/error), 'subq', and a final 'final' event carrying the full result payload. Output buffering is explicitly disabled so each line flushes through Apache as soon as the agent emits it. DbnDeepResearchAgent::run() now accepts an optional ?callable $emit and fires step:running before each step + step:complete after, plus a subq event per sub-question retrieval round. JS reads response.body as a stream, splits on newlines, updates the trace panel live, and renders the final result when the final event arrives. Status pill shows live progress detail (e.g. "Synthesising with Azure gpt-4o — this is the slowest step…"). Engine row in the form now shows expected duration per engine (~15-45s mini, ~60-180s full, ~30-90s GPU) so users know what they're in for before clicking Run.
Do Better Norge Legal Tools Hub
MVP docroot for tools.dobetternorge.no.
Required environment
- CaveauAI client access for
DBN_CAVEAU_CLIENT_SLUGandDBN_CAVEAU_PACKAGE_SLUG DBN_AZURE_OPENAI_ENDPOINTDBN_AZURE_OPENAI_API_KEYDBN_AZURE_OPENAI_API_VERSIONDBN_AZURE_OPENAI_CHAT_DEPLOYMENTDBN_AZURE_OPENAI_EMBEDDING_DEPLOYMENT
Optional:
DBN_AI_PORTAL_ROOT(defaults to siblingai-portal)DBN_CAVEAU_CLIENT_SLUG(defaults todobetter)DBN_CAVEAU_PACKAGE_SLUG(defaults tofamily-legal)DBN_TOOLS_SUPPORT_DIRDBN_TOOLS_METADATA_LOG
Authentication
The login form authenticates against Caveau client_users for the configured
client slug. The client must be active, the user must be active, and the client
must have an active subscription to the configured corpus package.
Use scripts/setup-caveau-access.php for repeatable local/production setup of
the Do Better Norge Caveau owner account, family-legal subscription, and
white-label domain mappings. Pass the account password through
DBN_SETUP_PASSWORD at runtime only; do not commit it.
The APIs process pasted text in memory and write only metadata such as tool name, latency, language, source count, chunk count, deployment, and anonymous session id.
Description
Languages
PHP
77.3%
JavaScript
13.6%
CSS
9.1%