Skip to content

Fix: Restore visibility of tool execution output #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ mycoder "Implement a React component that displays a list of items"
# Run with a prompt from a file
mycoder -f prompt.txt

# Enable interactive corrections during execution (press Ctrl+M to send corrections)
mycoder --interactive "Implement a React component that displays a list of items"

# Disable user prompts for fully automated sessions
mycoder --userPrompt false "Generate a basic Express.js server"

Expand Down Expand Up @@ -98,7 +101,7 @@ export default {

// Base URL configuration (for providers that need it)
baseUrl: 'http://localhost:11434', // Example for Ollama

// MCP configuration
mcp: {
servers: [
Expand All @@ -119,6 +122,35 @@ export default {

CLI arguments will override settings in your configuration file.

## Interactive Corrections

MyCoder supports sending corrections to the main agent while it's running. This is useful when you notice the agent is going off track or needs additional information.

### Usage

1. Start MyCoder with the `--interactive` flag:
```bash
mycoder --interactive "Implement a React component"
```

2. While the agent is running, press `Ctrl+M` to enter correction mode
3. Type your correction or additional context
4. Press Enter to send the correction to the agent

The agent will receive your message and incorporate it into its decision-making process, similar to how parent agents can send messages to sub-agents.

### Configuration

You can enable interactive corrections in your configuration file:

```js
// mycoder.config.js
export default {
// ... other options
interactive: true,
};
```

### GitHub Comment Commands

MyCoder can be triggered directly from GitHub issue comments using the flexible `/mycoder` command:
Expand Down Expand Up @@ -182,4 +214,4 @@ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute t

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
83 changes: 0 additions & 83 deletions docs/github-comment-commands.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/release-process.md

This file was deleted.

130 changes: 0 additions & 130 deletions docs/tools/agent-tools.md

This file was deleted.

17 changes: 12 additions & 5 deletions packages/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,36 @@ MyCoder Agent supports the Model Context Protocol:
## Available Tools

### File & Text Manipulation

- **textEditor**: View, create, and edit files with persistent state
- Commands: view, create, str_replace, insert, undo_edit
- Line number support and partial file viewing

### System Interaction

- **shellStart**: Execute shell commands with sync/async modes
- **shellMessage**: Interact with running shell processes
- **shellExecute**: One-shot shell command execution
- **listShells**: List all running shell processes

### Agent Management

- **agentStart**: Create sub-agents for parallel tasks
- **agentMessage**: Send messages to sub-agents
- **agentMessage**: Send messages to sub-agents and retrieve their output (including captured logs)
- **agentDone**: Complete the current agent's execution
- **listAgents**: List all running agents

The agent system automatically captures log, warn, and error messages from agents and their immediate tools, which are included in the output returned by agentMessage.

### Network & Web

- **fetch**: Make HTTP requests to APIs
- **sessionStart**: Start browser automation sessions
- **sessionMessage**: Control browser sessions (navigation, clicking, typing)
- **listSessions**: List all browser sessions

### Utility Tools

- **sleep**: Pause execution for a specified duration
- **userPrompt**: Request input from the user

Expand Down Expand Up @@ -145,10 +152,10 @@ const tools = [textEditorTool, shellStartTool];

// Run the agent
const result = await toolAgent(
"Write a simple Node.js HTTP server and save it to server.js",
'Write a simple Node.js HTTP server and save it to server.js',
tools,
{
getSystemPrompt: () => "You are a helpful coding assistant...",
getSystemPrompt: () => 'You are a helpful coding assistant...',
maxIterations: 10,
},
{
Expand All @@ -157,7 +164,7 @@ const result = await toolAgent(
model: 'claude-3-opus-20240229',
apiKey: process.env.ANTHROPIC_API_KEY,
workingDirectory: process.cwd(),
}
},
);

console.log('Agent result:', result);
Expand All @@ -169,4 +176,4 @@ We welcome contributions! Please see our [CONTRIBUTING.md](../CONTRIBUTING.md) f

## License

MIT
MIT
2 changes: 1 addition & 1 deletion packages/agent/src/core/toolAgent/toolAgentCore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('toolAgentCore empty response detection', () => {
const fileContent = `
if (!text.length && toolCalls.length === 0) {
// Only consider it empty if there's no text AND no tool calls
logger.verbose('Received truly empty response from agent (no text and no tool calls), sending reminder');
logger.debug('Received truly empty response from agent (no text and no tool calls), sending reminder');
messages.push({
role: 'user',
content: [
Expand Down
Loading
Loading