Skip to content

feat: add quiet output mode for destral#182

Merged
ecarreras merged 3 commits into
masterfrom
feature/181-ai-quiet-output
May 7, 2026
Merged

feat: add quiet output mode for destral#182
ecarreras merged 3 commits into
masterfrom
feature/181-ai-quiet-output

Conversation

@pilipilisbot
Copy link
Copy Markdown
Contributor

@pilipilisbot pilipilisbot commented May 7, 2026

Resumen

Añade un modo opt-in --quiet al CLI de destral para reducir el ruido de salida cuando lo ejecutan agentes AI o automatizaciones.

Por defecto el comportamiento no cambia.

Cambios

  • Nuevo helper QuietOutputCapture que captura stdout/stderr en un fichero temporal.
  • Nuevo flag CLI --quiet.
  • Si la ejecución pasa en quiet mode, no imprime output y elimina el log temporal.
  • Si falla, imprime un resumen corto con:
    • exit code;
    • ruta del output completo capturado;
    • últimas líneas capturadas para diagnóstico rápido.
  • Se mantiene el exit code original.
  • Tests unitarios del helper de captura.
  • Lectura acotada de las últimas líneas capturadas para evitar cargar logs grandes completos en memoria.

Validación

  • python -m unittest discover tests en Python 2.7 con entorno ERP local.
  • python3 -m unittest tests.test_output.
  • Smoke test del CLI con --quiet visible en --help.

Closes #181

Refs #181

Co-authored-by: Eduard Carreras <ecarreras@gisce.net>
@pilipilisbot pilipilisbot added enhancement feature minor Minor auto version V_.X._ labels May 7, 2026
@pilipilisbot pilipilisbot self-assigned this May 7, 2026
@pilipilisbot pilipilisbot requested a review from ecarreras May 7, 2026 01:20
Refs #181

Co-authored-by: Eduard Carreras <ecarreras@gisce.net>
@pilipilisbot
Copy link
Copy Markdown
Contributor Author

Ajuste tras revisión: eliminado el alias --silent; queda únicamente --quiet, que es la opción estándar/común. Validado contra el entrypoint real destral --help usando el checkout de la PR en PYTHONPATH, además de los tests.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an opt-in quiet mode to the destral CLI intended for AI agents/automation, capturing stdout/stderr into a temporary file and only surfacing a short failure summary while keeping default output unchanged when the flag is not used.

Changes:

  • Introduces QuietOutputCapture helper to redirect stdout/stderr to a temp log and provide a “tail” summary.
  • Adds a new --quiet CLI flag and wraps the CLI execution to capture output and emit a failure summary / delete logs on success.
  • Adds unit tests covering basic capture behavior, tail behavior, and cleanup.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
destral/cli.py Adds --quiet flag and wraps execution to capture output, emit summaries, and preserve exit codes.
destral/output.py New helper implementing stdout/stderr redirection, tail extraction, and cleanup behavior.
tests/test_output.py New unit tests for the capture helper (disabled mode, capture writes, tail, cleanup).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread destral/cli.py
Comment thread destral/output.py Outdated
Comment thread tests/test_output.py
Co-authored-by: Eduard Carreras <ecarreras@gisce.net>
@ecarreras ecarreras merged commit d461493 into master May 7, 2026
2 checks passed
@ecarreras ecarreras deleted the feature/181-ai-quiet-output branch May 7, 2026 19:14
@pilipilisbot
Copy link
Copy Markdown
Contributor Author

Revisat el nou review.

Estat final:

  • PR merged.
  • Review d’ecarreras: APPROVED.
  • 0 review threads oberts.
  • tests-py27 OK.
  • tests-py311 OK.

No hi ha acció pendent sobre la PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement feature minor Minor auto version V_.X._

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Afegir mode quiet/silent per reduir output de destral en agents AI

3 participants