[Bug] Compiler drops unary-plus numeric defaults
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 停滯
- 技術堆疊
- node.js, typescript
- 領域
- compilers
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 279
- 分支
- 55
- 平均合併
- 1 天 12 小時
- 30 天內合併 PR
- 7
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
salesforce/agentscript 的其他 Issue
-
[Bug] Compiler drops nested None values from object and list defaults可能已有人在做 @amazingjoe 於 16 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 80/100
salesforce/agentscript#103 ·
維護者通常 1 天內回覆
-
[Bug] Compiler drops nested empty objects from variable defaults可能已有人在做 @amazingjoe 於 16 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
salesforce/agentscript#101 ·
維護者通常 1 天內回覆
-
[query] how to use pre/post_tool_call on agentforce?可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 3/5 1-2 天 新手友好度 52/100
salesforce/agentscript#42 · 1 則留言 ·
維護者通常 1 天內回覆
查看 salesforce/agentscript 的全部 Issue
相似的 Issue
-
bug Needs Triage
難度 2/5 1-3 小時 新手友好度 79/100
scottbenton/Iron-Link#541 ·
維護者通常 1 天內回覆
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH user未關閉
難度 2/5 1-3 小時 新手友好度 72/100
prime-radiant-inc/evener#8161 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 65/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
nicobailon/pi-subagents#3420 ·
維護者通常 1 天內回覆
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11y未關閉01 type: bug 99 tag: UX Accessibility
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 2 天內回覆