-
-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Milestone
Description
Summary
Users and AI assistants need quick access to session information (mounts, image, mode, etc.) without scrolling through startup logs. This feature adds a COPILOT_HERE_SESSION_INFO environment variable containing structured JSON data about the current session, along with a helper command session-info for easy viewing.
Problem
- Startup logs scroll off screen in long sessions
- AI assistants can't easily reference environment details (mounts, image variant, mode)
- No programmatic way to query session configuration
- Users have to manually remember what directories are mounted
Expected Usage / Use Cases
Use Case 1: Quick Session Info Display
User wants to see their current session configuration formatted nicely:
# Inside copilot_here container
!session-infoExpected Output:
{
"copilot_here_version": "2025.12.19",
"image": {
"tag": "dotnet-rust",
"full_name": "ghcr.io/gordonbeeming/copilot_here:dotnet-rust"
},
"mode": "yolo",
"working_directory": "/home/appuser/Developer/github/gordonbeeming/copilot_here",
"mounts": [
{
"host_path": "/Users/gordonbeeming/Developer/github/gordonbeeming/copilot_here/default-airlock-rules.json",
"container_path": "/home/appuser/Developer/github/gordonbeeming/copilot_here/default-airlock-rules.json",
"mode": "ro",
"source": "local"
},
{
"host_path": "/Users/gordonbeeming/Developer/github/gordonbeeming/xylem/data/blog",
"container_path": "/home/appuser/Developer/github/gordonbeeming/xylem/data/blog",
"mode": "rw",
"source": "global"
}
],
"airlock": {
"enabled": false,
"rules_path": "",
"source": "local"
}
}Use Case 2: Manual Python Formatting (Workaround)
User on older image or preferring manual approach:
!echo $COPILOT_HERE_SESSION_INFO | python3 -m json.toolExpected Output: Same formatted JSON as above
Use Case 3: AI Assistant Context
AI assistant needs to understand the environment without scrolling:
User: "Can you access my blog files?"
AI: Let me check... *runs session-info*
Yes! I can see you have /Users/gordonbeeming/xylem/data/blog mounted as read-write.
Use Case 4: Querying Specific Info with jq
User wants to extract specific information:
# Get current image tag
!echo $COPILOT_HERE_SESSION_INFO | jq -r .image.tag
# List all mounted paths
!echo $COPILOT_HERE_SESSION_INFO | jq -r '.mounts[].container_path'
# Check if airlock is enabled
!echo $COPILOT_HERE_SESSION_INFO | jq .airlock.enabledAcceptance Criteria
- Environment variable
COPILOT_HERE_SESSION_INFOis set in all containers - Variable contains JSON with: version, image, mode, working directory, mounts, airlock status
- Mounts show resolved absolute paths (not
~/shortcuts) -
session-infocommand installed in Docker images for formatted output - Fallback to Python json.tool if jq not available
- Works in both standard and Airlock modes
- Airlock mode includes network config details (rules count, sample domains)
- AOT-compatible implementation (no reflection/dynamic code)
- Documentation updated in README
- Task documentation created
Solution Implemented
Components Added
-
SessionInfo.cs - AOT-compatible JSON builder
- Manual string building (no reflection)
- Resolves paths to absolute
- Standard and Airlock modes
-
session-info.sh - Helper script
- Tries jq first
- Falls back to Python json.tool
- Installed in all Docker images
-
Environment Variable Integration
- RunCommand passes to Docker
- AirlockRunner includes in compose file
- Available immediately in container
Files Changed
app/Infrastructure/SessionInfo.cs(new)app/Commands/Run/RunCommand.csapp/Infrastructure/AirlockRunner.csapp/Resources/docker-compose.airlock.yml.templatedocker/Dockerfile.basedocker/session-info.sh(new)README.mddocs/tasks/20251229-01-session-info-env-var.md
Testing Performed
- Native binary builds without warnings
- Standard mode shows session info
- YOLO mode shows session info
-
session-infocommand works - Python fallback works
- Paths are fully resolved (absolute)
- Tested with dotnet-rust variant
Benefits
- AI assistants can instantly reference environment
- No filesystem pollution (env var only)
- Ephemeral (cleaned when container stops)
- Queryable with jq/Python
- Works in all modes
Metadata
Metadata
Assignees
Labels
No labels