Skip to content

feat: detect Kiro auth expiration + add kronn auth kiro command#42

Open
Elenui wants to merge 4 commits into
mainfrom
kronn/lorsque-kronn-est-lancé-depuis-par-exemple-1-jours-et-qu-on

Hidden character warning

The head ref may contain hidden characters: "kronn/lorsque-kronn-est-lanc\u00e9-depuis-par-exemple-1-jours-et-qu-on"
Open

feat: detect Kiro auth expiration + add kronn auth kiro command#42
Elenui wants to merge 4 commits into
mainfrom
kronn/lorsque-kronn-est-lancé-depuis-par-exemple-1-jours-et-qu-on

Conversation

@Elenui
Copy link
Copy Markdown
Collaborator

@Elenui 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

@Elenui Elenui force-pushed the kronn/lorsque-kronn-est-lancé-depuis-par-exemple-1-jours-et-qu-on branch 2 times, most recently from 9b0b5dd to 7a8726a Compare March 25, 2026 15:20
@Elenui Elenui added the ci-test Start all the CI Test steps label Mar 25, 2026
@Elenui Elenui force-pushed the kronn/lorsque-kronn-est-lancé-depuis-par-exemple-1-jours-et-qu-on branch 2 times, most recently from ad31fbc to 4c582f3 Compare March 25, 2026 18:41
Comment thread backend/src/api/discussions.rs Outdated
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;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

É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
  );

Comment thread backend/src/api/discussions.rs Outdated
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;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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 😄

Comment thread scripts/simulate-kiro-expired.py Outdated
print(f"✅ Backup → {BACKUP}")

conn = sqlite3.connect(str(DB))
cur = conn.execute("DELETE FROM auth_kv WHERE key = 'kirocli:odic:token'")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Typo non ? kirocli:odic:tokenkirocli:oidc:token(OIDC = OpenID Connect).

Comment thread frontend/package-lock.json Outdated
"node": ">=18"
}
},
"node_modules/@diffusionstudio/vits-web": {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

🤔 Le projet utilise pnpm, et non pas npm ^^ on ne devrait pas avoir autant de changements sur le lock ;)

@Elenui Elenui force-pushed the kronn/lorsque-kronn-est-lancé-depuis-par-exemple-1-jours-et-qu-on branch from f4083cf to fba9874 Compare March 30, 2026 05:13
Elenui added 2 commits April 2, 2026 08:35
- 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>
@Elenui Elenui force-pushed the kronn/lorsque-kronn-est-lancé-depuis-par-exemple-1-jours-et-qu-on branch from fba9874 to 3f810f2 Compare April 2, 2026 06:36
Signed-off-by: Alexis TARUSSIO <alexis.tarussio@gmail.com>
@Elenui Elenui force-pushed the kronn/lorsque-kronn-est-lancé-depuis-par-exemple-1-jours-et-qu-on branch from 3f810f2 to 0271d99 Compare April 2, 2026 06:36
@Elenui Elenui added ci-test Start all the CI Test steps and removed ci-test Start all the CI Test steps labels Apr 2, 2026
@Elenui Elenui added ci-test Start all the CI Test steps and removed ci-test Start all the CI Test steps labels Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-test Start all the CI Test steps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants