This feature introduces a new Analyse Agent for local data analysis with model locking and environment variable interpolation, along with a supporting Data-Explore Subagent for privacy-sensitive CSV analysis. Both agents run on local Ollama models and are designed to work with gitignored files securely.
- Branch:
feat/analyse-agent - Base:
main - Status: Complete, ready for merge
- e6ff203e9 -
feat: add analyse agent with model locking and env var interpolation - 9757a4e11 -
feat: add data-explore subagent for sensitive CSV data analysis - ddc459cad -
fix: add model_lock to secret agent for consistency - 3384b4988 -
fix: audit findings in data-explore implementation - c4c1cfafc -
fix: strengthen anti-hallucination requirements for analyse and data-explore agents - a991360f3 -
docs: add sequential chaining strategy for data-explore analysis
Purpose: Local data analyst running on Ollama for secure, offline data analysis
Key Capabilities:
- Runs locally on Ollama models (no cloud connectivity required)
- Analyzes gitignored files securely (bypasses gitignore checks like the secret agent)
- Direct file access without data sanitization
- Environment variable interpolation in agent frontmatter
Configuration:
- Located at:
.opencode/agent/analyse.md - Model locking enabled by default
- Supports
{env:VAR}syntax in frontmatter for dynamic configuration
Access Control:
- Extended gitignore bypass in:
- Session prompt setup
- Read tool (fully bypasses gitignore, no faking)
- Used by Alice instructions for protected CSV file analysis
Purpose: Specialized subagent for analyzing sensitive CSV data with privacy guarantees
Key Characteristics:
- Analyzes gitignored data locally on Ollama
- Returns insights and patterns only, never raw data values
- Privacy-preserving design for sensitive datasets
- Triggered by Alice for protected CSV files
Implementation:
- Integrated into prompt.ts and read.ts for gitignore bypass
- Anti-hallucination requirements enforced
- Sequential chaining strategy for multi-step analysis
Feature: Prevents accidental model changes when an agent specifies a configured model
Implementation:
-
UI Changes:
- Model selector disabled in prompt-input when agent has locked model
- Visual feedback for locked state
-
CLI Changes:
model.set()blocked when model is lockedmodel.cycle()prevented when model is lockedmodel.cycleFavorite()prevented when model is lockedmodel.listcommand disabled in TUI when agent has locked model
-
Applied to:
- Analyse Agent (primary)
- Secret Agent (for consistency)
Feature: Dynamic configuration using environment variables in agent frontmatter
Syntax: {env:VARIABLE_NAME} in markdown config frontmatter
Use Cases:
- Model specification:
model: {env:OLLAMA_MODEL} - API endpoints:
api_endpoint: {env:LOCAL_OLLAMA_URL} - Custom paths:
data_dir: {env:ANALYSIS_DATA_DIR}
Scope: Analyse agent and all agents supporting dynamic configuration
.opencode/agent/analyse.md- Analyse agent configuration
.opencode/- Agent configuration system- UI/prompt-input component - Model selector locking
- CLI model commands - Locking enforcement
prompt.ts- Gitignore bypass for analyse and data-exploreread.ts- Full gitignore bypass for analyse agent- Alice agent instructions - Data-explore dispatching logic
- Agent security rules - Anti-hallucination requirements
- Both agents have strengthened requirements to prevent fabricated data
- Systematic validation before returning insights
- Data provenance tracking
- Multi-step analysis workflow documented
- Data-explore can decompose complex analyses into steps
- Each step validates before proceeding to next
- All audit findings from implementation phase addressed
- Model locking prevents unintended agent behavior changes
- Gitignore bypass properly scoped and documented
- Alice Agent: Dispatches to data-explore for protected CSV analysis
- Session System: Analyse agent benefits from model locking
- CLI: Model commands respect locking constraints
- UI: Prompt input respects model lock state
- Configuration System: Environment variable interpolation
✓ Gitignore Bypass: Properly scoped to analyse and data-explore agents only ✓ Local Processing: No data leaves the system (local Ollama only) ✓ Privacy Guarantees: Data-explore returns insights, never raw values ✓ Model Lock: Prevents accidental model swaps that could expose different behavior ✓ Anti-Hallucination: Strengthened requirements prevent fabricated insights
- Ollama running locally with configured model
- Environment variables set for model configuration
- Alice agent updated with data-explore dispatch logic
- Set
OLLAMA_MODELenvironment variable - Optionally set
LOCAL_OLLAMA_URLif non-default - Data-explore CSV files in gitignored directories
- No schema changes required
- Configuration is markdown-based
- UI changes are additive (locking only)
- Audit findings addressed in commit 3384b4988
- Sequential chaining strategy documented in commit a991360f3
- Model lock consistency applied to secret agent in commit ddc459cad
If needed:
- Revert to commit before
e6ff203e9 - Remove model locking UI components
- Remove analyse agent from agents directory
- Restore original gitignore handling in prompt.ts and read.ts
- Remove data-explore dispatch from Alice instructions
- GPU acceleration for local Ollama models
- Streaming responses for large dataset analysis
- Caching of analysis results
- Custom analysis templates
- Integration with vector databases for semantic search