Skip to content

feat(core): add ability to have custom system prompt#73

Merged
ElasticBottle merged 4 commits intomainfrom
winston/add-ability-to-create-system-prompt-override
Aug 12, 2025
Merged

feat(core): add ability to have custom system prompt#73
ElasticBottle merged 4 commits intomainfrom
winston/add-ability-to-create-system-prompt-override

Conversation

@ElasticBottle
Copy link
Contributor

No description provided.

@ElasticBottle ElasticBottle changed the title Winston/add ability to create system prompt override feat(core): add ability to have customer system prompt Aug 12, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 12, 2025

Open in StackBlitz

@trymeka/ai-provider-vercel

pnpm add https://pkg.pr.new/trymeka/agent/@trymeka/ai-provider-vercel@73

@trymeka/computer-provider-anchor-browser

pnpm add https://pkg.pr.new/trymeka/agent/@trymeka/computer-provider-anchor-browser@73

@trymeka/computer-provider-core

pnpm add https://pkg.pr.new/trymeka/agent/@trymeka/computer-provider-core@73

@trymeka/computer-provider-e2b

pnpm add https://pkg.pr.new/trymeka/agent/@trymeka/computer-provider-e2b@73

@trymeka/computer-provider-scrapybara

pnpm add https://pkg.pr.new/trymeka/agent/@trymeka/computer-provider-scrapybara@73

@trymeka/core

pnpm add https://pkg.pr.new/trymeka/agent/@trymeka/core@73

commit: 8a3e1f0

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces the ability to override the default system prompt in the Meka agent framework while simultaneously standardizing type definitions across the codebase. The main feature addition is a new optional createSystemPrompt parameter in the createAgent function that allows developers to provide custom system prompts for their agents.

The implementation follows a clean pattern where the custom prompt function receives screen size information and returns a string. If no custom prompt is provided, the agent falls back to the default SYSTEM_PROMPT function, ensuring full backward compatibility. The PR includes a practical example (custom-system-prompt.ts) that demonstrates how to create an agent that prioritizes system instructions over user requests.

Alongside this feature, the PR performs important type system improvements by extracting an inline screen size type definition into a reusable ScreenSize interface. This new interface is then consistently used across all computer providers (Anchor Browser, Scrapybara, E2B) and the system prompt logic, replacing previous inline type definitions like { width: number; height: number; }. This refactoring improves code maintainability, reduces duplication, and ensures type consistency throughout the framework.

The changes integrate seamlessly with the existing codebase architecture, where computer providers supply screen dimensions that are used for context-aware prompt generation. The system prompt customization capability enables use cases like domain-specific agent behavior, custom safety constraints, or specialized operational guidelines that cannot be achieved through the standard system prompt alone.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it maintains full backward compatibility and follows established patterns
  • Score reflects well-structured implementation with proper type safety, comprehensive example documentation, and no breaking changes to existing functionality
  • No files require special attention as all changes are straightforward type improvements and clean feature additions

Context used:

Rule - Try to find real bugs instead of nit picking on small style issues. We are moving fast and trying to make sure things work. (link)

8 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@ElasticBottle ElasticBottle changed the title feat(core): add ability to have customer system prompt feat(core): add ability to have custom system prompt Aug 12, 2025
@ElasticBottle ElasticBottle merged commit b0467db into main Aug 12, 2025
4 checks passed
@ElasticBottle ElasticBottle deleted the winston/add-ability-to-create-system-prompt-override branch August 12, 2025 15:43
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