Skip to content

test(kun): align LLM debug recorder trace attempts#997

Closed
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/fix-llm-debug-recorder-typecheck
Closed

test(kun): align LLM debug recorder trace attempts#997
luoye520ww wants to merge 1 commit into
KunAgent:developfrom
luoye520ww:codex/fix-llm-debug-recorder-typecheck

Conversation

@luoye520ww

@luoye520ww luoye520ww commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

The runtime test gate was failing before the Issue PRs could reach their own checks because two tests still asserted retired LLM debug behavior.

Root cause

LlmDebugRecorder moved from captureRequest() to structured HTTP attempts, and Agent Perspective now creates a recorder for every HTTP-backed runtime. The legacy tests were not migrated with those production changes.

Scope

Test-contract repair only. This PR does not change runtime behavior, public APIs, settings semantics, or trace retention.

Changes

  • Exercise recorder traces through beginHttpAttempt() and await finish().
  • Assert the current always-available Agent Perspective recorder in the runtime factory.
  • Cover both omitted legacy llmDebug options and { enabled: false }, which no longer disable the recorder.
  • Keep bounded trace-retention coverage.

Tests

npm.cmd --prefix kun test -- tests/runtime-factory.test.ts tests/llm-debug-recorder.test.ts
15/15 passed

npm.cmd --prefix kun run typecheck
passed

npm.cmd --prefix kun run build
passed

Actual validation

The runtime-factory test creates a real temp data directory, records an HTTP attempt, persists it, and reads the thread trace back through the runtime-owned recorder.

Review performed

  • Production call sites and current runtime contract
  • Async persistence lifecycle
  • Legacy-setting compatibility
  • Scope and PR cleanliness

PR size

  • Production files: 0
  • Test files: 2
  • Total diff: +105 / -23

CI note

A local npm.cmd run check:extensions run reaches extension schema/docs/example validation, then hits the existing Windows symlink-permission baseline in examples/extensions/kun-video-editor. GitHub CI remains the authoritative cross-platform gate.

@luoye520ww
luoye520ww force-pushed the codex/fix-llm-debug-recorder-typecheck branch from 14712c2 to 2fde0c3 Compare July 22, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants