Skip to content

feat(agents): name sessions in LangWatch, and stagger boot launches off the credential race - #150

Merged
rogeriochaves merged 2 commits into
mainfrom
feat/langwatch-session-titles-and-boot-stagger
Aug 19, 2026
Merged

feat(agents): name sessions in LangWatch, and stagger boot launches off the credential race#150
rogeriochaves merged 2 commits into
mainfrom
feat/langwatch-session-titles-and-boot-stagger

Conversation

@rogeriochaves

@rogeriochaves rogeriochaves commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What

Two agents-fleet fixes, both from this morning's boot incident on the agents box.

Session names. No custom env var: claude is named through its own --name flag. Fresh launches already passed --name <slug>; resumes now pass it too, so sessions created before naming existed pick their slug up on the next boot. The LangWatch capture (langwatch#7197) mirrors the name the harness itself holds, including a mid-session /rename, so the sessions screen reads "pr-reviewer" / "kanban-keeper" instead of thirteen rows of "Good morning. Use the ... skill".

Boot stagger. Twelve claude agents resuming in the same second after a boot all saw an expired OAuth access token, all raced the refresh, and refresh-token rotation let exactly one win. The other eleven came up "Login expired · Please run /login" and sat dead until relaunched by hand. Reconcile now gives the first real launch a 20 s window to refresh and write the new token pair; every later launch reads a fresh token and never refreshes, with a 3 s gap between them. The gap trails a real launch, so a reconcile over a fleet whose sessions are all alive spends no time waiting.

Verification

  • npm run build clean, npm test 324 pass.
  • The credential race and the dead fleet are documented from the live box: boot 06:46:13, all agents resumed 06:46:40, credentials file rewritten by the one winner at 06:51:38, 12 of 13 sessions wedged at "Login expired".

…ff the credential race

Every launched agent's tmux env now carries LANGWATCH_SESSION_TITLE with
its slug. The LangWatch capture seams post it as the explicit session
title, so the sessions screen reads "pr-reviewer" instead of the first
line of the scripted daily greeting, for claude and codex both.

Reconcile also staggers real launches. Twelve claude agents resuming in
the same second after a boot all saw an expired OAuth token, all raced
the refresh, and rotation let one win: the other eleven came up "Login
expired" and sat dead until relaunched by hand. The first launch now
gets a 20 s window to refresh and write the new token pair; the rest
read a fresh token and never refresh. Agents whose tmux session is
already alive cost no wait, so a routine reconcile stays instant.

Claude-Session: https://claude.ai/code/session_01BUKKUiZbSBHmrLK9JJj4Ba
… env var

The LangWatch capture now mirrors the name the harness itself holds, so
the LANGWATCH_SESSION_TITLE env var is retired before anything shipped
reads it. Fresh launches already passed --name <slug>; resumes now pass
it too, so sessions created before naming existed pick their slug up on
the next boot.

Claude-Session: https://claude.ai/code/session_01BUKKUiZbSBHmrLK9JJj4Ba
@rogeriochaves
rogeriochaves merged commit 143a23e into main Aug 19, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant