Repository navigation
Commit 8ae1000
committed
feat(cli): warn about legacy codebase-memory-mcp instruction blocks
Upstream codebase-memory-mcp wrote its own managed instruction blocks into
agent instruction files. The fork's CP78 side-by-side policy keeps that MCP
state foreign, so install and uninstall never rewrite or remove it — but the
block still tells the model to call MCP tools this CLI-only fork does not
provide.
Add read-only detection helpers next to cbm_remove_instructions:
- cbm_file_has_legacy_mcp_block() reports whether a file contains a complete
`<!-- codebase-memory-mcp:start -->` ... `<!-- codebase-memory-mcp:end -->`
pair; it only reads.
- cbm_warn_legacy_mcp_block() prints the exact warning to stderr.
Wire the warning into install_generic_agent_config (Codex and other generic
agents) and uninstall_agent_mcp_instr, both on real runs and --dry-run. The
instruction file is never modified. The install plan JSON gains a minimal
`warnings` array alongside instruction_files_planned.
Documents the behavior in docs/CONFIGURATION.md and covers it with one
integration test, cli_install_warns_about_legacy_mcp_instruction_block, which
seeds CODEX_HOME/AGENTS.md with user content plus a legacy block, asserts the
warning in dry-run and install, and asserts the legacy bytes survive while the
CLI-managed block is added exactly once.1 parent 8c52d7a commit 8ae1000
3 files changed
Lines changed: 138 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3229 | 3229 | | |
3230 | 3230 | | |
3231 | 3231 | | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
3232 | 3266 | | |
3233 | 3267 | | |
3234 | 3268 | | |
| |||
7816 | 7850 | | |
7817 | 7851 | | |
7818 | 7852 | | |
| 7853 | + | |
| 7854 | + | |
| 7855 | + | |
7819 | 7856 | | |
7820 | 7857 | | |
7821 | 7858 | | |
7822 | 7859 | | |
7823 | 7860 | | |
7824 | 7861 | | |
7825 | 7862 | | |
| 7863 | + | |
7826 | 7864 | | |
7827 | 7865 | | |
7828 | 7866 | | |
| |||
9518 | 9556 | | |
9519 | 9557 | | |
9520 | 9558 | | |
| 9559 | + | |
9521 | 9560 | | |
9522 | 9561 | | |
9523 | 9562 | | |
| |||
9536 | 9575 | | |
9537 | 9576 | | |
9538 | 9577 | | |
| 9578 | + | |
| 9579 | + | |
9539 | 9580 | | |
9540 | 9581 | | |
9541 | 9582 | | |
| |||
9546 | 9587 | | |
9547 | 9588 | | |
9548 | 9589 | | |
| 9590 | + | |
9549 | 9591 | | |
9550 | 9592 | | |
9551 | 9593 | | |
| |||
10258 | 10300 | | |
10259 | 10301 | | |
10260 | 10302 | | |
| 10303 | + | |
10261 | 10304 | | |
10262 | 10305 | | |
10263 | 10306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7349 | 7349 | | |
7350 | 7350 | | |
7351 | 7351 | | |
| 7352 | + | |
| 7353 | + | |
| 7354 | + | |
| 7355 | + | |
| 7356 | + | |
| 7357 | + | |
| 7358 | + | |
| 7359 | + | |
| 7360 | + | |
| 7361 | + | |
| 7362 | + | |
| 7363 | + | |
| 7364 | + | |
| 7365 | + | |
| 7366 | + | |
| 7367 | + | |
| 7368 | + | |
| 7369 | + | |
| 7370 | + | |
| 7371 | + | |
| 7372 | + | |
| 7373 | + | |
| 7374 | + | |
| 7375 | + | |
| 7376 | + | |
| 7377 | + | |
| 7378 | + | |
| 7379 | + | |
| 7380 | + | |
| 7381 | + | |
| 7382 | + | |
| 7383 | + | |
| 7384 | + | |
| 7385 | + | |
| 7386 | + | |
| 7387 | + | |
| 7388 | + | |
| 7389 | + | |
| 7390 | + | |
| 7391 | + | |
| 7392 | + | |
| 7393 | + | |
| 7394 | + | |
| 7395 | + | |
| 7396 | + | |
| 7397 | + | |
| 7398 | + | |
| 7399 | + | |
| 7400 | + | |
| 7401 | + | |
| 7402 | + | |
| 7403 | + | |
| 7404 | + | |
| 7405 | + | |
| 7406 | + | |
| 7407 | + | |
| 7408 | + | |
| 7409 | + | |
| 7410 | + | |
| 7411 | + | |
| 7412 | + | |
| 7413 | + | |
| 7414 | + | |
| 7415 | + | |
| 7416 | + | |
| 7417 | + | |
| 7418 | + | |
| 7419 | + | |
| 7420 | + | |
| 7421 | + | |
| 7422 | + | |
| 7423 | + | |
| 7424 | + | |
| 7425 | + | |
| 7426 | + | |
| 7427 | + | |
| 7428 | + | |
| 7429 | + | |
| 7430 | + | |
| 7431 | + | |
| 7432 | + | |
| 7433 | + | |
| 7434 | + | |
| 7435 | + | |
| 7436 | + | |
| 7437 | + | |
| 7438 | + | |
| 7439 | + | |
| 7440 | + | |
| 7441 | + | |
| 7442 | + | |
| 7443 | + | |
| 7444 | + | |
7352 | 7445 | | |
7353 | 7446 | | |
7354 | 7447 | | |
| |||
13533 | 13626 | | |
13534 | 13627 | | |
13535 | 13628 | | |
| 13629 | + | |
13536 | 13630 | | |
13537 | 13631 | | |
13538 | 13632 | | |
| |||
0 commit comments