docs: add inactivity timeout (idler) section to sessions page#1368
Conversation
❌ Deploy Preview for cheerful-kitten-f556a0 failed.
|
📝 WalkthroughWalkthroughDocumentation 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
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Warning Review ran into problems🔥 ProblemsTimed 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. Comment |
There was a problem hiding this comment.
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
📒 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]' |
There was a problem hiding this comment.
🧩 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 || trueRepository: 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.
| 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.
Summary
Expands the sessions documentation page to fully document the inactivity timeout (idler) feature.
Changes
Inactivity timeoutrow in the Creating a session settings table, with a link to the detailed sectionInactivity timeout (idler)subsection under Session lifecycle covering:lastActivityTimetracking, graceful stop with state preservation,inactivitystop reason)0kubectl logs ... | grep '[Inactivity]')Stoppedphase description to mention the idler as a possible causeContext
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