Commit 2394fa1
* fix: MCP server loads embedding config from .java-codebase-rag.yml (#238)
The MCP server now reads embedding.model and embedding.device from
.java-codebase-rag.yml at startup and applies them to os.environ,
matching the behavior of CLI commands (init, reprocess, etc.).
Previously, the MCP server ignored YAML config and always fell back to
the HuggingFace hub default, causing search tool failures when offline or
behind corporate proxies.
Changes:
- server.py: Call resolve_operator_config() in main() and apply to os.environ
- tests: Add tests for MCP server YAML config loading and precedence
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: use model_dump() for pydantic StructuredHint in test error message
_assert_structured_hint receives StructuredHint(BaseModel) from
describe_v2 output, not _StructuredHint(NamedTuple). _asdict() is
a NamedTuple method and raises AttributeError on BaseModel instances.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix: strengthen test_mcp_hints fixture and remove unused import
- _class_with_implements_out: iterate through all classes with
IMPLEMENTS.out instead of skipping on the first suppressed match,
ensuring the test actually validates hint emission
- _assert_structured_hint: drop hasattr fallback — StructuredHint is
always a Pydantic BaseModel, use model_dump() directly
- Remove unused `call` import in test_mcp_server_yaml_config_precedence
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6b883d9 commit 2394fa1
3 files changed
Lines changed: 83 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
573 | 580 | | |
574 | 581 | | |
575 | 582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
404 | 414 | | |
405 | 415 | | |
406 | 416 | | |
| |||
506 | 516 | | |
507 | 517 | | |
508 | 518 | | |
509 | | - | |
| 519 | + | |
510 | 520 | | |
511 | 521 | | |
512 | 522 | | |
| |||
0 commit comments