feat(logging): log full content - prompts, responses, tool I/O

- Log full message content instead of just hash
- Log full tool input arguments
- Log full tool output/results
- Add model info to session and token events

No privacy restrictions for internal monitoring.
This commit is contained in:
Oussama Douhou
2026-01-10 15:33:44 +01:00
parent 2ffc72f6f8
commit 6b68c0a926
12 changed files with 1150 additions and 15 deletions

94
docker/Dockerfile.leader Normal file
View File

@@ -0,0 +1,94 @@
# Leader - The Orchestrator
FROM oven/bun:debian
LABEL role="leader"
LABEL description="The orchestrator of the agent ecosystem"
# Essential tools
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
less \
curl \
git \
jq \
tree \
make \
ca-certificates \
ripgrep \
&& rm -rf /var/lib/apt/lists/*
# Install yq
RUN curl -sL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/local/bin/yq \
&& chmod +x /usr/local/bin/yq
# Install ast-grep (sg) via npm
RUN bun install -g @ast-grep/cli && \
ln -sf $(which ast-grep) /usr/local/bin/sg
# Set bun paths
ENV BUN_INSTALL=/root/.bun
ENV PATH=$BUN_INSTALL/bin:/usr/local/bin:$PATH
# Install OpenCode CLI
RUN bun install -g opencode-ai && \
echo "=== OpenCode CLI installed ===" && \
which opencode && \
opencode --version
# Copy and install oh-my-opencode from local source
COPY package.json bun.lock tsconfig.json /tmp/oh-my-opencode/
COPY src/ /tmp/oh-my-opencode/src/
COPY script/ /tmp/oh-my-opencode/script/
COPY assets/ /tmp/oh-my-opencode/assets/
RUN cd /tmp/oh-my-opencode && \
bun install && \
bun run build && \
npm install -g . && \
echo "=== oh-my-opencode installed from local source ===" && \
rm -rf /tmp/oh-my-opencode
# Create workspace and config directories
WORKDIR /workspace
# Shared config directory - all agents read from here
RUN mkdir -p /shared/config \
/shared/claude \
/shared/skills \
/shared/commands \
/shared/agents \
/data/artifacts \
/data/reports \
/data/logs
# Set environment for shared config
ENV XDG_CONFIG_HOME=/shared/config
ENV HOME=/root
ENV NODE_ENV=development
ENV OH_MY_OPENCODE_ENABLED=true
# Add convenient alias for attaching to local server
RUN echo "alias opencode='opencode attach http://localhost:8080'" >> /root/.bashrc
# Copy config files (from docker directory)
COPY docker/shared-config/ /shared/config/
# Set bash as default shell
SHELL ["/bin/bash", "-c"]
# Verify plugin installation and configuration
RUN echo "=== DEBUG: Final Plugin Verification ===" && \
echo "OpenCode location:" && which opencode && \
echo "OpenCode version:" && opencode --version && \
echo "ripgrep version:" && rg --version | head -1 && \
echo "ast-grep version:" && sg --version && \
echo "Configuration check:" && \
cat /shared/config/opencode.jsonc | jq '.plugin' 2>/dev/null || echo "Config not readable" && \
echo "Plugin directory check:" && \
ls -la /shared/config/ 2>/dev/null || echo "Config dir not accessible" && \
echo "Testing basic OpenCode functionality:" && \
timeout 5 opencode --help >/dev/null 2>&1 && echo "OpenCode CLI working" || echo "OpenCode CLI issue" && \
echo "=== DEBUG: Verification complete ==="
# Start OpenCode server
EXPOSE 8080
CMD ["sh", "-c", "echo '=== Starting OpenCode Server ===' && echo 'Server will be available at http://localhost:8080' && opencode serve --hostname 0.0.0.0 --port 8080 --mdns 2>&1 | tee /var/log/opencode.log"]

34
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,34 @@
services:
leader:
build:
context: .
dockerfile: Dockerfile.leader
container_name: leader
hostname: leader
ports:
- "8085:8080"
volumes:
- ../:/workspace
- leader-data:/data
- ./shared-config:/shared/config
- shared-skills:/shared/skills
- shared-commands:/shared/commands
- shared-agents:/shared/agents
environment:
- ROLE=leader
- TEAM=marketing,sales,engineers
- OPENCODE_CONFIG_DIR=/shared/config
- XDG_CONFIG_HOME=/shared/config
restart: unless-stopped
volumes:
leader-data:
name: leader-data
shared-config:
name: agent-shared-config
shared-skills:
name: agent-shared-skills
shared-commands:
name: agent-shared-commands
shared-agents:
name: agent-shared-agents

View File

@@ -0,0 +1,104 @@
{
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
"google_auth": false,
"disabled_mcps": ["websearch_exa"],
"disabled_hooks": [],
"sisyphus_agent": {
"disabled": false,
"temperature": 0.3
},
"agents": {
"Sisyphus": {
"model": "opencode/glm-4.7-free",
"temperature": 0.3
},
"oracle": {
"model": "opencode/gpt-5-nano",
"temperature": 0.2
},
"librarian": {
"model": "opencode/minimax-m2.1-free",
"temperature": 0.1
},
"explore": {
"model": "opencode/grok-code",
"temperature": 0.4
},
"frontend-ui-ux-engineer": {
"model": "opencode/glm-4.7-free",
"temperature": 0.3
},
"document-writer": {
"model": "opencode/gpt-5-nano",
"temperature": 0.2
},
"multimodal-looker": {
"model": "opencode/glm-4.7-free",
"temperature": 0.3
}
},
"experimental": {
"preemptive_compaction": true,
"preemptive_compaction_threshold": 0.70,
"truncate_all_tool_outputs": false,
"dynamic_context_pruning": {
"enabled": true,
"notification": "minimal",
"turn_protection": {
"enabled": true,
"turns": 3
},
"protected_tools": [
"task",
"todowrite",
"todoread",
"lsp_diagnostics",
"lsp_code_actions",
"lsp_hover",
"lsp_goto_definition",
"lsp_find_references",
"lsp_rename",
"ast_grep_search",
"ast_grep_replace",
"grep",
"read",
"write",
"edit",
"run_terminal_cmd"
],
"strategies": {
"deduplication": {
"enabled": true
},
"supersede_writes": {
"enabled": true
},
"purge_errors": {
"enabled": true,
"turns": 2
},
"code_artifact_protection": {
"enabled": true,
"protect_todos": true,
"protect_code_changes": true,
"preserve_recent_tool_outputs": 5,
"todo_codebase_compaction": {
"enabled": true,
"max_recent_messages": 5,
"structured_summaries": true,
"preserve_coding_context": true
}
}
}
}
},
"background_task": {
"defaultConcurrency": 2,
"providerConcurrency": {
"opencode": 3
}
},
"notification": {
"force_enable": false
}
}

View File

@@ -0,0 +1,52 @@
{
"$schema": "https://opencode.ai/config.json",
"keybinds": {
"model_cycle_recent": "alt+m",
"model_cycle_recent_reverse": "alt+shift+m"
},
"plugin": [
"oh-my-opencode"
],
"autoupdate": false,
"model": "opencode/glm-4.7-free",
"small_model": "opencode/glm-4.7-free",
"theme": "tokyonight",
"tools": {
"todoread": true,
"todowrite": true,
"webfetch": true
},
"permission": {
"bash": "ask",
"write": "ask",
"edit": "ask",
"read": "allow",
"todowrite": "allow",
"todoread": "allow",
"task": "ask",
"grep": "allow",
"glob": "allow",
"list": "allow",
"webfetch": "allow",
"skill": {
"*": "allow"
}
},
"provider": {
"opencode": {
"name": "OpenCode Free",
"models": {
"glm-4.7-free": {
"name": "GLM 4.7 Free",
"limit": { "context": 32768, "output": 4096 },
"modalities": { "input": ["text"], "output": ["text"] }
},
"gpt-5-nano": {
"name": "GPT-5 Nano",
"limit": { "context": 128000, "output": 4096 },
"modalities": { "input": ["text"], "output": ["text"] }
}
}
}
}
}

View File

@@ -0,0 +1,118 @@
{
"plugin": [
"oh-my-opencode"
],
"$schema": "https://opencode.ai/config.json",
"autoupdate": false,
"model": "opencode/glm-4.7-free",
"small_model": "opencode/gpt-5-nano",
"theme": "tokyonight",
"keybinds": {
"model_cycle_recent": "alt+m",
"model_cycle_recent_reverse": "alt+shift+m"
},
"tools": {
"todoread": true,
"todowrite": true,
"webfetch": true,
"lsp_diagnostics": true,
"lsp_code_actions": true
},
"permission": {
"bash": "ask",
"write": "ask",
"edit": "ask",
"read": "allow",
"todowrite": "allow",
"todoread": "allow",
"task": "ask",
"grep": "allow",
"glob": "allow",
"list": "allow",
"webfetch": "allow",
"lsp_diagnostics": "allow",
"lsp_code_actions": "allow",
"skill": {
"*": "allow"
}
},
"mcp": {
"graphiti-memory": {
"type": "remote",
"url": "http://10.100.0.17:8080/mcp/",
"enabled": true,
"oauth": false,
"timeout": 30000,
"headers": {
"X-API-Key": "0c1ab2355207927cf0ca255cfb9dfe1ed15d68eacb0d6c9f5cb9f08494c3a315"
}
}
},
"provider": {
"opencode": {
"name": "OpenCode Free",
"models": {
"glm-4.7-free": {
"name": "GLM 4.7 Free",
"limit": {
"context": 32768,
"output": 4096
},
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
}
},
"gpt-5-nano": {
"name": "GPT-5 Nano",
"limit": {
"context": 128000,
"output": 4096
},
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
}
},
"minimax-m2.1-free": {
"name": "MiniMax M2.1 Free",
"limit": {
"context": 32768,
"output": 4096
},
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
}
},
"grok-code": {
"name": "Grok Code",
"limit": {
"context": 128000,
"output": 4096
},
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
}
}
}
}
}
}

View File

@@ -0,0 +1 @@
TEST: This change should persist rebuilds