[bug] credentials list --output json returns null instead of stable empty schema

Aperta
#22 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
go

Direzione di ricerca

Start by running goclaw credentials list --output json and trace the credentials list command and its API response handling; the issue names no source files or tests. Add coverage for an empty API result, then verify that successful empty output has a stable schema and invalid auth or configuration exits non-zero with a clear error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Mô tả

Khi dùng goclaw credentials list --output json, CLI trả về null thay vì một JSON object/array rõ ràng.

Trong lúc debug timeout cho credentialed CLI (codex), agent cần list CLI credentials để tìm codex credential ID và update timeout_seconds bằng command:

goclaw credentials list --output json

Kết quả thực tế:

null

Điều này làm automation khó xử lý vì không rõ nghĩa là:

  • Không có credentials?
  • Không có quyền?
  • Sai profile/server/token?
  • API trả body rỗng?
  • CLI parse lỗi?

Expected behavior

--output json nên trả về schema ổn định, ví dụ:

{
  "items": []
}

hoặc nếu không có credential thì ít nhất:

[]

Nếu auth/profile/server sai hoặc không đủ quyền, CLI nên trả error rõ ràng với non-zero exit code, không trả null như success output.

Actual behavior

Command trả:

null

Không đủ thông tin để agent/human biết trạng thái thật.

Impact

  • AI automation không thể phân biệt empty result với lỗi config/auth.
  • Không thể tiếp tục flow update timeout cho credentialed CLI như codex nếu không lấy được credential ID.
  • Làm trải nghiệm debug bằng CLI bị mơ hồ.

Repro

goclaw credentials list --output json

Observed output:

null

Suggested fix

  1. Chuẩn hóa JSON output cho list command:
    • success empty: { "items": [] } hoặc []
    • success non-empty: cùng schema
  2. Nếu API response nil/empty bất thường, CLI nên emit error rõ ràng.
  3. Nếu profile/server/token chưa đúng, trả non-zero exit + message actionable.
  4. Bổ sung test cho credentials list --output json khi API trả empty list.

Context

Use case đang cần:

goclaw credentials list --output json
# find codex credential id

goclaw credentials update <credID> --body '{"timeout_seconds":300}'

Ngoài ra, goclaw credentials update và goclaw credentials agent-grants update đã có command phù hợp để set timeout, nhưng list output null làm bước discovery bị kẹt.

Lingua principale
Go
Stelle
5
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.