[Bug] Compiler drops unary-plus numeric defaults
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start by locating extractNumberValue() and tracing how it handles numeric literal signs during compilation; the issue says unary minus works while unary plus is omitted. Reproduce with the YAML snippet through @agentscript/parser, Dialect().parse(), and compile(), then check the three defaults in output.agent_version.state_variables. Done means unary-plus values are preserved in object properties, list elements, and configuration parameter extraction; linked PR #117 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
The compiler silently omits numeric defaults with an explicit unary +. In nested objects it drops the property; in lists it drops the element and changes the remaining positions.
Steps to Reproduce
- Check out
salesforce/agentscriptmain atc3f8249a99ec908a6b61d1125945691447267e90and build the workspace dependencies. - Parse the snippet below with
@agentscript/parser, then pass the mapping tonew Dialect().parse(mapping, AgentforceSchema)and compile the resulting value withcompile(). - Inspect
output.agent_version.state_variables.
Expected Behavior
The defaults are 1, {"positive": 1, "negative": -2}, and [1, -2, 0] respectively. A unary plus on a numeric literal should preserve its value.
Actual Behavior
count has no default, payload.default is {"negative": -2}, and values.default is [-2]. Parser/schema diagnostics, the default Agentforce lint rules, and compiler diagnostics are all empty for this example.
Environment
- Node.js: 22.20.0
- pnpm: 10.34.6
- OS: macOS, arm64
- Compiler: workspace version 3.38.4 at the commit above
Minimal Reproduction
config:
developer_name: "SignedDefaults"
variables:
count: mutable number = +1
payload: mutable object = {"positive": +1, "negative": -2}
values: mutable list[number] = [+1, -2, +0]
start_agent main:
description: "Entry point"
reasoning:
instructions: ->
| Values: {[email protected]}, {[email protected]}, {[email protected]}
Additional Context
extractNumberValue() handles unary minus but not unary plus. The parser and type inference recognize both numeric signs. This also affects numeric extraction in configuration parameters; it is separate from the empty-object and None defects in #101 and #103.
- Ngôn ngữ chính
- TypeScript
- Star
- 279
- Fork
- 55
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
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.
- 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 salesforce/agentscript
-
[Bug] Compiler drops nested None values from object and list defaultsCó thể đã có người làm @amazingjoe đã nhận 16 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
salesforce/agentscript#103 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Compiler drops nested empty objects from variable defaultsCó thể đã có người làm @amazingjoe đã nhận 16 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
salesforce/agentscript#101 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[query] how to use pre/post_tool_call on agentforce?Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
salesforce/agentscript#42 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của salesforce/agentscript
Issue tương tự
-
bug Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
scottbenton/Iron-Link#541 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH userĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
prime-radiant-inc/evener#8161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Ignore Rules is not workingĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/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 78/100
nicobailon/pi-subagents#3420 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yĐang mở01 type: bug 99 tag: UX Accessibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày