[BUG] record.set reports a rejected value as internal: engine/transport failure

Đang mở
#454 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/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ệ
rust
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Read aimdb-core/src/typed_record.rs around line 1524 to understand the rejected value error, then trace how map_db_err in aimdb-core/src/session/aimx/dispatch.rs maps it and how RpcError is decoded in aimdb-client/src/engine.rs and aimx/codec.rs. The issue calls for a distinct wire error code that preserves the deserialization message while keeping engine and transport failures internal. Done means rejected values produce the specific error and unknown codes still fall back as described; the issue does not name tests to run.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Describe the bug
When a remote record.set value fails to deserialize into the record's type, the client gets the same error as a broken engine or transport:

AimDB client error: Server error (code internal): engine/transport failure

The write is refused correctly and the session stays up. The problem is the report: a caller, especially an MCP agent, cannot tell that its own value was at fault, so it has no reason to correct it.

The server does build a specific message (typed_record.rs:1524), but it is lost on the way out:

  • map_db_err sends everything except not-found and permission errors to RpcError::Internal.
  • RpcError carries no message, so the client fills in its generic text (engine.rs:593).

To Reproduce

  1. Run an instance with a writable record whose type rejects some JSON, for example a custom deserializer that bounds a list's length.
  2. Call record.set (or MCP set_record) with a value that type rejects.
  3. See the error above.

Observed with a list over its bound (33 and 2000 elements against a limit of 32). A coordinate of 1e40 for an f32 field got the same reply; I did not trace that case separately.

Expected behavior
A distinct error code for a value the record's type rejected, separate from internal, ideally carrying the deserialization message. Real engine and transport failures keep internal.

Environment

  • OS: macOS 13 (Darwin 22.6)
  • Rust Version: rustc 1.98.0
  • AimDB Version: main at d9c7be0

Additional context
A new code changes the AimX wire vocabulary, so existing clients need to handle it. code_err in aimx/codec.rs currently maps unknown codes to Internal, so older clients would fall back to today's behaviour.

Ngôn ngữ chính
Rust
Star
101
Fork
20
Merge trung bình
2 giờ 33 phút
Pull request đã merge (30 ngày)
90

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aimdb-dev/aimdb

Tất cả issue của aimdb-dev/aimdb

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.