Skip to content

fix(examples): make both examples run and typecheck them - #9

Open
Alexi5000 wants to merge 1 commit into
mainfrom
fix/examples-runtime-6
Open

Alexi5000 wants to merge 1 commit into
mainfrom
fix/examples-runtime-6

Conversation

@Alexi5000

Copy link
Copy Markdown
Owner

Closes #6

Both examples crashed at runtime, and the README printed CIPHERCLAW_MANIFEST.agents (undefined).

The crashes reported in the issue were the first of many: the examples were written against an older API shape (metadata instead of attributes, source/target/path instead of sourceAgentId/targetAgentId/propagationPath, recoverable, predictedFailure, errorBreakdown, endTime/startTime on sessions). tsconfig.json only includes src/, so nothing caught it.

Changes:

  • examples/openclaw-integration.ts, README.md: remove .agents usage (the capability manifest has skills/tools/events/configuration only).
  • examples/basic-usage.ts: root causes resolved via cc.getRootCauses() (returns CausalNode[]), printed by operation.
  • Both examples: objects now match Trace/Span/SpanEvent/HierarchyDebugEvent; nullable returns are checked.
  • New tsconfig.examples.json (noEmit, extends tsconfig); pnpm typecheck now also runs it, so CI's existing Type check step covers the examples. No library source changed.

Verification (pnpm 9, Node 22):

  • npx tsx examples/basic-usage.ts exit 0; npx tsx examples/openclaw-integration.ts exit 0
  • pnpm typecheck ok, pnpm test 270 passed, pnpm build ok

🤖 Generated with Claude Code

- openclaw-integration.ts and README: drop CIPHERCLAW_MANIFEST.agents,
  which the capability manifest does not have.
- basic-usage.ts: resolve root causes to CausalNode via getRootCauses()
  instead of reading .span.name off node-id strings.
- Both examples: build Trace/Span/SpanEvent/HierarchyDebugEvent objects
  with the real field names (attributes, parentSpanId, rootSpanId,
  propagationPath, ...), use recoverability/predictedFailureType, and
  null-check report/fingerprint/session results.
- Add tsconfig.examples.json and run it from pnpm typecheck so the
  examples cannot drift from the API again.

Closes #6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kilo-code-bot

kilo-code-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

Kilo Code Review could not run — your account is out of credits.

Add credits or switch to a free model to enable reviews on this change.

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.

Both examples crash at runtime and README reads nonexistent CIPHERCLAW_MANIFEST.agents

1 participant