Context
kimi web can own more than one telemetry pipeline: host-level telemetry and kap-server engine telemetry. PR #2230 intentionally did not change the CLI-wide shutdown contract.
Problem
Independent sequential timeouts allow total shutdown latency to grow with the number of telemetry pipelines. Print/web entrypoints can also drift if each implements its own timer and cleanup ordering.
Scope
- Establish one absolute telemetry shutdown deadline per CLI process exit.
- Pass the remaining budget to each owned telemetry pipeline instead of giving each a fresh full timeout.
- Keep telemetry cleanup best-effort and preserve the existing process exit result.
- Share policy without coupling CLI entrypoints to appender internals.
Acceptance criteria
- Total telemetry shutdown time stays within one configured budget across all pipelines.
- A slow or failed pipeline does not prevent later cleanup or change the command's exit result.
- Web and print lifecycle tests cover multiple pipelines, expired budgets, and rejection paths.
Follow-up to #2230.
Context
kimi webcan own more than one telemetry pipeline: host-level telemetry and kap-server engine telemetry. PR #2230 intentionally did not change the CLI-wide shutdown contract.Problem
Independent sequential timeouts allow total shutdown latency to grow with the number of telemetry pipelines. Print/web entrypoints can also drift if each implements its own timer and cleanup ordering.
Scope
Acceptance criteria
Follow-up to #2230.