[Bug] Compiler drops unary-plus numeric defaults
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- node.js, typescript
- Domínio
- compilers
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 279
- Forks
- 55
- Merge médio
- 1d 12h
- PRs com merge (30d)
- 7
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de salesforce/agentscript
-
[Bug] Compiler drops nested None values from object and list defaultsTalvez já em andamento @amazingjoe assumiu há 16 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
salesforce/agentscript#103 ·
Mantenedores costumam responder em até 1 dia
-
[Bug] Compiler drops nested empty objects from variable defaultsTalvez já em andamento @amazingjoe assumiu há 16 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
salesforce/agentscript#101 ·
Mantenedores costumam responder em até 1 dia
-
[query] how to use pre/post_tool_call on agentforce?Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
salesforce/agentscript#42 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de salesforce/agentscript
Issues semelhantes
-
bug Needs Triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
scottbenton/Iron-Link#541 ·
Mantenedores costumam responder em até 1 dia
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH userAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
prime-radiant-inc/evener#8161 ·
Mantenedores costumam responder em até 1 dia
-
Ignore Rules is not workingAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
nicobailon/pi-subagents#3420 ·
Mantenedores costumam responder em até 1 dia
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yAberta01 type: bug 99 tag: UX Accessibility
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 2 dias