Description
An explicit language change is ignored when the repository has no source changes since the last OpenWiki update. The no-op predicate considers only whether a user message is present; it does not consider options.language.
As a result, a command such as openwiki code --update --language fr --print can report that no repository changes were detected and return before the translation plan is created.
Affected code
src/agent/utils.ts:179-181: shouldCheckUpdateNoop(options) returns only !options.userMessage?.trim().
src/agent/index.ts:162-181: the clean-tree early return happens before provider/model setup and before runOpenWikiAgentCore().
src/agent/index.ts:310-319: the translation plan that honors a requested language is therefore never reached.
src/startup.ts:100-130: the pre-credential clean-update shortcut calls the same predicate and can also treat a language-changing command as skippable.
Steps to Reproduce
- Initialize an OpenWiki repository in English and commit the generated wiki and
.last-update.json.
- Ensure the repository is clean and HEAD matches the saved metadata.
- Run:
openwiki code --update --language fr --print
- Observe:
No repository changes detected since the last OpenWiki update; skipping agent run.
- Inspect the wiki; existing pages remain in English and persisted language does not change to French.
Expected Behavior
An explicit request to change the wiki language should run the translation pass even when source code and documentation inputs are otherwise unchanged.
Actual Behavior
The clean-tree optimization returns before language comparison or translation occurs.
Why this matters
Changing language is a state transition, not a source-code update. The current optimization makes the documented --language option unreliable precisely on stable repositories, and scheduled/print runs can exit successfully while doing none of the requested work.
Suggested direction
Make the no-op decision aware of language intent:
- Read the persisted wiki language.
- Normalize the explicitly requested locale.
- Skip only when no user message exists and the requested language is absent or equivalent to the persisted language.
At minimum, any explicit options.language should bypass the no-op shortcut. Apply the same rule in both runOpenWikiAgent and the startup pre-credential optimization.
Missing regression coverage
test/update-noop.test.ts tests user-message behavior but does not pass a language option. An integration-level test should assert that a clean update with a differing language is not skipped, while the same-language case may still skip.
Environment
- OS: macOS
- Node.js: v24.14.1
- Affected revision:
63c848c on main
- OpenWiki version: current source checkout
Description
An explicit language change is ignored when the repository has no source changes since the last OpenWiki update. The no-op predicate considers only whether a user message is present; it does not consider
options.language.As a result, a command such as
openwiki code --update --language fr --printcan report that no repository changes were detected and return before the translation plan is created.Affected code
src/agent/utils.ts:179-181:shouldCheckUpdateNoop(options)returns only!options.userMessage?.trim().src/agent/index.ts:162-181: the clean-tree early return happens before provider/model setup and beforerunOpenWikiAgentCore().src/agent/index.ts:310-319: the translation plan that honors a requested language is therefore never reached.src/startup.ts:100-130: the pre-credential clean-update shortcut calls the same predicate and can also treat a language-changing command as skippable.Steps to Reproduce
.last-update.json.openwiki code --update --language fr --printNo repository changes detected since the last OpenWiki update; skipping agent run.Expected Behavior
An explicit request to change the wiki language should run the translation pass even when source code and documentation inputs are otherwise unchanged.
Actual Behavior
The clean-tree optimization returns before language comparison or translation occurs.
Why this matters
Changing language is a state transition, not a source-code update. The current optimization makes the documented
--languageoption unreliable precisely on stable repositories, and scheduled/print runs can exit successfully while doing none of the requested work.Suggested direction
Make the no-op decision aware of language intent:
At minimum, any explicit
options.languageshould bypass the no-op shortcut. Apply the same rule in bothrunOpenWikiAgentand the startup pre-credential optimization.Missing regression coverage
test/update-noop.test.tstests user-message behavior but does not pass a language option. An integration-level test should assert that a clean update with a differing language is not skipped, while the same-language case may still skip.Environment
63c848conmain