Skip to content

Comments

Add session environment variables reference for session pods#649

Open
syntaxsdev wants to merge 3 commits intoambient-code:mainfrom
syntaxsdev:docs/session-env
Open

Add session environment variables reference for session pods#649
syntaxsdev wants to merge 3 commits intoambient-code:mainfrom
syntaxsdev:docs/session-env

Conversation

@syntaxsdev
Copy link

4 session pod containers, organized into 15 functional categories:

  • Session Identity (8 vars)
  • LLM Configuration (6 vars)
  • Repository Configuration (3 vars + JSON schema example)
  • Workflow Configuration (3 vars)
  • Authentication & Credentials (4 vars)
  • Vertex AI Configuration (4 vars)
  • Backend Integration (3 vars)
  • AG-UI Server (3 vars)
  • Langfuse Observability (6 vars)
  • S3 State Persistence (6 vars)
  • MCP & Google Workspace (4 vars)
  • Jira Integration (3 vars)
  • Runtime & Debug (6 vars)
  • Runtime-Derived Variables (3 vars set by runner, not operator)
  • Custom Variables (spec.environmentVariables override mechanism)

Plus a Secrets Reference table and a Container Cross-Reference matrix showing which of the 4 containers (init-hydrate, ambient-content, runner, state-sync) receives each variable.

  • mkdocs.yml
  • docs/reference/index.md - dded cross-reference link at the top of Quick Reference.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2026

Claude Code Review

Summary

This PR adds comprehensive reference documentation for session pod environment variables. The document catalogs 64 environment variables across 15 functional categories with a detailed container cross-reference matrix showing which of the 4 containers (init-hydrate, ambient-content, runner, state-sync) receives each variable.

Overall Assessment: ✅ APPROVED - High-quality documentation that follows project standards with excellent organizational structure.


Issues by Severity

🚫 Blocker Issues

None - No blocking issues found.


🔴 Critical Issues

None - No critical issues found.


🟡 Major Issues

None - Documentation accurately reflects the codebase.


🔵 Minor Issues

1. Typo in mkdocs.yml Line 48 Description

File: mkdocs.yml:48

Issue: Description says "dded cross-reference link" (missing 'a')

Current:

- docs/reference/index.md - dded cross-reference link at the top of Quick Reference.

Should be:

- docs/reference/index.md - Added cross-reference link at the top of Quick Reference.

Severity: Minor - typo in PR description, not in documentation itself


2. Documentation Standards: File Location Consideration

Reference: CLAUDE.md lines 1095-1101 state:

"Default to improving existing documentation rather than creating new files... Colocate new docs: When feasible, documentation should live in the subdirectory that has the relevant code"

Current: New file at docs/reference/session-environment-variables.md

Analysis: This is acceptable because:

  • Environment variables span multiple components (operator, runner, init-hydrate, state-sync)
  • No single "owner" component exists
  • Reference documentation appropriately lives in docs/reference/
  • Cross-cutting concerns justify top-level docs per CLAUDE.md

Recommendation: No change needed, but note for future: component-specific env var docs should live with that component (e.g., components/runner/README.md).


Positive Highlights

1. ✅ Excellent Organizational Structure

The 15 functional categories provide logical grouping that matches mental models:

  • Session Identity (8 vars)
  • LLM Configuration (6 vars)
  • Repository Configuration (3 vars)
  • Authentication & Credentials (4 vars)
  • etc.

This organization makes it easy to find variables by purpose rather than alphabetically.

2. ✅ Accurate Code Verification

Spot-checked against components/operator/internal/handlers/sessions.go:

  • SESSION_ID (line 900)
  • AGENTIC_SESSION_NAME (line 897)
  • BACKEND_API_URL (line 936)
  • USE_AGUI (line 934)
  • AGUI_PORT (line 905)
  • LANGFUSE_* variables (lines 948-988)
  • CLAUDE_CODE_USE_VERTEX (lines 994, 1001)

All documented variables match actual implementation.

3. ✅ Container Cross-Reference Matrix

The tables at the end (lines 258-320, 321-337) are invaluable for understanding:

  • Which container gets which variable
  • Whether variables are operator-injected vs runtime-derived
  • Conditional injection logic

This is a significant improvement over reading operator code directly.

4. ✅ Security-Conscious Documentation

Properly documents:

  • Secret injection methods (envFrom vs secretKeyRef)
  • Warning about LANGFUSE_MASK_MESSAGES=false exposing user data (line 149-150)
  • Note about runtime token refresh precedence (line 92-93)

