()
| 721 | sessionEnv.NEXTAUTH_URL = sessionNextAuthUrl; |
| 722 | } |
| 723 | // The enriched tRPC timing line carries the client dimensions and the |
| 724 | // per-call `x-kilo-request-id` that joins it with the app's client_latency |
| 725 | // sample, and mobile traffic logs at 100% while other clients stay sampled. |
| 726 | // Emit it in local development without an operator remembering the switch; |
| 727 | // production keeps its own deployment setting. |
| 728 | if (serviceNames.includes('nextjs')) { |
| 729 | sessionEnv.TRPC_TIMING_LOGGING = '1'; |
| 730 | } |
| 731 | if (process.env.DEBUG_SHOW_DEV_UI !== undefined && process.env.DEBUG_SHOW_DEV_UI !== '') { |
| 732 | sessionEnv.DEBUG_SHOW_DEV_UI = process.env.DEBUG_SHOW_DEV_UI; |
| 733 | } |
| 734 | if (process.env.SKIP_STRIPE_API !== undefined && process.env.SKIP_STRIPE_API !== '') { |
| 735 | sessionEnv.SKIP_STRIPE_API = process.env.SKIP_STRIPE_API; |
| 736 | } |
| 737 | if ( |
| 738 | process.env.NEXT_PUBLIC_POSTHOG_KEY !== undefined && |
| 739 | process.env.NEXT_PUBLIC_POSTHOG_KEY !== '' |
| 740 | ) { |
| 741 | sessionEnv.NEXT_PUBLIC_POSTHOG_KEY = process.env.NEXT_PUBLIC_POSTHOG_KEY; |
| 742 | } |
| 743 | const deletionMockEnv = resolveDeletionMockSessionEnv({ |
| 744 | serviceNames, |
| 745 | mockPort: getService('deletion-mock').port, |
| 746 | }); |
| 747 | if (deletionMockEnv) Object.assign(sessionEnv, deletionMockEnv); |
| 748 | const fakeLlmEnv = resolveFakeLlmSessionEnv({ serviceNames }); |
| 749 | if (fakeLlmEnv) Object.assign(sessionEnv, fakeLlmEnv); |
| 750 | const e2eInternalSecretEnv = resolveE2eInternalSecretSessionEnv({ serviceNames }); |
| 751 | if (e2eInternalSecretEnv) Object.assign(sessionEnv, e2eInternalSecretEnv); |
| 752 | createSession(sessionName, sessionEnv); |
| 753 | |
| 754 | const SIDEBAR_WIDTH = 40; |
| 755 | |
| 756 | // The fake-LLM Worker is a capture service too: the public-tunnel service |
| 757 | // probes it before publishing and exits if it is not answering, so it must be |
| 758 | // started and ready before the tunnel capture runs. |
| 759 | const captureServiceSet = new Set([ |
| 760 | 'kiloclaw-tunnel', |
no test coverage detected