Skip to content

docs: add inactivity timeout (idler) section to sessions page#1368

Merged
jeremyeder merged 1 commit intoambient-code:mainfrom
redhat-ship-help:ship-help/add-inactivity-timeout-docs
Apr 20, 2026
Merged

docs: add inactivity timeout (idler) section to sessions page#1368
jeremyeder merged 1 commit intoambient-code:mainfrom
redhat-ship-help:ship-help/add-inactivity-timeout-docs

Conversation

@redhat-ship-help
Copy link
Copy Markdown
Collaborator

@redhat-ship-help redhat-ship-help commented Apr 20, 2026

Summary

Expands the sessions documentation page to fully document the inactivity timeout (idler) feature.

Changes

  • New Inactivity timeout row in the Creating a session settings table, with a link to the detailed section
  • New Inactivity timeout (idler) subsection under Session lifecycle covering:
    • How the idler works (lastActivityTime tracking, graceful stop with state preservation, inactivity stop reason)
    • Configuration hierarchy: session-level → project-level → platform default (24 hours)
    • Disabling the idler by setting timeout to 0
    • Verifying the idler via operator logs (kubectl logs ... | grep '[Inactivity]')
  • Updated Stopped phase description to mention the idler as a possible cause

Context

This was requested in #forum-ambient-code-platform to ensure users understand how idle sessions are automatically cleaned up and how to configure the behavior.

Opened by Ship Help Bot on behalf of a team member.

Summary by CodeRabbit

  • Documentation
    • Added visual guides for session creation and management interface
    • Clarified inactivity timeout settings and automatic idle session stopping behavior
    • Enhanced session lifecycle documentation with improved descriptions

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for cheerful-kitten-f556a0 failed.

Name Link
🔨 Latest commit d88d21a
🔍 Latest deploy log https://app.netlify.com/projects/cheerful-kitten-f556a0/deploys/69e66f63c09e940008344844

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

📝 Walkthrough

Walkthrough

Documentation update to the sessions concepts page, clarifying inactivity timeout behavior, configuration hierarchy, and lifecycle semantics. Added figures, reorganized timeout descriptions, and documented the inactivity idler mechanism with its state preservation and configuration resolution behavior.

Changes

Cohort / File(s) Summary
Sessions Documentation
docs/src/content/docs/concepts/sessions.md
Added session creation and list UI screenshots. Restructured timeout documentation to distinguish "Timeout" and new "Inactivity timeout (idler)" sections. Updated lifecycle table to explicitly note inactivity-triggered stops. Documented idler configuration hierarchy (session → project → platform default, with 0 to disable) and graceful stop behavior with state preservation for resumption.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits format (docs: scope) and accurately describes the main change: adding a new inactivity timeout (idler) documentation section to the sessions page.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Performance And Algorithmic Complexity ✅ Passed PR modifies only documentation (markdown); no executable code changes means no algorithmic or performance regressions to assess.
Security And Secret Handling ✅ Passed Documentation contains no hardcoded secrets, tokens, credentials, or sensitive data; all dynamic values use safe placeholders and no authentication details exposed.
Kubernetes Resource Safety ✅ Passed PR modifies only documentation files (markdown) with no changes to Kubernetes manifests, RBAC definitions, container deployments, or infrastructure code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/src/content/docs/concepts/sessions.md`:
- Line 79: The current kubectl logs filter uses grep '[Inactivity]' which treats
brackets as a regex character class and matches unrelated lines; change the
filter to match the literal token by either using grep -F '[Inactivity]' or
escaping the brackets like grep '\[Inactivity\]' in the kubectl logs -l
app=ambient-code-operator -n <namespace> command so only lines containing the
exact "[Inactivity]" token are returned.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 69996b6f-e0f8-4394-875b-6915fdc89490

📥 Commits

Reviewing files that changed from the base of the PR and between c065914 and d88d21a.

📒 Files selected for processing (1)
  • docs/src/content/docs/concepts/sessions.md

You can check the operator logs to see which sessions have been stopped due to inactivity:

```sh
kubectl logs -l app=ambient-code-operator -n <namespace> | grep '[Inactivity]'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify grep behavior for the current vs corrected pattern.
# Expected:
# - First command matches unrelated lines (false positives).
# - Second command matches only lines containing literal "[Inactivity]".

printf '%s\n' \
  "INFO startup complete" \
  "[Inactivity] Session ns/s1: set desired-phase=Stopped with reason=inactivity" \
  "Activity heartbeat" \
  "trace id=abc" \
| tee /tmp/inactivity-sample.log >/dev/null

echo "Current doc pattern output:"
grep '[Inactivity]' /tmp/inactivity-sample.log || true

echo
echo "Correct literal pattern output:"
grep -F '[Inactivity]' /tmp/inactivity-sample.log || true

Repository: ambient-code/platform

Length of output: 305


🏁 Script executed:

#!/bin/bash
# Simplified verification: test grep regex behavior without tee

# Create test log content directly
log_content="INFO startup complete
[Inactivity] Session ns/s1: set desired-phase=Stopped with reason=inactivity
Activity heartbeat
trace id=abc
[I]nactivity note
Inactivity without brackets"

echo "=== Current doc pattern: grep '[Inactivity]' ==="
echo "$log_content" | grep '[Inactivity]' || echo "(no matches)"

echo ""
echo "=== Proposed fix: grep -F '[Inactivity]' ==="
echo "$log_content" | grep -F '[Inactivity]' || echo "(no matches)"

Repository: ambient-code/platform

Length of output: 413


Fix kubectl log filter: grep '[Inactivity]' matches unrelated lines.

The pattern [Inactivity] is a regex character class matching any single character in the set {I, n, a, c, t, i, v, y}. This causes false positives on unrelated logs like "Activity heartbeat", "INFO startup complete", and "Inactivity without brackets". Use the literal string match flag to filter only logs containing the actual token.

Suggested fix
-kubectl logs -l app=ambient-code-operator -n <namespace> | grep '[Inactivity]'
+kubectl logs -l app=ambient-code-operator -n <namespace> | grep -F '[Inactivity]'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
kubectl logs -l app=ambient-code-operator -n <namespace> | grep '[Inactivity]'
kubectl logs -l app=ambient-code-operator -n <namespace> | grep -F '[Inactivity]'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/src/content/docs/concepts/sessions.md` at line 79, The current kubectl
logs filter uses grep '[Inactivity]' which treats brackets as a regex character
class and matches unrelated lines; change the filter to match the literal token
by either using grep -F '[Inactivity]' or escaping the brackets like grep
'\[Inactivity\]' in the kubectl logs -l app=ambient-code-operator -n <namespace>
command so only lines containing the exact "[Inactivity]" token are returned.

@jeremyeder jeremyeder merged commit 2b6f6f5 into ambient-code:main Apr 20, 2026
10 of 15 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.

2 participants