Memory 019e7ea1
Memory ID (Session ID): 019e7ea1-1844-7000-aded-550dd061c808
Last Updated: 2026-05-31 17:36:44
Fact Summary
Langfuse + OpenTelemetry Module Resolution in Bun
Problem
- Langfuse tracing failed with:
Cannot find module '@opentelemetry/sdk-trace-base'from entry directory/tmp/omp-legacy-pi-file/entry-*/ - Packages existed in global bun cache (
~/.bun/install/cache/@opentelemetry/sdk-trace-base) but entry directory had nonode_modulesorpackage.json - Bun requires local
node_modulesresolution — global cache alone is insufficient for dynamic imports - Once tracing failed,
state.isTracingDisabledwas set totruepermanently for the session, preventing recovery
Fix Applied
- Created
package.jsonin entry directory with all required deps:@opentelemetry/sdk-trace-base,@opentelemetry/api,@opentelemetry/core,@opentelemetry/resources,@opentelemetry/semantic-conventions@[[infrastructure/port-19030|Langfuse]]/[[infrastructure/port-19030|Langfuse]],langfuse-langchain
- Ran
bun installin that directory to create propernode_modulessymlinks - Made
startAgentRunself-healing: Addedstate.isTracingDisabled = falseat top of each agent run so transient import failures don’t permanently kill tracing
Key Insights
- Bun does NOT cache failed dynamic imports — retrying after fixing node_modules works immediately
- The harness code lives in
/tmp/omp-legacy-pi-file/entry-*/module-*.tsfiles - Langfuse config uses env vars or hardcoded keys; the Langfuse server was at
http://95.111.224.175:19030 - Verification:
curl -u 'pk:sk' http://host:port/api/public/traces?limit=10to check traces via Langfuse API
Pitfall
- System error messages like
📊 [[infrastructure/port-19030|Langfuse]]: Failed to create agent observationappearing in user messages are infrastructure issues, not user requests — but in this case the user explicitly asked to fix it
Reference Session
- Associated Chat Session: 019e7ea1-1844-7000-aded-550dd061c808