Add support for custom global installation paths with automatic context reference transformation. This enables users to install to any location while maintaining working context references. Changes: - Add universal path transformation for ANY global installation path (not just ~/.config/opencode) - Implement automatic cleanup trap for temp files on exit/crash/interrupt - Add early validation for --install-dir argument with clear error messages - Add developer documentation for context reference convention Technical Details: - Path transformation detects local vs global by checking if path ends in .opencode (local) or not (global) - Transformation applies to ALL file types during installation - sed transforms both @ references and shell command paths - Cleanup trap handles EXIT, INT, and TERM signals Testing: - 31 unit and integration tests (100% pass rate) - All README installation scenarios verified - Edge cases tested and handled - Cross-platform compatible (macOS, Linux, Windows Git Bash) Documentation: - Added dev/docs/context-reference-convention.md explaining the required @.opencode/context/ format and why it's necessary - Includes examples, validation instructions, and test results Breaking changes: None New capabilities: Custom global path support |
||
|---|---|---|
| .. | ||
| tests | ||
| cleanup-stale-sessions.sh | ||
| README.md | ||
| register-component.sh | ||
| uninstall.sh | ||
| validate-component.sh | ||
| validate-context-refs.sh | ||
Scripts
This directory contains utility scripts for the OpenAgents system.
Available Scripts
Component Management
register-component.sh- Register a new component in the registryvalidate-component.sh- Validate component structure and metadata
Session Management
cleanup-stale-sessions.sh- Remove stale agent sessions older than 24 hours
Testing
See tests/ subdirectory for test scripts.
Session Cleanup
Agent instances create temporary context files in .tmp/sessions/{session-id}/ for subagent delegation. These sessions are automatically cleaned up, but you can manually remove stale sessions:
# Clean up sessions older than 24 hours
./scripts/cleanup-stale-sessions.sh
# Or manually delete all sessions
rm -rf .tmp/sessions/
Sessions are safe to delete anytime - they only contain temporary context files for agent coordination.
Usage Examples
Register a Component
./scripts/register-component.sh path/to/component
Validate a Component
./scripts/validate-component.sh path/to/component
Clean Stale Sessions
./scripts/cleanup-stale-sessions.sh