[Bug] Compiler drops unary-plus numeric defaults
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- node.js, typescript
- Bereich
- compilers
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 279
- Forks
- 55
- Ø Merge
- 1 T. 12 Std.
- Gemergte PRs (30 T.)
- 7
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus salesforce/agentscript
-
[Bug] Compiler drops nested None values from object and list defaultsEvtl. vergeben @amazingjoe hat das vor 16 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
salesforce/agentscript#103 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] Compiler drops nested empty objects from variable defaultsEvtl. vergeben @amazingjoe hat das vor 16 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
salesforce/agentscript#101 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[query] how to use pre/post_tool_call on agentforce?Evtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
salesforce/agentscript#42 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in salesforce/agentscript
Ähnliche Issues
-
bug Needs Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100
scottbenton/Iron-Link#541 ·
Maintainer antworten meist innerhalb von 1 Tag
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH userOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
prime-radiant-inc/evener#8161 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
nicobailon/pi-subagents#3420 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yOffen01 type: bug 99 tag: UX Accessibility
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 2 Tagen