fix: default bare --update to code mode instead of personal#314
Open
Himanshu Kumar (himanshu231204) wants to merge 4 commits into
Open
fix: default bare --update to code mode instead of personal#314Himanshu Kumar (himanshu231204) wants to merge 4 commits into
Himanshu Kumar (himanshu231204) wants to merge 4 commits into
Conversation
added 3 commits
July 14, 2026 00:25
The parseEnv function only handled KEY=value format. If a user manually edited the .openwiki/env file or copied lines from shell scripts, lines like 'export KEY=value' would be silently skipped. Added export prefix handling: lines starting with 'export ' now have the prefix stripped before parsing, so both formats work correctly.
Bare \openwiki --update\ (without specifying personal or code mode) defaulted to personal mode, which targeted ~/.openwiki/wiki instead of the current project's openwiki/ directory. This caused the agent to document a completely different, unrelated project that was previously stored in the global wiki. Make bare --update require an explicit mode (--init already had this requirement). Users must now run either: - \openwiki personal --update\ to update the local brain wiki - \openwiki code --update\ to update repository documentation All CI workflows already use explicit modes (\openwiki code --update --print\), so this is not a breaking change for automation. Fixes langchain-ai#310
Himanshu Kumar (himanshu231204)
force-pushed
the
fix/bare-update-requires-mode
branch
from
July 13, 2026 19:01
6c02544 to
c552722
Compare
Contributor
Author
|
Colin Francis (@colifran) This PR is ready for review. It resolves the merge conflicts with upstream main and defaults bare openwiki --update to code mode instead of personal mode, fixing #310. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #310
Bare
openwiki --update(without specifyingpersonalorcodemode) defaulted topersonalmode, which targeted~/.openwiki/wikiinstead of the current project'sopenwiki/directory. This caused the agent to document a completely different, unrelated project that was previously stored in the global wiki.Root Cause
In
src/commands.ts,parseRunCommanddefaultsmodeto"personal"when no mode is specified. For--update, this means the agent runs in personal mode (targeting~/.openwiki/wiki) even when the user is inside a project directory.Fix
Added auto-default logic: when a non-chat command (
--initor--update) is run without an explicit mode, default tocodemode instead ofpersonal. This ensuresopenwiki --updatefrom a project directory updates the repository'sopenwiki/directory as expected.Before:
openwiki --update→ personal mode → documents wrong projectAfter:
openwiki --update→ code mode → documents current repositoryThis is consistent with the existing behavior where
openwiki(bare, no args) opens interactive chat, andopenwiki --init(bare) now also defaults to code mode.Changes
src/commands.ts: Addedif (command !== "chat" && modeSource === "default") { mode = "code"; }to auto-default non-chat commands to code mode. Updated help examples.src/agent/prompt.ts: Updated CLI reference to document the new default behavior.src/auth/configure.ts: Updated user-facing messages.src/connectors/write-connector-skill.ts: Updated connector instructions.test/commands.test.ts: Updated tests — bare--updatenow defaults to code mode, added explicit mode tests.Impact
openwiki code --update --print) — no breaking changes for automationopenwiki --updatefrom a project directory now get the expected behavioropenwiki personal --update