A session's age is not surfaced, so you cannot tell how old an agent's context is
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
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
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, soget_agent_detailreports it alongsidelast_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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sandbox-quantum/switch
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOpen
Difficulty 1/5 Under an hour Newbie friendliness 86/100
sandbox-quantum/switch#2163 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2162 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2159 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#2157 ·
Maintainers usually reply within 1 day
-
Get-Switch-Console link points at a path that only resolves via a redirectPossibly taken @Darshan3690 claimed this 3 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
sandbox-quantum/switch#1998 · 2 comments ·
Maintainers usually reply within 1 day
All issues in sandbox-quantum/switch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mohanraj00/entelos#200 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
sweep
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
bketelsen/truenas-mcp#77 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openedx/xblock-lti-consumer#765 ·
Maintainers usually reply within 1 day
-
bug pydanty:is-working
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pydantic/pydantic-ai#13939 ·
Maintainers usually reply within 1 day