Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

chatcops test: calls-tool and no-tool-call assertions

Cerrado
#412 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@bhushan4work ya está trabajando en esto.

Desde el 28/10/2026.

  • #446 de @bhushan4work — fusionado

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement good first issue hacktoberfest testing

Lets an eval check that the bot called the right tool with the right input, or that it called none.

How assertions work
chatcops test (#394, with replays from #395 and the judge from #400) checks each turn's reply with the assertions in the eval file. They're registered by name in ASSERTIONS (packages/cli/src/test/assertions/index.ts:11). Each one is an AssertionCheck (packages/cli/src/test/types.ts): it gets the value from the YAML, the turn's TurnResult (text, toolCalls, sources, leads, usage, costUsd, latencyMs), the conversation so far, and a context with the eval file's path, and returns { pass, reason }. Throw for a bad value (see asStrings in assertions/values.ts), and the runner turns it into a failure with your message. The not- prefix works for every name without extra code.

contains in assertions/text.ts is the reference: one file per kind of assertion, added to the map. Write reasons a person can act on, such as the reply doesn't contain "$19".

What to add (new assertions/tools.ts)

  • calls-tool: a tool name (calls-tool: lookup_order), or { name, args }. args is a partial deep match against the call's input: every key in args has to be there with an equal value, and extra keys in the input are fine. Nested objects match the same way, and arrays have to be equal.
  • no-tool-call: true means the turn called no tool at all. A tool name means it didn't call that one.

The calls are in turn.toolCalls as { name, input }. The reason for a failure should list the calls that did happen, so people see what went wrong.

Acceptance criteria

  • Unit tests: name only, partial args, nested args, a mismatch that lists the actual calls, no-tool-call both ways, bad values
  • An end to end test with a tool mock (see "answers tools from mocks" in test-command.test.ts)
  • Documented in website/src/content/docs/core/testing.mdx, with a changeset for @chatcops/cli (minor)
  • pnpm test:coverage and pnpm lint pass
Lenguaje dominante
TypeScript
Estrellas
13
Forks
7
Merge medio
3 h 28 min
PR fusionados (30 d)
296

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codercops/chatcops

Todos los issues de codercops/chatcops

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.