5. ✅ Cross-Linking to Authoritative Sources

Line 340: "Source of truth: components/operator/internal/handlers/sessions.go (lines 730–1190)"

Excellent practice - directs maintainers to update both docs AND code.

6. ✅ Proper Documentation Patterns

Follows established patterns from docs/amber-quickstart.md:

  • Clear tables with Required/Default/Source columns
  • Examples with code blocks
  • Cross-references to related docs
  • Admonitions (!!! note, !!! warning) for critical info

7. ✅ JSON Schema Examples

Provides actual JSON schema for REPOS_JSON (lines 51-65) rather than just describing it. This helps developers understand the structure immediately.

8. ✅ Distinguishes Operator vs Runtime Variables

Section "Runtime-Derived Variables" (lines 209-218) clearly explains that GIT_USER_NAME, GIT_USER_EMAIL, USER_GOOGLE_EMAIL are set by the runner, not the operator. This prevents confusion when debugging pod specs.


Recommendations

Priority 1: Fix Typo

Fix the typo in PR description (mkdocs.yml comment line).

Priority 2: Consider Adding Examples Section

Enhancement suggestion (not required for merge):

Add a "Common Scenarios" section showing how to:

  1. Override default DEBUG=true via spec.environmentVariables
  2. Enable Vertex AI (requires 4 variables)
  3. Configure S3 state persistence (6 variables)

Example:

spec:
  environmentVariables:
    DEBUG: "false"  # Override default

This would complement the existing spec.environmentVariables section (lines 221-238).

Priority 3: Future Enhancement - Interactive Table

Long-term idea (not for this PR):

The container cross-reference matrix (lines 262-320) could be enhanced with:

  • Sortable/filterable table (MkDocs Material plugin)
  • Quick search for variable names
  • Color coding by container

But static tables are perfectly acceptable for now.


Code Quality Assessment

Documentation Standards Compliance

  • ✅ Markdown linting: Proper heading hierarchy
  • ✅ Code blocks: Proper syntax highlighting (yaml, json, ```bash)
  • ✅ Cross-references: Links to related docs work
  • ✅ MkDocs integration: Properly added to mkdocs.yml nav
  • ✅ Admonitions: Proper !!! note and !!! warning syntax

Accuracy Verification

  • ✅ Operator code matches documented variable names
  • ✅ Default values accurate (e.g., AGUI_PORT=8001, SYNC_INTERVAL=60)
  • ✅ Conditional logic documented (Vertex vs Anthropic API)
  • ✅ Secret sources correct (ambient-runner-secrets, ambient-admin-langfuse-secret)

Completeness

  • ✅ All 4 containers documented
  • ✅ All secret sources listed
  • ✅ Runtime-derived variables distinguished from operator-injected
  • ✅ Override mechanism documented (spec.environmentVariables)

Testing Recommendations

Before merging:

  1. ✅ Verify mkdocs serve renders tables correctly
  2. ✅ Check all cross-reference links work
  3. ✅ Validate against actual running session pod: kubectl describe pod <session-pod>

Final Verdict

APPROVED

This is excellent reference documentation that will significantly improve developer experience when:

  • Debugging session pod issues
  • Understanding operator-injected vs runtime variables
  • Configuring custom environment variables
  • Troubleshooting auth/credentials issues

The only issue is a minor typo in the PR description, which doesn't affect the documentation quality.

Recommendation: Merge after fixing the typo.


Review conducted by: Claude Code (Sonnet 4.5)
Standards referenced: CLAUDE.md, backend-development.md, security-standards.md
Code verification: components/operator/internal/handlers/sessions.go lines 730-1190


🔍 View AI decision process (logs available for 90 days)

📋 View memory system files loaded (click to expand)

What Amber Loaded for Code Review

Amber automatically loaded these repository standards from the memory system:

  1. CLAUDE.md - Master project instructions, development standards
  2. backend-development.md - Go backend, K8s integration patterns
  3. frontend-development.md - NextJS, Shadcn UI, React Query patterns
  4. security-standards.md - Auth, RBAC, token handling
  5. k8s-client-usage.md - User token vs service account patterns
  6. error-handling.md - Consistent error patterns
  7. react-query-usage.md - Data fetching patterns

Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines.

@bobbravo2
Copy link
Contributor

This is great work @syntaxsdev ! thank you for your contribution!

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