You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: align shell and logging architecture with agentic-slackbot
Port the full set of architecture changes from agentic-slackbot:
- Replace SHELL_SKILLS_ENABLED boolean with orthogonal SHELL_ENABLED
and SHELL_SKILLS_DIR env vars. SHELL_ENABLED is the sole on/off
toggle; SHELL_SKILLS_DIR optionally mounts a skills directory.
- _load_shell_skills() now takes an explicit Path argument instead of
reading a module-level SKILLS_DIR constant.
- Add _get_shell_environment() encapsulating the three-state logic with
warnings for misconfiguration (orphaned SHELL_SKILLS_DIR, empty dir).
- Add env_flag() helper in bot/config.py that treats "0", "false",
"no", "off" as disabled, fixing the FOO=0 gotcha.
- Extract _configure_logging() in app.py with AGENT_VERBOSE_LOG support
(calls SDK's enable_verbose_stdout_logging() when set).
- Rewrite TestLoadShellSkills -> TestShellToolConfiguration with cleaner
helpers; add TestEnvFlag; update autouse fixture.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+39-3Lines changed: 39 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ See also: [agentic-slackbot](https://github.com/John-Lin/agentic-slackbot) — a
12
12
- Supports OpenAI, Azure OpenAI endpoints
13
13
- Per-conversation history with automatic truncation
14
14
- Group reply chain — after `@mention`, anyone can continue by replying
15
-
-Local shell skills — let the agent run shell scripts from `skills/` (opt-in via `SHELL_SKILLS_ENABLED`)
15
+
-Optional local shell via `ShellTool`, controlled by `SHELL_ENABLED` and `SHELL_SKILLS_DIR`
16
16
17
17
## Install Dependencies
18
18
@@ -43,8 +43,12 @@ export TELEGRAM_BOT_TOKEN=""
43
43
export OPENAI_API_KEY=""
44
44
export OPENAI_MODEL="gpt-5.4"
45
45
46
-
# Shell skills (disabled by default)
47
-
# export SHELL_SKILLS_ENABLED=1
46
+
# Local shell (disabled by default)
47
+
# export SHELL_ENABLED=1
48
+
# export SHELL_SKILLS_DIR="./skills" # optional; mount skills alongside the shell
49
+
50
+
# Optional verbose OpenAI Agents SDK logging
51
+
# export AGENT_VERBOSE_LOG=1
48
52
```
49
53
50
54
## Agent Instructions
@@ -173,6 +177,38 @@ uv run bot access group remove <GROUP_ID>
173
177
174
178
Group members do not need to pair individually — access is controlled at the group level.
175
179
180
+
## Local Shell (Optional)
181
+
182
+
The bot can expose a local `ShellTool`. This is **disabled by default**. Enable it with:
183
+
184
+
```
185
+
export SHELL_ENABLED=1
186
+
```
187
+
188
+
With just `SHELL_ENABLED=1`, the agent gets bare local shell access with no pre-defined skills.
189
+
190
+
### Shell Skills (Optional)
191
+
192
+
You can optionally mount a skills directory alongside the shell. Each immediate subdirectory containing a `SKILL.md` file is registered as a skill and exposed to the agent as a hint (skills are advisory metadata — they do **not** sandbox command execution).
193
+
194
+
```
195
+
export SHELL_ENABLED=1
196
+
export SHELL_SKILLS_DIR="./skills"
197
+
```
198
+
199
+
`SHELL_SKILLS_DIR` is ignored unless `SHELL_ENABLED` is set. If the directory is missing or contains no valid skills, the bot falls back to a bare shell and logs a warning.
200
+
201
+
The `SKILL.md` file should have YAML frontmatter with `name` and `description` fields:
202
+
203
+
```markdown
204
+
---
205
+
name: my-skill
206
+
description: A brief description of what this skill does
0 commit comments