[Bug] Compiler drops unary-plus numeric defaults
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- node.js, typescript
- Área
- compilers
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 279
- Forks
- 55
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 7
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de salesforce/agentscript
-
[Bug] Compiler drops nested None values from object and list defaultsPosiblemente ocupada @amazingjoe la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
salesforce/agentscript#103 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Compiler drops nested empty objects from variable defaultsPosiblemente ocupada @amazingjoe la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
salesforce/agentscript#101 ·
Los mantenedores suelen responder en 1 día
-
[query] how to use pre/post_tool_call on agentforce?Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
salesforce/agentscript#42 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de salesforce/agentscript
Issues similares
-
bug Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
scottbenton/Iron-Link#541 ·
Los mantenedores suelen responder en 1 día
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH userAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
prime-radiant-inc/evener#8161 ·
Los mantenedores suelen responder en 1 día
-
Ignore Rules is not workingAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nicobailon/pi-subagents#3420 ·
Los mantenedores suelen responder en 1 día
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yAbierto01 type: bug 99 tag: UX Accessibility
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días