[Feature]: Make code-mode recurrence opt-in and managed snippets workflow-aware
Summary
Make scheduled code-mode updates an explicit, persistent opt-in, and render the managed AGENTS.md / CLAUDE.md snippets from the repository’s actual recurrence policy and workflow state.
A repository that has no OpenWiki CI workflow should not be told:
The scheduled OpenWiki GitHub Actions workflow refreshes the repository wiki.
Motivation
Some users intentionally run OpenWiki on demand through the MCP host integration. In particular, many choose MCP because they want interactive runs to consume their existing Codex/ChatGPT subscription or OAuth quota, and do not want a CI schedule that requires separate provider secrets, API billing, or unattended quota consumption.
Scheduling is therefore a product choice, not an implied consequence of code mode.
I reproduced a related deterministic mismatch with OpenWiki 0.4.2:
- Use a GitHub-hosted repository with no
.github/workflows/directory (only Dependabot configuration). - Run a host-driven MCP
openwiki_begin(mode=update)page-job lifecycle. - Keep the repository documentation explicit that maintenance is on demand.
- Call
openwiki_finish. - Observe the managed
AGENTS.mdblock being rewritten to claim that a scheduled GitHub Actions workflow refreshes the wiki. - Verify that no OpenWiki workflow exists.
Correcting the managed sentence before finalization is ineffective because finalization writes the hard-coded snippet again. Correcting it after every run works, but is brittle.
The current source reflects the split: ensureCodeModeRepoSetup creates a workflow only when options.createWorkflow is true, but always calls writeCodeModeAgentSnippets, whose template unconditionally claims a scheduled GitHub Actions workflow.
Proposed Solution
Add a persistent, explicit code-mode recurrence/workflow policy, independent from agent-file ownership. For example:
codeMode:
workflow:
policy: disabled # disabled | preserve | createSuggested behavior:
- Default MCP, non-interactive, and update runs to no new schedule unless the repository explicitly opted in.
- During interactive init, ask before creating a scheduled workflow and persist the answer.
disabled: do not create a workflow and describe OpenWiki as on-demand in managed snippets.preserve: do not create or rewrite workflow files; describe recurrence neutrally or from detected state.create: create the provider-aware workflow and describe the configured schedule truthfully.- If no OpenWiki workflow exists, never claim that one exists.
- Keep this independent from the proposed
codeMode.agentFiles.policyin #556: users may want the useful managed snippet while declining scheduled automation. - Cover init, update, chat, and MCP finalization with tests for no workflow, preserved custom workflow, and explicitly created schedule.
A simpler compatible first step would be to make the snippet workflow-aware and add a persistent --no-workflow / config option honored by every code-mode entry point.
Alternatives Considered
- #556 /
agentFiles.policy=preserve: avoids the overwrite, but also gives up useful managed guidance and does not express recurrence policy. - Patch
AGENTS.mdafter every run: works locally, but is fragile and produces recurring misleading diffs. - Ignore/delete the workflow file: does not stop the snippet from making a false claim and does not prevent future setup paths from recreating it.
- Provider-neutral scheduled wording: helps #341, but remains false when the repository intentionally has no schedule.
Duplicate Check
I searched open and closed issues for scheduled-update opt-out, workflow disable, managed AGENTS.md wording, MCP, subscription/OAuth quota, and OPENWIKI_ENABLE_SCHEDULED_UPDATE.
Related but not duplicate:
- #341: GitHub-specific workflow and wording on non-GitHub repositories.
- #556 / #557: opt out of managing root agent files entirely.
- #240 / #621: provider-aware CI workflow scaffolding.
- #302 / #369: scheduled workflow guards for forks.
- #389: generated documentation substitutes upstream CI defaults for actual host configuration.
None covers a GitHub repository that intentionally uses on-demand MCP/subscription-backed updates, wants no schedule, and still wants truthful managed agent snippets.
Additional Context
- OpenWiki version: 0.4.2
- Host integration: Codex MCP page-job lifecycle
- OS: macOS
- Node.js: 24.19.0
- No OpenWiki GitHub Actions workflow was present or created by the reproduced update; the defect is the unconditional managed-snippet assertion and the absence of a persistent recurrence opt-out.
Source: langchain-ai/openwiki