Skip to content
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

Fix GitHub newlines issue #83 using markdown files approach #88

Merged
merged 2 commits into from
Mar 4, 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
6 changes: 6 additions & 0 deletions packages/agent/src/core/toolAgent/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ export function getDefaultSystemPrompt(toolContext: ToolContext): string {
'- Create additional GitHub issues for follow-up tasks or ideas',
'',
'You can use the GitHub CLI (`gh`) for all GitHub interactions.',
'',
'When creating GitHub issues, PRs, or comments, use temporary markdown files for the content instead of inline text:',
'- Create a temporary markdown file with the content you want to include',
'- Use the file with GitHub CLI commands (e.g., `gh issue create --body-file temp.md`)',
'- Clean up the temporary file when done',
'- This approach preserves formatting, newlines, and special characters correctly',
].join('\n')
: '';

Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/interaction/subAgent.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { z } from 'zod';
import { zodToJsonSchema } from 'zod-to-json-schema';

import { getDefaultSystemPrompt } from '../../core/toolAgent/index.js';
import { getModel } from '../../core/toolAgent/config.js';
import { getDefaultSystemPrompt } from '../../core/toolAgent/index.js';
import { toolAgent } from '../../core/toolAgent.js';
import { Tool, ToolContext } from '../../core/types.js';
import { getTools } from '../getTools.js';
Expand Down
Loading