remove: drop unused TODO.md feature and /todo slash command
TODO.md was never injected into the system prompt, making the feature non-functional. Remove all related code, slash command handler, and documentation references across all 6 language READMEs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
946a79423b
commit
49b1f498f7
11 changed files with 4 additions and 62 deletions
|
|
@ -491,7 +491,6 @@ PicoClaw stocke les données dans votre workspace configuré (par défaut : `~/.
|
||||||
├── state/ # État persistant (dernier canal, etc.)
|
├── state/ # État persistant (dernier canal, etc.)
|
||||||
├── cron/ # Base de données des tâches planifiées
|
├── cron/ # Base de données des tâches planifiées
|
||||||
├── skills/ # Compétences personnalisées
|
├── skills/ # Compétences personnalisées
|
||||||
├── TODO.md # Liste de tâches (gérée par l'IA, voir avec /todo)
|
|
||||||
├── AGENTS.md # Guide de comportement de l'Agent
|
├── AGENTS.md # Guide de comportement de l'Agent
|
||||||
├── HEARTBEAT.md # Invites de tâches périodiques (vérifiées toutes les 30 min)
|
├── HEARTBEAT.md # Invites de tâches périodiques (vérifiées toutes les 30 min)
|
||||||
├── IDENTITY.md # Identité de l'Agent
|
├── IDENTITY.md # Identité de l'Agent
|
||||||
|
|
@ -815,7 +814,6 @@ Ces commandes slash peuvent être envoyées dans n'importe quel canal de chat (T
|
||||||
| Commande | Description |
|
| Commande | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `/help` | Afficher les commandes disponibles |
|
| `/help` | Afficher les commandes disponibles |
|
||||||
| `/todo` | Afficher la liste des tâches (lit `TODO.md`) |
|
|
||||||
| `/session` | Afficher les statistiques d'utilisation des tokens (nécessite `--stats`) |
|
| `/session` | Afficher les statistiques d'utilisation des tokens (nécessite `--stats`) |
|
||||||
| `/session reset` | Réinitialiser les statistiques d'utilisation |
|
| `/session reset` | Réinitialiser les statistiques d'utilisation |
|
||||||
| `/skills` | Lister les compétences disponibles |
|
| `/skills` | Lister les compétences disponibles |
|
||||||
|
|
@ -823,8 +821,6 @@ Ces commandes slash peuvent être envoyées dans n'importe quel canal de chat (T
|
||||||
| `/show model` | Afficher le modèle actuel |
|
| `/show model` | Afficher le modèle actuel |
|
||||||
| `/list channels` | Lister les canaux activés |
|
| `/list channels` | Lister les canaux activés |
|
||||||
|
|
||||||
> **Note** : `/todo` affiche le fichier `TODO.md` que l'IA maintient via ses outils `write_file`/`edit_file`. Demandez à l'IA d'ajouter, compléter ou organiser des tâches et elle mettra à jour le fichier automatiquement.
|
|
||||||
>
|
|
||||||
> **Note** : `/session` nécessite que la passerelle soit démarrée avec le flag `--stats`. Sans celui-ci, le suivi des statistiques est désactivé pour zéro surcharge.
|
> **Note** : `/session` nécessite que la passerelle soit démarrée avec le flag `--stats`. Sans celui-ci, le suivi des statistiques est désactivé pour zéro surcharge.
|
||||||
>
|
>
|
||||||
> **Note** : `/skills` répond instantanément sans coût LLM. `/skill <nom>` injecte le SKILL.md dans le contexte pour le tour en cours uniquement, puis seul le nom de la compétence est conservé dans l'historique pour économiser la fenêtre de contexte.
|
> **Note** : `/skills` répond instantanément sans coût LLM. `/skill <nom>` injecte le SKILL.md dans le contexte pour le tour en cours uniquement, puis seul le nom de la compétence est conservé dans l'historique pour économiser la fenêtre de contexte.
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,6 @@ PicoClaw は設定されたワークスペース(デフォルト: `~/.picoclaw
|
||||||
├── state/ # 永続状態(最後のチャネルなど)
|
├── state/ # 永続状態(最後のチャネルなど)
|
||||||
├── cron/ # スケジュールジョブデータベース
|
├── cron/ # スケジュールジョブデータベース
|
||||||
├── skills/ # カスタムスキル
|
├── skills/ # カスタムスキル
|
||||||
├── TODO.md # タスクリスト(AIが管理、/todo で表示)
|
|
||||||
├── AGENTS.md # エージェントの行動ガイド
|
├── AGENTS.md # エージェントの行動ガイド
|
||||||
├── HEARTBEAT.md # 定期タスクプロンプト(30分ごとに確認)
|
├── HEARTBEAT.md # 定期タスクプロンプト(30分ごとに確認)
|
||||||
├── IDENTITY.md # エージェントのアイデンティティ
|
├── IDENTITY.md # エージェントのアイデンティティ
|
||||||
|
|
@ -763,7 +762,6 @@ HEARTBEAT_OK 応答 ユーザーが直接結果を受け取る
|
||||||
| コマンド | 説明 |
|
| コマンド | 説明 |
|
||||||
|---------|------|
|
|---------|------|
|
||||||
| `/help` | 利用可能なコマンドを表示 |
|
| `/help` | 利用可能なコマンドを表示 |
|
||||||
| `/todo` | タスクリストを表示(`TODO.md` を読み取り) |
|
|
||||||
| `/session` | トークン使用量統計を表示(`--stats` が必要) |
|
| `/session` | トークン使用量統計を表示(`--stats` が必要) |
|
||||||
| `/session reset` | 使用量統計をリセット |
|
| `/session reset` | 使用量統計をリセット |
|
||||||
| `/skills` | 利用可能なスキルを一覧表示 |
|
| `/skills` | 利用可能なスキルを一覧表示 |
|
||||||
|
|
@ -771,8 +769,6 @@ HEARTBEAT_OK 応答 ユーザーが直接結果を受け取る
|
||||||
| `/show model` | 現在のモデルを表示 |
|
| `/show model` | 現在のモデルを表示 |
|
||||||
| `/list channels` | 有効なチャネルを一覧表示 |
|
| `/list channels` | 有効なチャネルを一覧表示 |
|
||||||
|
|
||||||
> **注意**: `/todo` は AI が `write_file`/`edit_file` ツールで管理する `TODO.md` を表示します。AI にタスクの追加・完了・整理を依頼すると、自動的にファイルが更新されます。
|
|
||||||
>
|
|
||||||
> **注意**: `/session` はゲートウェイを `--stats` フラグ付きで起動する必要があります。フラグなしではオーバーヘッドゼロで統計追跡は無効です。
|
> **注意**: `/session` はゲートウェイを `--stats` フラグ付きで起動する必要があります。フラグなしではオーバーヘッドゼロで統計追跡は無効です。
|
||||||
>
|
>
|
||||||
> **注意**: `/skills` は LLM コストゼロで即座に応答します。`/skill <名前>` はそのターンのみ SKILL.md をコンテキストに注入し、ターン完了後はスキル名のみ履歴に残してコンテキストウィンドウを節約します。
|
> **注意**: `/skills` は LLM コストゼロで即座に応答します。`/skill <名前>` はそのターンのみ SKILL.md をコンテキストに注入し、ターン完了後はスキル名のみ履歴に残してコンテキストウィンドウを節約します。
|
||||||
|
|
|
||||||
|
|
@ -485,7 +485,6 @@ PicoClaw stores data in your configured workspace (default: `~/.picoclaw/workspa
|
||||||
├── state/ # Persistent state (last channel, etc.)
|
├── state/ # Persistent state (last channel, etc.)
|
||||||
├── cron/ # Scheduled jobs database
|
├── cron/ # Scheduled jobs database
|
||||||
├── skills/ # Custom skills
|
├── skills/ # Custom skills
|
||||||
├── TODO.md # Task list (managed by AI, view with /todo)
|
|
||||||
├── AGENTS.md # Agent behavior guide
|
├── AGENTS.md # Agent behavior guide
|
||||||
├── HEARTBEAT.md # Periodic task prompts (checked every 30 min)
|
├── HEARTBEAT.md # Periodic task prompts (checked every 30 min)
|
||||||
├── IDENTITY.md # Agent identity
|
├── IDENTITY.md # Agent identity
|
||||||
|
|
@ -849,7 +848,6 @@ These slash commands can be sent in any chat channel (Telegram, Discord, etc.) a
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
| ----------------- | ------------------------------------------------ |
|
| ----------------- | ------------------------------------------------ |
|
||||||
| `/help` | Show available commands |
|
| `/help` | Show available commands |
|
||||||
| `/todo` | Show your task list (reads `TODO.md`) |
|
|
||||||
| `/session` | Show token usage statistics (requires `--stats`) |
|
| `/session` | Show token usage statistics (requires `--stats`) |
|
||||||
| `/session reset` | Reset usage statistics |
|
| `/session reset` | Reset usage statistics |
|
||||||
| `/skills` | List available skills |
|
| `/skills` | List available skills |
|
||||||
|
|
@ -857,8 +855,6 @@ These slash commands can be sent in any chat channel (Telegram, Discord, etc.) a
|
||||||
| `/show model` | Show current model |
|
| `/show model` | Show current model |
|
||||||
| `/list channels` | List enabled channels |
|
| `/list channels` | List enabled channels |
|
||||||
|
|
||||||
> **Note**: `/todo` displays the `TODO.md` file that the AI maintains via its `write_file`/`edit_file` tools. Ask the AI to add, complete, or organize tasks and it will update the file automatically.
|
|
||||||
>
|
|
||||||
> **Note**: `/session` requires the gateway to be started with `--stats` flag. Without it, stats tracking is disabled for zero overhead.
|
> **Note**: `/session` requires the gateway to be started with `--stats` flag. Without it, stats tracking is disabled for zero overhead.
|
||||||
>
|
>
|
||||||
> **Note**: `/skills` returns instantly without LLM cost. `/skill <name>` injects the skill's SKILL.md into the conversation context for the current turn, then only the skill name is kept in history to save the context window.
|
> **Note**: `/skills` returns instantly without LLM cost. `/skill <name>` injects the skill's SKILL.md into the conversation context for the current turn, then only the skill name is kept in history to save the context window.
|
||||||
|
|
|
||||||
|
|
@ -492,7 +492,6 @@ O PicoClaw armazena dados no workspace configurado (padrão: `~/.picoclaw/worksp
|
||||||
├── state/ # Estado persistente (ultimo canal, etc.)
|
├── state/ # Estado persistente (ultimo canal, etc.)
|
||||||
├── cron/ # Banco de dados de tarefas agendadas
|
├── cron/ # Banco de dados de tarefas agendadas
|
||||||
├── skills/ # Skills personalizadas
|
├── skills/ # Skills personalizadas
|
||||||
├── TODO.md # Lista de tarefas (gerenciada pela IA, veja com /todo)
|
|
||||||
├── AGENTS.md # Guia de comportamento do Agente
|
├── AGENTS.md # Guia de comportamento do Agente
|
||||||
├── HEARTBEAT.md # Prompts de tarefas periodicas (verificado a cada 30 min)
|
├── HEARTBEAT.md # Prompts de tarefas periodicas (verificado a cada 30 min)
|
||||||
├── IDENTITY.md # Identidade do Agente
|
├── IDENTITY.md # Identidade do Agente
|
||||||
|
|
@ -816,7 +815,6 @@ Estes comandos de barra podem ser enviados em qualquer canal de chat (Telegram,
|
||||||
| Comando | Descrição |
|
| Comando | Descrição |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `/help` | Mostrar comandos disponíveis |
|
| `/help` | Mostrar comandos disponíveis |
|
||||||
| `/todo` | Mostrar lista de tarefas (lê `TODO.md`) |
|
|
||||||
| `/session` | Mostrar estatísticas de uso de tokens (requer `--stats`) |
|
| `/session` | Mostrar estatísticas de uso de tokens (requer `--stats`) |
|
||||||
| `/session reset` | Resetar estatísticas de uso |
|
| `/session reset` | Resetar estatísticas de uso |
|
||||||
| `/skills` | Listar habilidades disponíveis |
|
| `/skills` | Listar habilidades disponíveis |
|
||||||
|
|
@ -824,8 +822,6 @@ Estes comandos de barra podem ser enviados em qualquer canal de chat (Telegram,
|
||||||
| `/show model` | Mostrar modelo atual |
|
| `/show model` | Mostrar modelo atual |
|
||||||
| `/list channels` | Listar canais habilitados |
|
| `/list channels` | Listar canais habilitados |
|
||||||
|
|
||||||
> **Nota**: `/todo` exibe o arquivo `TODO.md` que a IA mantém via ferramentas `write_file`/`edit_file`. Peça à IA para adicionar, completar ou organizar tarefas e ela atualizará o arquivo automaticamente.
|
|
||||||
>
|
|
||||||
> **Nota**: `/session` requer que o gateway seja iniciado com a flag `--stats`. Sem ela, o rastreamento de estatísticas é desabilitado para zero overhead.
|
> **Nota**: `/session` requer que o gateway seja iniciado com a flag `--stats`. Sem ela, o rastreamento de estatísticas é desabilitado para zero overhead.
|
||||||
>
|
>
|
||||||
> **Nota**: `/skills` responde instantaneamente sem custo LLM. `/skill <nome>` injeta o SKILL.md no contexto apenas para o turno atual, depois apenas o nome da habilidade é mantido no histórico para economizar a janela de contexto.
|
> **Nota**: `/skills` responde instantaneamente sem custo LLM. `/skill <nome>` injeta o SKILL.md no contexto apenas para o turno atual, depois apenas o nome da habilidade é mantido no histórico para economizar a janela de contexto.
|
||||||
|
|
|
||||||
|
|
@ -472,7 +472,6 @@ PicoClaw lưu trữ dữ liệu trong workspace đã cấu hình (mặc định:
|
||||||
├── state/ # Trạng thái lưu trữ (kênh cuối cùng, v.v.)
|
├── state/ # Trạng thái lưu trữ (kênh cuối cùng, v.v.)
|
||||||
├── cron/ # Cơ sở dữ liệu tác vụ định kỳ
|
├── cron/ # Cơ sở dữ liệu tác vụ định kỳ
|
||||||
├── skills/ # Kỹ năng tùy chỉnh
|
├── skills/ # Kỹ năng tùy chỉnh
|
||||||
├── TODO.md # Danh sách tác vụ (AI quản lý, xem với /todo)
|
|
||||||
├── AGENTS.md # Hướng dẫn hành vi Agent
|
├── AGENTS.md # Hướng dẫn hành vi Agent
|
||||||
├── HEARTBEAT.md # Prompt tác vụ định kỳ (kiểm tra mỗi 30 phút)
|
├── HEARTBEAT.md # Prompt tác vụ định kỳ (kiểm tra mỗi 30 phút)
|
||||||
├── IDENTITY.md # Danh tính Agent
|
├── IDENTITY.md # Danh tính Agent
|
||||||
|
|
@ -793,7 +792,6 @@ Các lệnh gạch chéo sau có thể gửi trong bất kỳ kênh chat nào (T
|
||||||
| Lệnh | Mô tả |
|
| Lệnh | Mô tả |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `/help` | Hiển thị các lệnh khả dụng |
|
| `/help` | Hiển thị các lệnh khả dụng |
|
||||||
| `/todo` | Hiển thị danh sách tác vụ (đọc `TODO.md`) |
|
|
||||||
| `/session` | Hiển thị thống kê sử dụng token (yêu cầu `--stats`) |
|
| `/session` | Hiển thị thống kê sử dụng token (yêu cầu `--stats`) |
|
||||||
| `/session reset` | Đặt lại thống kê sử dụng |
|
| `/session reset` | Đặt lại thống kê sử dụng |
|
||||||
| `/skills` | Liệt kê các kỹ năng khả dụng |
|
| `/skills` | Liệt kê các kỹ năng khả dụng |
|
||||||
|
|
@ -801,8 +799,6 @@ Các lệnh gạch chéo sau có thể gửi trong bất kỳ kênh chat nào (T
|
||||||
| `/show model` | Hiển thị mô hình hiện tại |
|
| `/show model` | Hiển thị mô hình hiện tại |
|
||||||
| `/list channels` | Liệt kê các kênh đã bật |
|
| `/list channels` | Liệt kê các kênh đã bật |
|
||||||
|
|
||||||
> **Lưu ý**: `/todo` hiển thị file `TODO.md` mà AI duy trì qua công cụ `write_file`/`edit_file`. Yêu cầu AI thêm, hoàn thành hoặc sắp xếp tác vụ và nó sẽ tự động cập nhật file.
|
|
||||||
>
|
|
||||||
> **Lưu ý**: `/session` yêu cầu gateway được khởi động với cờ `--stats`. Không có cờ này, theo dõi thống kê bị tắt để không có overhead.
|
> **Lưu ý**: `/session` yêu cầu gateway được khởi động với cờ `--stats`. Không có cờ này, theo dõi thống kê bị tắt để không có overhead.
|
||||||
>
|
>
|
||||||
> **Lưu ý**: `/skills` phản hồi ngay lập tức không tốn chi phí LLM. `/skill <tên>` chỉ đưa SKILL.md vào ngữ cảnh cho lượt hiện tại, sau đó chỉ giữ lại tên kỹ năng trong lịch sử để tiết kiệm cửa sổ ngữ cảnh.
|
> **Lưu ý**: `/skills` phản hồi ngay lập tức không tốn chi phí LLM. `/skill <tên>` chỉ đưa SKILL.md vào ngữ cảnh cho lượt hiện tại, sau đó chỉ giữ lại tên kỹ năng trong lịch sử để tiết kiệm cửa sổ ngữ cảnh.
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,6 @@ PicoClaw 将数据存储在您配置的工作区中(默认:`~/.picoclaw/work
|
||||||
├── state/ # 持久化状态 (最后一次频道等)
|
├── state/ # 持久化状态 (最后一次频道等)
|
||||||
├── cron/ # 定时任务数据库
|
├── cron/ # 定时任务数据库
|
||||||
├── skills/ # 自定义技能
|
├── skills/ # 自定义技能
|
||||||
├── TODO.md # 任务列表(AI 管理,/todo 查看)
|
|
||||||
├── AGENTS.md # Agent 行为指南
|
├── AGENTS.md # Agent 行为指南
|
||||||
├── HEARTBEAT.md # 周期性任务提示词 (每 30 分钟检查一次)
|
├── HEARTBEAT.md # 周期性任务提示词 (每 30 分钟检查一次)
|
||||||
├── IDENTITY.md # Agent 身份设定
|
├── IDENTITY.md # Agent 身份设定
|
||||||
|
|
@ -683,7 +682,6 @@ picoclaw agent -m "你好"
|
||||||
| 命令 | 描述 |
|
| 命令 | 描述 |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `/help` | 显示可用命令 |
|
| `/help` | 显示可用命令 |
|
||||||
| `/todo` | 显示任务列表(读取 `TODO.md`) |
|
|
||||||
| `/session` | 显示 Token 使用统计(需要 `--stats`) |
|
| `/session` | 显示 Token 使用统计(需要 `--stats`) |
|
||||||
| `/session reset` | 重置使用统计 |
|
| `/session reset` | 重置使用统计 |
|
||||||
| `/skills` | 列出可用技能 |
|
| `/skills` | 列出可用技能 |
|
||||||
|
|
@ -691,8 +689,6 @@ picoclaw agent -m "你好"
|
||||||
| `/show model` | 显示当前模型 |
|
| `/show model` | 显示当前模型 |
|
||||||
| `/list channels` | 列出已启用的频道 |
|
| `/list channels` | 列出已启用的频道 |
|
||||||
|
|
||||||
> **注意**: `/todo` 显示 AI 通过 `write_file`/`edit_file` 工具维护的 `TODO.md` 文件。让 AI 添加、完成或整理任务,它会自动更新文件。
|
|
||||||
>
|
|
||||||
> **注意**: `/session` 需要使用 `--stats` 标志启动网关。未启用时统计跟踪被禁用,零开销。
|
> **注意**: `/session` 需要使用 `--stats` 标志启动网关。未启用时统计跟踪被禁用,零开销。
|
||||||
>
|
>
|
||||||
> **注意**: `/skills` 即时响应,不消耗 LLM Token。`/skill <名称>` 仅在当前轮次将 SKILL.md 注入上下文,轮次结束后仅保留技能名称以节省上下文窗口。
|
> **注意**: `/skills` 即时响应,不消耗 LLM Token。`/skill <名称>` 仅在当前轮次将 SKILL.md 注入上下文,轮次结束后仅保留技能名称以节省上下文窗口。
|
||||||
|
|
|
||||||
|
|
@ -71,17 +71,9 @@ Your workspace is at: %s
|
||||||
- Memory: %s/memory/MEMORY.md
|
- Memory: %s/memory/MEMORY.md
|
||||||
- Daily Notes: %s/memory/YYYYMM/YYYYMMDD.md
|
- Daily Notes: %s/memory/YYYYMM/YYYYMMDD.md
|
||||||
- Skills: %s/skills/{skill-name}/SKILL.md
|
- Skills: %s/skills/{skill-name}/SKILL.md
|
||||||
- Task List: %s/TODO.md
|
|
||||||
|
|
||||||
%s
|
%s
|
||||||
|
|
||||||
## Task Management
|
|
||||||
When users ask you to track tasks, reminders, or to-do items, maintain a TODO.md file in your workspace using write_file or edit_file.
|
|
||||||
Use standard markdown checkbox format:
|
|
||||||
- [ ] Pending task
|
|
||||||
- [x] Completed task
|
|
||||||
Group tasks by category when there are many. The user can view this list anytime with /todo.
|
|
||||||
|
|
||||||
## Important Rules
|
## Important Rules
|
||||||
|
|
||||||
1. **ALWAYS use tools** - When you need to perform an action (schedule reminders, send messages, execute commands, etc.), you MUST call the appropriate tool. Do NOT just say you'll do it or pretend to do it.
|
1. **ALWAYS use tools** - When you need to perform an action (schedule reminders, send messages, execute commands, etc.), you MUST call the appropriate tool. Do NOT just say you'll do it or pretend to do it.
|
||||||
|
|
@ -89,7 +81,7 @@ Group tasks by category when there are many. The user can view this list anytime
|
||||||
2. **Be helpful and accurate** - When using tools, briefly explain what you're doing.
|
2. **Be helpful and accurate** - When using tools, briefly explain what you're doing.
|
||||||
|
|
||||||
3. **Memory** - When remembering something, write to %s/memory/MEMORY.md`,
|
3. **Memory** - When remembering something, write to %s/memory/MEMORY.md`,
|
||||||
now, runtime, workspacePath, workspacePath, workspacePath, workspacePath, workspacePath, toolsSection, workspacePath)
|
now, runtime, workspacePath, workspacePath, workspacePath, workspacePath, toolsSection, workspacePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cb *ContextBuilder) buildToolsSection() string {
|
func (cb *ContextBuilder) buildToolsSection() string {
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"github.com/sipeed/picoclaw/pkg/bus"
|
"github.com/sipeed/picoclaw/pkg/bus"
|
||||||
"github.com/sipeed/picoclaw/pkg/channels"
|
"github.com/sipeed/picoclaw/pkg/channels"
|
||||||
"github.com/sipeed/picoclaw/pkg/config"
|
"github.com/sipeed/picoclaw/pkg/config"
|
||||||
|
|
@ -157,7 +154,7 @@ func (al *AgentLoop) Run(ctx context.Context) error {
|
||||||
al.running.Store(true)
|
al.running.Store(true)
|
||||||
|
|
||||||
// LLM work is dispatched to a background worker so the main loop
|
// LLM work is dispatched to a background worker so the main loop
|
||||||
// stays free to handle slash commands (/todo, /skills, …) instantly,
|
// stays free to handle slash commands (/skills, …) instantly,
|
||||||
// even while a long tool-call chain is running.
|
// even while a long tool-call chain is running.
|
||||||
llmQueue := make(chan bus.InboundMessage, 10)
|
llmQueue := make(chan bus.InboundMessage, 10)
|
||||||
workerDone := make(chan struct{})
|
workerDone := make(chan struct{})
|
||||||
|
|
@ -1250,9 +1247,6 @@ func (al *AgentLoop) handleCommand(ctx context.Context, msg bus.InboundMessage)
|
||||||
return fmt.Sprintf("Unknown switch target: %s", target), true
|
return fmt.Sprintf("Unknown switch target: %s", target), true
|
||||||
}
|
}
|
||||||
|
|
||||||
case "/todo":
|
|
||||||
return al.handleTodoCommand(), true
|
|
||||||
|
|
||||||
case "/session":
|
case "/session":
|
||||||
return al.handleSessionCommand(args), true
|
return al.handleSessionCommand(args), true
|
||||||
|
|
||||||
|
|
@ -1263,25 +1257,6 @@ func (al *AgentLoop) handleCommand(ctx context.Context, msg bus.InboundMessage)
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleTodoCommand reads TODO.md from the workspace and returns its contents.
|
|
||||||
func (al *AgentLoop) handleTodoCommand() string {
|
|
||||||
agent := al.registry.GetDefaultAgent()
|
|
||||||
if agent == nil {
|
|
||||||
return "No agent configured."
|
|
||||||
}
|
|
||||||
|
|
||||||
todoPath := filepath.Join(agent.Workspace, "TODO.md")
|
|
||||||
data, err := os.ReadFile(todoPath)
|
|
||||||
if err != nil || len(strings.TrimSpace(string(data))) == 0 {
|
|
||||||
return "No tasks yet. Ask me to add a task and I'll maintain a TODO list for you."
|
|
||||||
}
|
|
||||||
content := string(data)
|
|
||||||
content = strings.ReplaceAll(content, "- [x] ", "✅ ")
|
|
||||||
content = strings.ReplaceAll(content, "- [X] ", "✅ ")
|
|
||||||
content = strings.ReplaceAll(content, "- [ ] ", "⬜ ")
|
|
||||||
return content
|
|
||||||
}
|
|
||||||
|
|
||||||
// handleSessionCommand returns usage statistics or resets them.
|
// handleSessionCommand returns usage statistics or resets them.
|
||||||
func (al *AgentLoop) handleSessionCommand(args []string) string {
|
func (al *AgentLoop) handleSessionCommand(args []string) string {
|
||||||
if al.stats == nil {
|
if al.stats == nil {
|
||||||
|
|
|
||||||
|
|
@ -835,7 +835,7 @@ func TestSlashCommandResponseSkipsPlaceholder(t *testing.T) {
|
||||||
Channel: "telegram",
|
Channel: "telegram",
|
||||||
SenderID: "user1",
|
SenderID: "user1",
|
||||||
ChatID: "chat1",
|
ChatID: "chat1",
|
||||||
Content: "/todo",
|
Content: "/skills",
|
||||||
})
|
})
|
||||||
|
|
||||||
// Read the outbound message
|
// Read the outbound message
|
||||||
|
|
|
||||||
|
|
@ -434,7 +434,7 @@ func (c *TelegramChannel) handleMessage(ctx context.Context, message *telego.Mes
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleQuickCommand processes commands that don't need an LLM call (e.g. /todo, /session).
|
// handleQuickCommand processes commands that don't need an LLM call (e.g. /session).
|
||||||
// Unlike handleMessage, it skips the "Thinking..." placeholder for instant response.
|
// Unlike handleMessage, it skips the "Thinking..." placeholder for instant response.
|
||||||
func (c *TelegramChannel) handleQuickCommand(ctx context.Context, message telego.Message) error {
|
func (c *TelegramChannel) handleQuickCommand(ctx context.Context, message telego.Message) error {
|
||||||
if message.From == nil {
|
if message.From == nil {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ func (c *cmd) Help(ctx context.Context, message telego.Message) error {
|
||||||
/help - Show this help message
|
/help - Show this help message
|
||||||
/show [model|channel] - Show current configuration
|
/show [model|channel] - Show current configuration
|
||||||
/list [models|channels] - List available options
|
/list [models|channels] - List available options
|
||||||
/todo - Show your task list
|
|
||||||
/session - Show usage statistics
|
/session - Show usage statistics
|
||||||
/skills - List available skills
|
/skills - List available skills
|
||||||
/skill <name> [message] - Invoke a skill
|
/skill <name> [message] - Invoke a skill
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue