Skip to content

Comments

feat: XDG Base Directory Specification for logging#214

Closed
shuv1337 wants to merge 1 commit intoopenclaw:mainfrom
shuv1337:feat/xdg-logging
Closed

feat: XDG Base Directory Specification for logging#214
shuv1337 wants to merge 1 commit intoopenclaw:mainfrom
shuv1337:feat/xdg-logging

Conversation

@shuv1337
Copy link

@shuv1337 shuv1337 commented Jan 5, 2026

Summary

Move logging directory from /tmp/clawdbot to XDG-compliant location.

Changes

  • Add resolveXdgStateHome() and resolveLogDir() to config/paths.ts
  • Update logging.ts to use XDG state directory
  • Default: ~/.local/state/clawdbot/logs
  • Override: CLAWDBOT_LOG_DIR environment variable

Benefits

  • Logs persist across reboots (no more /tmp cleanup)
  • Follows XDG Base Directory Specification
  • Central location for log monitoring/analysis
  • Works with ralph loops and other agent observability tools

- Add resolveXdgStateHome() and resolveLogDir() to config/paths.ts
- Move log directory from /tmp/clawdbot to $XDG_STATE_HOME/clawdbot/logs
- Default: ~/.local/state/clawdbot/logs
- Override via CLAWDBOT_LOG_DIR environment variable
- Follows XDG spec: https://specifications.freedesktop.org/basedir-spec/

This enables centralized, persistent logging that survives reboots
and follows the freedesktop.org standard for user state files.
@shuv1337 shuv1337 closed this Jan 5, 2026
dgarson added a commit to dgarson/clawdbot that referenced this pull request Feb 7, 2026
* feat: add configurable subsystem debug log suppression

* docs: add changelog entry and test script for suppressSubsystemDebugLogs

* docs: add implementation summary

* feat(meridia): multi-factor memory relevance scoring system

Implement a comprehensive scoring system that evaluates whether experiences
should become long-term memories based on five weighted factors:

- **Novelty**: Is this new information or repetition?
- **Impact**: Does this change understanding, behavior, or system state?
- **Relational**: Does this connect to known entities/people/projects?
- **Temporal**: Is this time-sensitive or evergreen?
- **User Intent**: Was this explicitly marked as important?

Features:
- Configurable weights for each factor (normalized to sum to 1.0)
- Named threshold profiles: balanced, aggressive, conservative, minimal
- Override rules for specific tools (glob-pattern matching)
- evaluateMemoryRelevance() as primary entry point
- shouldCapture(), shouldPersistToGraph(), shouldUseLlmEval() helpers
- Backward-compatible evaluateHeuristic() now delegates to scoring system
- New evaluateHeuristicDetailed() returns full scoring breakdown
- 37 comprehensive tests covering all factors and edge cases

Files:
- extensions/meridia/src/meridia/scoring/types.ts
- extensions/meridia/src/meridia/scoring/config.ts
- extensions/meridia/src/meridia/scoring/factors.ts
- extensions/meridia/src/meridia/scoring/index.ts
- extensions/meridia/src/meridia/scoring/scoring.test.ts
- extensions/meridia/src/meridia/evaluate.ts (updated)

* SDK runner: close message processing parity gaps with Pi embedded agent

- Gap 1 (HIGH): Add streaming block replies during the event loop via
  blockReplyBreak/blockReplyChunking params. Supports "message_end"
  (flush at message boundaries) and "text_end" (per-chunk) modes,
  matching Pi embedded's streaming delivery. Final onBlockReply is
  skipped when streaming was active to avoid duplicate delivery.

- Gap 2 (MEDIUM): Add onReasoningStream callback support. Extract
  thinking/reasoning text from SDK events classified as "system" and
  emit via the new callback, enabling reasoning display in UIs.

- Gap 3 (MEDIUM): Reset chunks/assistantSoFar at message boundaries
  so onPartialReply reflects only the current message, not accumulated
  text from all prior turns.

- Gap 5 (LOW-MED): Add enforceFinalTag support. When enabled, only
  content inside <final>...</final> tags is returned, preventing
  intermediate narration leakage from non-Claude models. Adds shared
  extractFinalTagContent() utility.

- Gap 6 (LOW-MED): Map all payload fields (mediaUrl, mediaUrls,
  replyToId, replyToTag, replyToCurrent, audioAsVoice) in
  adaptSdkResultToPiResult to prevent silent field loss.

Wire all new params through the full chain:
  executor.ts → AgentRuntimeRunParams → sdk-agent-runtime →
  sdk-runner-adapter → sdk-runner

https://claude.ai/code/session_013FRzxnpzCwncubghL7GGCF

* additional merge conflict resolution

---------

Co-authored-by: Claude <[email protected]>
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.

1 participant