Skip to content

Extend agent session token lifetimes - #198

Merged
HamptonMakes merged 2 commits into
mainfrom
hampton/agent-token-expiration-7f419c
Aug 24, 2026
Merged

Extend agent session token lifetimes#198
HamptonMakes merged 2 commits into
mainfrom
hampton/agent-token-expiration-7f419c

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

Summary

  • Bump DEFAULT_SESSION_TTL from 12 hours to 7 days, and MAX_SESSION_TTL from 7 to 30 days in ApiToken, so agent sessions don't expire mid-task.
  • Update spec assertions that hardcoded the old durations to reference the constants instead, and bumped the clamp test's input TTL (30d → 60d) so it still exercises clamping against the new 30-day max.

Test plan

  • bundle exec rspec spec/models/api_token_spec.rb spec/requests/api/v1/tokens_spec.rb — 37 examples, 0 failures

Bump DEFAULT_SESSION_TTL from 12 hours to 7 days and MAX_SESSION_TTL
from 7 to 30 days, so agent sessions don't expire mid-task. Update
spec assertions to reference the constants instead of hardcoding the
old durations.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d5457412e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread engine/app/models/coplan/api_token.rb
The mint example hardcoded ttl_seconds: 43200 (the old 12h default),
so agents following the docs literally never got the new 7-day
default. Drop the explicit TTL so the default applies, and update
the description's stated default/max to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@HamptonMakes
HamptonMakes merged commit 0c0cbe3 into main Aug 24, 2026
4 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