feat: detect Kiro auth expiration + add kronn auth kiro command#42
Hidden character warning
feat: detect Kiro auth expiration + add kronn auth kiro command#42Elenui wants to merge 4 commits into
Conversation
Elenui
commented
Mar 25, 2026
- Better error message when Kiro session expires (no output case)
- Add AWS Builder ID / SSO patterns in detect_agent_error_hint
- New CLI command: kronn auth kiro (re-auth without restart)
- Frontend: show specific hint for Kiro auth errors
9b0b5dd to
7a8726a
Compare
ad31fbc to
4c582f3
Compare
| if let Some(hint) = error_hint { | ||
| full_response.push_str(&format!("\n\n{}", hint)); | ||
| // Replace raw agent output with clean error message | ||
| full_response = hint; |
There was a problem hiding this comment.
Écrasement de la sortie agent : full_response = hint remplace entièrement la sortie brute de l'agent par le hint. ^^
Problèmes potentiels :
- Debug impossible : l'utilisateur perd le stderr/stdout original, aucun moyen de comprendre un faux positif
- Faux positifs : les patterns sont larges ("login required", "opening browser", "session expired") et detect_agent_error_hint s'applique à tous les agents, pas seulement Kiro. Si Claude Code ou Codex renvoie un message contenant "session expired" dans un contexte légitime, il est écrasé.
- Pas de trace — le contenu original n'est ni loggé ni stocké
On pourrait garder le hint visible en premier, mais conserver la sortie originale repliable 🤔 ? :
full_response = format!(
"{}\n\n<details><summary>Sortie agent</summary>\n\n{}\n</details>"
hint, full_response
);| let all_output = format!("{}\n{}", full_response, stderr_text); | ||
| if let Some(hint) = detect_agent_error_hint(&all_output) { | ||
| full_response.push_str(&format!("\n\n{}", hint)); | ||
| full_response = hint; |
There was a problem hiding this comment.
full_response = hint écrase la sortie originale. À traiter de la même façon que plus haut ^^ ⏫
| || lower.contains("sso session") | ||
| || lower.contains("refresh token") | ||
| || lower.contains("device flow") | ||
| || lower.contains("login required") |
There was a problem hiding this comment.
Les patterns de détection Kiro sont très larges et risquent des faux positifs sur d'autres agents :
- "opening browser" — un agent qui parle de devtools
- "login required" — un agent qui documente une API
- "device flow" — un agent qui explique un flow OAuth
On pourrait surement conditionner sur le type d'agent , ou passer agent_type à detect_agent_error_hint 😄
| print(f"✅ Backup → {BACKUP}") | ||
|
|
||
| conn = sqlite3.connect(str(DB)) | ||
| cur = conn.execute("DELETE FROM auth_kv WHERE key = 'kirocli:odic:token'") |
There was a problem hiding this comment.
Typo non ? kirocli:odic:token → kirocli:oidc:token(OIDC = OpenID Connect).
| "node": ">=18" | ||
| } | ||
| }, | ||
| "node_modules/@diffusionstudio/vits-web": { |
There was a problem hiding this comment.
🤔 Le projet utilise pnpm, et non pas npm ^^ on ne devrait pas avoir autant de changements sur le lock ;)
f4083cf to
fba9874
Compare
- Better error message when Kiro session expires (no output case) - Add AWS Builder ID / SSO patterns in detect_agent_error_hint - New CLI command: kronn auth kiro (re-auth without restart) - Frontend: show specific hint for Kiro auth errors Signed-off-by: Alexis TARUSSIO <alexis.tarussio@gmail.com>
Signed-off-by: Alexis TARUSSIO <alexis.tarussio@gmail.com>
fba9874 to
3f810f2
Compare
Signed-off-by: Alexis TARUSSIO <alexis.tarussio@gmail.com>
3f810f2 to
0271d99
Compare