A session's age is not surfaced, so you cannot tell how old an agent's context is

Open Beginner friendly
#1,993 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@rudycelekli is already working on this.

Since Nov 18, 2026.

  • #2137 by @rudycelekli — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

The session data is in the agent_sessions table, where created_at is already populated. Start with the AgentSessionDetail model and the get_agent_detail handler that builds it, then add the start time next to last_seen_at. The Switch Console session view needs the same field shown beside last activity. Done when get_agent_detail returns the start time and the console displays it for a session.

Written by the indexing model from the issue text.

Description

enhancement
The problem

There is no way to tell how old a session's context is.

A session's state and last_seen_at are reported, but not when it started. Since a session persists until something explicitly resets it, two agents in the same room can be running on very different vintages of context — one started minutes ago, one carrying weeks — and nothing distinguishes them. The question "which version of the context does this agent have?" currently has no answer short of asking the agent, which is not a control.

The data already exists: agent_sessions.created_at is populated. It just is not surfaced. AgentSessionDetail reports room_id, room_name, lifecycle, state, last_seen_at and controller_id, and stops there.

This also blocks anything built on top of it. Age-based hygiene, staleness warnings or a freshness policy are all untrustworthy while the underlying number is invisible, because nobody can check what the policy is acting on.

What you would like to see

Surface the session start time:

  • add it to AgentSessionDetail, so get_agent_detail reports it alongside last_seen_at;
  • show it in Switch Console's session view, next to last activity.

It controls nothing on its own. It makes the thing observable, which is the prerequisite for managing it at all.

Alternatives you have considered
  • Asking the agent how old its context is. Depends on the agent answering accurately about its own state, so it is not a control.
  • Resetting on a schedule so the age never matters. Throws away context that is often still wanted, and a clock-triggered reset will eventually fire mid-task. Worth considering separately, but it needs this to be visible first.
Dominant language
Python
Stars
4.5k
Forks
348
Avg merge
1d 17h
Merged PRs (30d)
287

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sandbox-quantum/switch

All issues in sandbox-quantum/switch

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.