Skip to content

feat: add shell skills, file-based instructions, and disable tracing#8

Merged
John-Lin merged 2 commits into
masterfrom
feat/shell-skills-and-instructions
Apr 7, 2026
Merged

feat: add shell skills, file-based instructions, and disable tracing#8
John-Lin merged 2 commits into
masterfrom
feat/shell-skills-and-instructions

Conversation

@John-Lin

@John-Lin John-Lin commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Load agent instructions from instructions.md file instead of hardcoded DEFAULT_INSTRUCTIONS, with fail-fast behavior when file is missing
  • Add ShellTool support with auto-discovered skills from skills/ directory, gated behind SHELL_SKILLS_ENABLED environment variable
  • Disable OpenAI tracing via set_tracing_disabled(True)
  • Reduce MAX_TURNS from 25 to 10 for consistency across all three bots (Telegram, Discord, Slack)

Changes

bot/agent.py

  • Remove DEFAULT_INSTRUCTIONS constant
  • Add _load_instructions() — reads instructions.md from working directory
  • Add _parse_skill_description() — extracts description from SKILL.md YAML frontmatter
  • Add _load_shell_skills() — auto-discovers skills under skills/ directory
  • Add _shell_executor() — async shell command runner with timeout support
  • Update OpenAIAgent.__init__ to accept tools parameter, make instructions required (no default)
  • Update OpenAIAgent.from_dict to use file-based instructions and conditionally load shell skills

Tests (tests/test_agent.py)

  • Add TestLoadShellSkills (9 tests) — env var gating, skill discovery, error handling
  • Add TestParseSkillDescription (8 tests) — frontmatter parsing edge cases
  • Add TestShellExecutor (9 tests) — command execution, timeouts, error handling
  • Update TestInstructions for file-based loading
  • Update TestHistoryTruncation to assert MAX_TURNS == 10
  • Remove obsolete Azure/proxy client tests
  • Total: 81 tests (up from 57)

Documentation

  • Add instructions.md.example template
  • Remove instructions field from servers_config.example.json
  • Add .gitignore entry for instructions.md
  • Update README: add Agent Instructions, Shell Skills sections; update Docker examples to mount instructions.md

John-Lin added 2 commits April 7, 2026 00:58
- Load agent instructions from instructions.md instead of hardcoded DEFAULT_INSTRUCTIONS
- Add ShellTool support with auto-discovered skills from skills/ directory
- Gate shell skills behind SHELL_SKILLS_ENABLED environment variable
- Reduce MAX_TURNS from 25 to 10 for consistency across bots
- Disable OpenAI tracing with set_tracing_disabled(True)
- Add instructions.md.example as template
- Remove instructions field from servers_config.example.json
- Update README with Agent Instructions, Shell Skills, and Docker sections
@John-Lin
John-Lin merged commit a7ddc45 into master Apr 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant