feat: support configurable OpenWiki state directory - #274
feat: support configurable OpenWiki state directory#274Krish (akyourowngames) wants to merge 5 commits into
Conversation
|
Ready for review. This change adds Validated with typecheck, lint, build, and the full Vitest suite (181 tests). |
|
This is a solid design, especially the display-path split ( One gap I noticed while working on something similar: |
|
Great work on this, it's a clean approach to the state-directory relocation problem. I noticed a couple of things while reviewing that might be worth addressing before merge:
Happy to help test this once you sort these out. Really appreciate you tackling this, it's a genuine quality-of-life improvement for users. |
|
Great work on this, it's a clean approach to the state-directory relocation problem. I noticed a couple of things while reviewing that might be worth addressing before merge:
Happy to help test this once you sort these out. Really appreciate you tackling this, it's a genuine QoL improvement for users. |
|
Working on this right now!! |
path.resolve does not expand a bare `~` or `~/`-prefixed value, so OPENWIKI_CONFIG_DIR=~/openwiki-state resolved relative to the process cwd instead of the home directory. Mirror the tilde handling used by normalizeLocalPath. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reconciles the configurable state-directory branch with upstream/main (upstream refactored agent prompts into src/agent/prompts/* and added windows-acl / conversation-history handling). Resolves conflicts in README.md, src/agent/index.ts, src/agent/prompt.ts, and src/env.ts, and re-applies the display-path substitution to the new prompt files so agent prompts still honor OPENWIKI_CONFIG_DIR. Also addresses open PR review feedback: - Expand a leading ~ in OPENWIKI_CONFIG_DIR (path.resolve does not). - Reflect the configured location in user-facing .env path strings (credentials save message, CLI auth-fix steps, Gmail note, connector source warnings, and the credential-source diagnostic label). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
Addressed the review feedback and reconciled with upstream/main. The branch is mergeable again. Review point 1 — tilde expansion in
|
|
Colin Francis (@colifran) Ready for review!! |
|
Related open PRs / overlap check I scanned the open-PR list for anything touching the same surface as this one (
Posting so reviewers can see the state-dir work here is distinct from the docs-dir work in #189. cc Wezza (@Omar-Elwazeery) Harsh (@HarshVz) Sudip Kandel (@sudipawtg) |
Summary
Adds
OPENWIKI_CONFIG_DIRas an override for OpenWiki's local state directory. Credentials, the personal wiki, connectors, and skills now use the same resolved directory; the default remains~/.openwiki.Agent prompts, ingestion instructions, connector-tool descriptions, and the CLI output panel use the configured location when it is overridden, so agents do not attempt to read the default home directory.
Fixes #223.
Why
Containerized and read-only-home environments currently fail before documentation work begins because OpenWiki always writes to the user's home directory. The override lets users supply a writable mounted location without changing default behavior.
Testing
tsc --noEmit -p tsconfig.jsonvitest run --pool=threads— 181 tests passedtsc -p tsconfig.jsonThe repository-wide Prettier check reports pre-existing line-ending issues across the untouched upstream checkout;
git diff --checkpasses.