Adapter function metrics record success for contract-level IOContract mismatches
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- observability
Hướng nghiên cứu
Start with mellea/stdlib/components/intrinsic/_util.py at call_intrinsic, then compare the invocation-completion handling in adapter.py and the Embedded/Granite formatter closures added in PR #1609. Trace both the embedded and local_file paths, including how synchronous code dispatches async hooks. Done means contract-level output mismatches are recorded as failures, valid outputs as successes, and each invocation fires exactly once.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
mellea.adapter_function.invocations/.parse_failures mis-record one class of failure for adapter functions called through call_intrinsic: a contract-level IOContract mismatch on output that is valid JSON.
Background
PR #1609 (issue #1560) wired adapter_function_invocation_complete firing for the Embedded/Granite Switch binding. It fires the outcome once each backend's granite_formatters_processing closure resolves — success if the response parses as JSON, schema_error if it doesn't, error otherwise.
That closure runs before call_intrinsic (mellea/stdlib/components/intrinsic/_util.py:171) calls adapter.io_contract.parse(result_str) — the actual contract check (required fields, types, shape). So when a response is syntactically valid JSON but fails that contract check, AdapterSchemaMismatchError is raised to the caller — but the invocation was already recorded as outcome="success".
Impact
- The caller is unaffected:
AdapterSchemaMismatchErrorpropagates uncaught through every wrapper (rag.py,core.py,guardian.py) straight to application code. No silent failures. - The metric is wrong:
.parse_failuresundercounts this specific failure mode, and.invocations{outcome="success"}overcounts it. A model that drifted into returning valid-but-wrong-shape JSON would look 100% healthy on a dashboard built from these metrics while every call actually fails downstream. - Scope is narrow: only applies to output that's valid JSON but violates the adapter's declared schema — not malformed JSON (already
schema_error) and not a generation/network failure (alreadyerror). - Applies to
local_file/PEFT too, not justembedded—AdapterMixin.adapter_scope's outcome closes at generation return, before parsing or contract validation ever run, so this binding never records anything for this failure mode either.
Proposed fix
Move (or add) the invocation-complete fire point into call_intrinsic, after io_contract.parse() resolves, so the recorded outcome reflects contract validation too. Complications:
call_intrinsicis shared by both bindings — this needs handling that's correct forlocal_fileas well asembedded, not an embedded-only patch.call_intrinsicis synchronous; hook dispatch (invoke_hook) is async. Needs the same sync→async bridgingadapter.py's_fire_invocation_completealready does via_run_async_in_thread— the embedded fire helper introduced in #1609 (_fire_embedded_invocation_complete) deliberately avoids that bridging since it's always called from an already-running coroutine, so this can't just reuse it as-is.- Need to decide whether the backend-level
successfire (in the closures) should be suppressed/deferred entirely in favour of this one, to keep the "fires exactly once per invocation" invariant intact.
cc @ajbozarth
- Ngôn ngữ chính
- Python
- Star
- 1.8k
- Fork
- 161
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 45
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của generative-computing/mellea
-
bug: `mellea.plugins.builtin_debug.generation.log_generation_post_call` shows model as unknownĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
generative-computing/mellea#1864 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug: instruct() and react() replay tool-call turns without tool_callsCó thể đã có người làm @simonyang08 đã nhận 21 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
generative-computing/mellea#1784 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Silently mangled docstrings: lone backslash line-continuations in non-raw docstrings collapse command examplesCó thể đã có người làm @madhusudhan1260 đã nhận 18 ngày trước. Đang mởgood first issue p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
generative-computing/mellea#1780 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
area/telemetry enhancement p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
generative-computing/mellea#1210 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Add requirement priorityĐang mởarea/requirement area/stdlib enhancement p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
generative-computing/mellea#31 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của generative-computing/mellea
Issue tương tự
-
bug game: 0100FF500E34A000 game: 0400FF500E34A001 mac packing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
jxxghp/MoviePilot#7576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
jbaruch/software-factory#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày