peppa/openspec/changes/pep-39-rotation/specs/agent-credentials/spec.md
Асель c7283063c9 PEP-39: rotate a limited session to a free subscription of the pool at the turn boundary
Limit marks the subscription «лимит до …»; the watchdog relaunches the session on another
usable subscription of the same provider (Claude/OpenCode resume the conversation, Codex
starts afresh), threshold banner switches after the turn, max 3 switches/hour, simple
fairness between projects, subscription_switched events + Telegram message, web shows
subscription and switch history. Migration 0004 (sessions.rotate_reason).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 05:31:22 +05:00

21 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Spec Delta: agent-credentials
## MODIFIED Requirements
### Requirement: Подписка сессии
Раннер SHALL при старте брать свободную активную подписку из выбранного набора
(отмеченные подписки или пул из формы запуска, иначе пул проекта) и запоминать её у сессии;
провайдер сессии — провайдер подписки, процесс агента получает вход этой подписки. Resume
SHALL идти на той же подписке, а при лимите сессия может переключиться на другую подписку
пула (ротация). Без пула и выбора сессия запускается на входе машины.
#### Scenario: Свободная подписка
- **GIVEN** в пуле проекта подписки «A» и «B», на «A» уже работает сессия
- **WHEN** запускается новый раннер проекта
- **THEN** он стартует на подписке «B»
#### Scenario: Нет активных подписок
- **GIVEN** у всех подписок пула проекта статус «ошибка входа»
- **WHEN** запускается новый раннер
- **THEN** запуск отклонён с сообщением «Нет активных подписок»