Repository navigation
Commit abf0076
committed
fix(mcp): resolve a directory project arg to its owning project (DeusData#1690)
An agent in a checkout whose directory name differs from the repository
name (git clone .../repo_name.git some_name) could not find the indexed
project. The installed skill only said "list_projects - check if project
is indexed", so Codex and Copilot guessed the project from the repo name,
got "project not found" and stopped using the graph. Passing the working
directory did not help whenever it was not exactly the indexed root: a
path was only ever turned into the path-DERIVED name, which misses a
checkout indexed under an explicit name (the stored identity, see DeusData#1660)
and every directory below an indexed root.
Fix:
- mcp: a path-shaped project keeps the derived name when an index exists
under it (unchanged fast path); otherwise it resolves to the indexed
project whose stored root_path owns the directory. The deepest owning
root wins; two projects owning that root stay unresolved, so the
not-found error lists every project instead of guessing. Reuses the
list_projects identity reader and the canonical-path containment helpers.
- mcp: the project-not-found hint says how to pick the project (the name
whose root_path contains the working directory, or that absolute
directory; never a repo or folder name), so an agent that guessed can
recover.
- cli: the SKILL.md every skill client installs (Codex, Copilot and the
rest), the shared agent instructions and the Aider CLI instructions say
the same thing.
Proof (dev binary, synthetic HOME; repo_name cloned as some_name and
indexed by path; a second checkout other_dir indexed with name=my-alias):
before: project=<other_dir> -> project not found
project=<some_name>/pkg -> project not found
after: project=<other_dir> -> my-alias (index_status agrees)
project=<some_name>/pkg -> the some_name project
unchanged: the checkout root path and the explicit name resolve; the
unindexed sibling some_name_x stays not found; a guessed "repo_name"
stays not found and now carries the how-to-pick hint.
Tests:
- mcp tool_project_path_resolves_owning_project_issue1690: an explicitly
named root and its subdirectory resolve; normal naming and similar
names (some_name2, some_name_x) are not confused; two owners of one
root are never guessed; a guessed repo name gets the hint. RED 3x
before, green after, RED again when the production change is reverted
(the hint check also goes RED on its own revert).
- cli cli_guidance_resolves_project_by_root_path_issue1690: pins the
instruction in the skill, agent-instructions and Aider variants.
Fixes DeusData#1690
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>1 parent 0f52d30 commit abf0076
4 files changed
Lines changed: 293 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1504 | 1504 | | |
1505 | 1505 | | |
1506 | 1506 | | |
1507 | | - | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1508 | 1512 | | |
1509 | 1513 | | |
1510 | 1514 | | |
| |||
3274 | 3278 | | |
3275 | 3279 | | |
3276 | 3280 | | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
3277 | 3284 | | |
3278 | 3285 | | |
3279 | 3286 | | |
| |||
3679 | 3686 | | |
3680 | 3687 | | |
3681 | 3688 | | |
| 3689 | + | |
| 3690 | + | |
3682 | 3691 | | |
3683 | 3692 | | |
3684 | 3693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1572 | 1572 | | |
1573 | 1573 | | |
1574 | 1574 | | |
| 1575 | + | |
| 1576 | + | |
1575 | 1577 | | |
1576 | 1578 | | |
1577 | 1579 | | |
| |||
1585 | 1587 | | |
1586 | 1588 | | |
1587 | 1589 | | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1588 | 1593 | | |
1589 | 1594 | | |
1590 | 1595 | | |
| |||
2640 | 2645 | | |
2641 | 2646 | | |
2642 | 2647 | | |
| 2648 | + | |
| 2649 | + | |
2643 | 2650 | | |
2644 | | - | |
2645 | | - | |
2646 | | - | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
2647 | 2655 | | |
2648 | 2656 | | |
2649 | 2657 | | |
| |||
11844 | 11852 | | |
11845 | 11853 | | |
11846 | 11854 | | |
| 11855 | + | |
| 11856 | + | |
| 11857 | + | |
| 11858 | + | |
| 11859 | + | |
| 11860 | + | |
| 11861 | + | |
| 11862 | + | |
| 11863 | + | |
| 11864 | + | |
| 11865 | + | |
| 11866 | + | |
| 11867 | + | |
| 11868 | + | |
| 11869 | + | |
| 11870 | + | |
| 11871 | + | |
| 11872 | + | |
| 11873 | + | |
| 11874 | + | |
| 11875 | + | |
| 11876 | + | |
| 11877 | + | |
| 11878 | + | |
| 11879 | + | |
| 11880 | + | |
| 11881 | + | |
| 11882 | + | |
| 11883 | + | |
| 11884 | + | |
| 11885 | + | |
| 11886 | + | |
| 11887 | + | |
| 11888 | + | |
| 11889 | + | |
| 11890 | + | |
| 11891 | + | |
| 11892 | + | |
| 11893 | + | |
| 11894 | + | |
| 11895 | + | |
| 11896 | + | |
| 11897 | + | |
| 11898 | + | |
| 11899 | + | |
| 11900 | + | |
| 11901 | + | |
| 11902 | + | |
| 11903 | + | |
| 11904 | + | |
| 11905 | + | |
| 11906 | + | |
| 11907 | + | |
| 11908 | + | |
| 11909 | + | |
| 11910 | + | |
| 11911 | + | |
| 11912 | + | |
| 11913 | + | |
| 11914 | + | |
11847 | 11915 | | |
11848 | 11916 | | |
11849 | 11917 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14154 | 14154 | | |
14155 | 14155 | | |
14156 | 14156 | | |
| 14157 | + | |
| 14158 | + | |
| 14159 | + | |
| 14160 | + | |
| 14161 | + | |
| 14162 | + | |
| 14163 | + | |
| 14164 | + | |
| 14165 | + | |
| 14166 | + | |
| 14167 | + | |
| 14168 | + | |
| 14169 | + | |
| 14170 | + | |
| 14171 | + | |
| 14172 | + | |
| 14173 | + | |
| 14174 | + | |
| 14175 | + | |
| 14176 | + | |
| 14177 | + | |
| 14178 | + | |
| 14179 | + | |
| 14180 | + | |
| 14181 | + | |
| 14182 | + | |
| 14183 | + | |
14157 | 14184 | | |
14158 | 14185 | | |
14159 | 14186 | | |
| |||
16964 | 16991 | | |
16965 | 16992 | | |
16966 | 16993 | | |
| 16994 | + | |
16967 | 16995 | | |
16968 | 16996 | | |
16969 | 16997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8417 | 8417 | | |
8418 | 8418 | | |
8419 | 8419 | | |
| 8420 | + | |
| 8421 | + | |
| 8422 | + | |
| 8423 | + | |
| 8424 | + | |
| 8425 | + | |
| 8426 | + | |
| 8427 | + | |
| 8428 | + | |
| 8429 | + | |
| 8430 | + | |
| 8431 | + | |
| 8432 | + | |
| 8433 | + | |
| 8434 | + | |
| 8435 | + | |
| 8436 | + | |
| 8437 | + | |
| 8438 | + | |
| 8439 | + | |
| 8440 | + | |
| 8441 | + | |
| 8442 | + | |
| 8443 | + | |
| 8444 | + | |
| 8445 | + | |
| 8446 | + | |
| 8447 | + | |
| 8448 | + | |
| 8449 | + | |
| 8450 | + | |
| 8451 | + | |
| 8452 | + | |
| 8453 | + | |
| 8454 | + | |
| 8455 | + | |
| 8456 | + | |
| 8457 | + | |
| 8458 | + | |
| 8459 | + | |
| 8460 | + | |
| 8461 | + | |
| 8462 | + | |
| 8463 | + | |
| 8464 | + | |
| 8465 | + | |
| 8466 | + | |
| 8467 | + | |
| 8468 | + | |
| 8469 | + | |
| 8470 | + | |
| 8471 | + | |
| 8472 | + | |
| 8473 | + | |
| 8474 | + | |
| 8475 | + | |
| 8476 | + | |
| 8477 | + | |
| 8478 | + | |
| 8479 | + | |
| 8480 | + | |
| 8481 | + | |
| 8482 | + | |
| 8483 | + | |
| 8484 | + | |
| 8485 | + | |
| 8486 | + | |
| 8487 | + | |
| 8488 | + | |
| 8489 | + | |
| 8490 | + | |
| 8491 | + | |
| 8492 | + | |
| 8493 | + | |
| 8494 | + | |
| 8495 | + | |
| 8496 | + | |
| 8497 | + | |
| 8498 | + | |
| 8499 | + | |
| 8500 | + | |
| 8501 | + | |
| 8502 | + | |
| 8503 | + | |
| 8504 | + | |
| 8505 | + | |
| 8506 | + | |
| 8507 | + | |
| 8508 | + | |
| 8509 | + | |
| 8510 | + | |
| 8511 | + | |
| 8512 | + | |
| 8513 | + | |
| 8514 | + | |
| 8515 | + | |
| 8516 | + | |
| 8517 | + | |
| 8518 | + | |
| 8519 | + | |
| 8520 | + | |
| 8521 | + | |
| 8522 | + | |
| 8523 | + | |
| 8524 | + | |
| 8525 | + | |
| 8526 | + | |
| 8527 | + | |
| 8528 | + | |
| 8529 | + | |
| 8530 | + | |
| 8531 | + | |
| 8532 | + | |
| 8533 | + | |
| 8534 | + | |
| 8535 | + | |
| 8536 | + | |
| 8537 | + | |
| 8538 | + | |
| 8539 | + | |
| 8540 | + | |
| 8541 | + | |
| 8542 | + | |
| 8543 | + | |
| 8544 | + | |
| 8545 | + | |
| 8546 | + | |
| 8547 | + | |
| 8548 | + | |
| 8549 | + | |
| 8550 | + | |
| 8551 | + | |
| 8552 | + | |
| 8553 | + | |
| 8554 | + | |
| 8555 | + | |
| 8556 | + | |
| 8557 | + | |
| 8558 | + | |
| 8559 | + | |
| 8560 | + | |
| 8561 | + | |
| 8562 | + | |
| 8563 | + | |
| 8564 | + | |
| 8565 | + | |
| 8566 | + | |
| 8567 | + | |
| 8568 | + | |
| 8569 | + | |
| 8570 | + | |
| 8571 | + | |
| 8572 | + | |
| 8573 | + | |
| 8574 | + | |
| 8575 | + | |
| 8576 | + | |
| 8577 | + | |
| 8578 | + | |
| 8579 | + | |
| 8580 | + | |
| 8581 | + | |
| 8582 | + | |
| 8583 | + | |
| 8584 | + | |
| 8585 | + | |
| 8586 | + | |
| 8587 | + | |
| 8588 | + | |
| 8589 | + | |
| 8590 | + | |
| 8591 | + | |
| 8592 | + | |
| 8593 | + | |
| 8594 | + | |
| 8595 | + | |
| 8596 | + | |
| 8597 | + | |
| 8598 | + | |
| 8599 | + | |
| 8600 | + | |
| 8601 | + | |
| 8602 | + | |
8420 | 8603 | | |
8421 | 8604 | | |
8422 | 8605 | | |
| |||
21020 | 21203 | | |
21021 | 21204 | | |
21022 | 21205 | | |
| 21206 | + | |
21023 | 21207 | | |
21024 | 21208 | | |
21025 | 21209 | | |
| |||
0 commit comments