Extend SecretsManager, agent loop, and CLI commands#66
Open
warengonzaga wants to merge 8 commits intodevfrom
Open
Extend SecretsManager, agent loop, and CLI commands#66warengonzaga wants to merge 8 commits intodevfrom
warengonzaga wants to merge 8 commits intodevfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves plugin setup reliability and observability by enhancing the agent loop’s plugin-setup guidance and tool execution flow (including auto-restart after pairing), adding Discord runtime status tracking, and extending secrets management with a destroy operation (plus CLI recovery/purge behavior and tests).
Changes:
- Add “Plugin Setup Guidance” to the agent loop prompt, generate natural replies after tool usage, and auto-run
tinyclaw_restartafter successful*_pair/*_unpairtools. - Add Discord plugin runtime status (
getDiscordRuntimeStatus) and expose it via a newdiscord_statusruntime tool in the CLI. - Extend SecretsManager with
destroy()and improve purge/recovery flows with added tests.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cli/tests/purge.test.ts | Adds coverage for purge fallback when secrets store is corrupt. |
| src/cli/tests/commands/start.test.ts | Tests discord_status tool registration and output scenarios. |
| src/cli/src/utils/secrets.ts | Centralizes secrets path resolution and integrity recovery messaging. |
| src/cli/src/commands/start.ts | Uses new secrets integrity helpers; registers discord_status tool. |
| src/cli/src/commands/setup.ts | Adds integrity-error handling and recovery guidance during setup. |
| src/cli/src/commands/setup-web.ts | Adds integrity-error handling and recovery guidance during web setup. |
| src/cli/src/commands/purge.ts | Adds secrets-engine-aware purge (destroy + fallback) and Windows-friendly deletion retry. |
| plugins/channel/plugin-channel-discord/tests/index.test.ts | Verifies runtime status accessor is exposed. |
| plugins/channel/plugin-channel-discord/src/pairing.ts | Updates pairing tool description to guide token creation steps. |
| plugins/channel/plugin-channel-discord/src/index.ts | Implements Discord runtime status tracking and accessor. |
| packages/types/src/index.ts | Extends SecretsManager interface with destroy(). |
| packages/secrets/src/secrets-engine.d.ts | Updates secrets-engine typings to include destroy(). |
| packages/secrets/src/manager.ts | Implements SecretsManager destroy() by delegating to the engine. |
| packages/core/tests/loop.test.ts | Adds tests for plugin setup prompt injection, natural replies, and auto-restart behavior. |
| packages/core/src/loop.ts | Adds plugin setup guidance, tool-result-to-natural-reply flow, and auto-restart after pairing tools. |
Owner
Author
|
@copilot apply changes based on the comments in this thread and reply to each of the comments. |
…tion, and error state readyTag Agent-Logs-Url: https://github.com/warengonzaga/tinyclaw/sessions/eb1b6ce1-d1b7-4f02-aec2-673c9274380d Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
…art guard Agent-Logs-Url: https://github.com/warengonzaga/tinyclaw/sessions/eb1b6ce1-d1b7-4f02-aec2-673c9274380d Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
Contributor
All four review comments addressed in commits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several important improvements to plugin setup, tool execution, and plugin status tracking, with a focus on better user guidance and robust handling of plugin pairing and restarts. It also adds new tests to ensure these behaviors. The main changes are grouped as follows:
Plugin Setup Guidance and Agent Loop Enhancements:
agentLoop, ensuring the agent walks users through plugin setup step by step and never claims a plugin is active unless pairing and restart are complete.agentLoopto automatically trigger a restart (via thetinyclaw_restarttool) after successful pairing tools (like*_pair), and ensures the agent's reply is natural and conversational, summarizing all tool results. [1] [2] [3] [4] [5]Discord Plugin Status Tracking:
getDiscordRuntimeStatus) in the Discord channel plugin, tracking enabled state, connection state, errors, and ready tag, and updates this status throughout the plugin lifecycle. [1] [2] [3] [4] [5]Tool and Secrets Management Improvements:
destroy()method to theSecretsManagerinterface and implementation, allowing permanent destruction of the secrets store. [1] [2]Testing:
Other:
StreamEventandToolwhere needed.These changes collectively improve the reliability, transparency, and user experience of plugin setup and management, while ensuring robust test coverage for new behaviors.