Optional `description` param on `shell_command`, used as the tool call's label

Aberta Para iniciantes
#717 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
clojure
Domínio
ai, tooling

Direção de pesquisa

Comece no namespace shell tools, onde shell_command está definido: encontre o schema map que contém a propriedade command e o vetor required, e a função de resumo eca.modules.tools.shell/shell-command-summary que constrói o header exibido para uma chamada. Adicione uma propriedade string description opcional e deixe required como ["command"], depois faça o resumo usá-la como header com o comando mantido nos detalhes, recorrendo ao header atual quando ausente. Concluído significa que uma chamada que carrega description renderiza esse label e uma sem ela renderiza exatamente como antes; verifique os testes existentes de shell tool para as asserções do resumo.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Problem

Some models send a short label with each shell call, even when the schema has no field for it. They probably learned this in training, from harnesses whose shell tool has such a field. Since #632, ECA rejects these calls with INVALID_ARGS, so each one costs a failed call and a retry turn.

#633 found that 1,861 of 2,288 rejected unknown args were a description arg (GLM, Kimi, DeepSeek). With Tencent's Hy4-flash I see the same with summary:

{"command": "grep -aiE 'album|track|...' ~/.cache/app/logs/app.log | tail -n 100",
 "summary": "Grep log for album and error lines"}
→ INVALID_ARGS: unknown params: `summary`. Supported params: `command` (required), ...

The labels are good, though. For long or piped commands, "Grep log for album and error lines" reads better than today's header $ grep -aiE 'album|tra....

Proposal

  • Add an optional description param to shell_command ("A short description of what this command does (5-10 words), shown to the user as the label of this call.").
  • When present, eca.modules.tools.shell/shell-command-summary uses it as the header; the command stays in the details. When missing, nothing changes.
  • required stays ["command"].

Other harnesses mostly call this field description and keep it optional: Claude Code, Gemini CLI and Qwen Code (optional), Crush (required), VS Code Copilot (explanation, required). OpenCode had a required description and removed it (anomalyco/opencode#32823); an optional field avoids that cost.

Quick test

Hy4-flash, ECA 0.173.2's shell_command schema and prompt, 20 tasks × 5 samples = 100 calls per schema, temperature 0.7. The second run only added the description property to the schema:

"properties": {
  "command":     { ... },
  ...
  "description": { "type": "string",
                   "description": "Optional. A short description of what this command does (5-10 words), shown to the user as the label of this call." }
},
"required": ["command"]
Schema description sent summary sent
today 3 / 100 (rejected) 0 / 100
+ optional description 99 / 100 0 / 100

Given the field, the model filled it in 99 of 100 calls ("Check Docker status and list containers", "Run Maven test suite", "Show sorted sizes of /var/log subdirectories") and never invented another name. The one call without it was npm run dev with background: "dev-server". This is a short system prompt with one tool, not a full ECA session.

Cons

More tokens, measured with Hy4's tokenizer on the calls above:

  • The schema property adds ~41 tokens to every request. It never changes, so prompt caching covers it.
  • Each label adds ~12 tokens to the call (median; 10–19 including the JSON key). The model generates them once, and they stay in the history after that. 50 shell calls add ~600 tokens.
  • A rejected call costs more per occurrence: the 29-token INVALID_ARGS result, the repeated call (~26 tokens of args) and one extra round trip. But with Hy4 only 3 of 100 calls were rejected, so for this model the tokens do not pay for themselves. The main gain is the readable label.
Linguagem predominante
Clojure
Estrelas
1k
Forks
82
Merge médio
1d 20h
PRs com merge (30d)
22

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de editor-code-assistant/eca

Todas as issues de editor-code-assistant/eca

Issues semelhantes

Mais issues de Clojure

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.