Skip to content

fix(config): support XDG config path fallbacks#443

Open
WHUTcjh-2024 wants to merge 1 commit into
TencentCloud:mainfrom
WHUTcjh-2024:codex/issue-103-config-paths
Open

fix(config): support XDG config path fallbacks#443
WHUTcjh-2024 wants to merge 1 commit into
TencentCloud:mainfrom
WHUTcjh-2024:codex/issue-103-config-paths

Conversation

@WHUTcjh-2024

@WHUTcjh-2024 WHUTcjh-2024 commented Jul 9, 2026

Copy link
Copy Markdown

Description

  • Add shared config-path helpers for safe optional file checks and HOME / USERPROFILE / OS home fallback.
  • Load Gateway config from $XDG_CONFIG_HOME/tencentdb-agent-memory and ~/.config/tencentdb-agent-memory before the data-dir fallback.
  • Reuse the same home/file-exists fallback in OpenClaw hook-policy config lookup and OpenClaw state-dir fallback.

Related Issue

Fix #103

Change Type

  • Bug fix | Bug
  • New feature
  • Documentation update
  • Code optimization

Self-test Checklist

  • Verified locally
  • No existing features affected

Additional Notes

Verified locally:

  • ./node_modules/.bin/vitest.cmd run src/utils/config-paths.test.ts
  • ./node_modules/.bin/tsdown.cmd
  • ./node_modules/.bin/tsc.cmd -p scripts/migrate-sqlite-to-tcvdb/tsconfig.json --noEmitOnError false
  • ./node_modules/.bin/tsc.cmd --project scripts/export-tencent-vdb/tsconfig.json
  • ./node_modules/.bin/tsc.cmd --project scripts/read-local-memory/tsconfig.json
  • git diff --cached --check

Notes from this Windows host:

  • pnpm is blocked locally by the existing bash postinstall command (bash ... || true), so verification used the local package binaries directly.
  • Full vitest run currently fails only in existing src/utils/time.test.ts timezone/Intl assertions on this host; the focused config-path tests pass.

@WHUTcjh-2024 WHUTcjh-2024 force-pushed the codex/issue-103-config-paths branch 2 times, most recently from 5a38046 to 3770ddb Compare July 9, 2026 08:00
@WHUTcjh-2024 WHUTcjh-2024 force-pushed the codex/issue-103-config-paths branch from 3770ddb to 602bd0a Compare July 9, 2026 08:01

@YOMXXX YOMXXX left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as the canonical fix for #103.

I verified locally:

  • COREPACK_ENABLE_AUTO_PIN=0 pnpm vitest run src/utils/config-paths.test.ts (3/3 passed)
  • COREPACK_ENABLE_AUTO_PIN=0 pnpm test (70/70 passed)
  • COREPACK_ENABLE_AUTO_PIN=0 pnpm build
  • git diff --check

This is stronger than the earlier #221/#223 attempts because it centralizes HOME/USERPROFILE/XDG fallback behavior in shared helpers, covers Gateway config lookup plus OpenClaw policy/state-dir lookup, and includes focused regression tests.

@WHUTcjh-2024

Copy link
Copy Markdown
Author

OK,thanks

@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thanks for your attention! We will review your code and get back to you as soon as possible per our internal schedule.

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.

[good first issue]🎯 Plugin reads platform-specific paths that do not exist on Linux

3 participants