feat: add collab prompt (#9208)
Adding a prompt for collab tools. This is only for internal use and the prompt won't be gated for now as it is not stable yet. The goal of this PR is to provide the tool required to iterate on the prompt
This commit is contained in:
parent
6a939ed7a4
commit
3d322fa9d8
2 changed files with 31 additions and 1 deletions
|
|
@ -539,12 +539,24 @@ impl Session {
|
|||
features: &per_turn_config.features,
|
||||
});
|
||||
|
||||
let base_instructions = if per_turn_config.features.enabled(Feature::Collab) {
|
||||
const COLLAB_INSTRUCTIONS: &str =
|
||||
include_str!("../templates/collab/experimental_prompt.md");
|
||||
let base = session_configuration
|
||||
.base_instructions
|
||||
.as_deref()
|
||||
.unwrap_or(model_info.base_instructions.as_str());
|
||||
Some(format!("{base}\n\n{COLLAB_INSTRUCTIONS}"))
|
||||
} else {
|
||||
session_configuration.base_instructions.clone()
|
||||
};
|
||||
|
||||
TurnContext {
|
||||
sub_id,
|
||||
client,
|
||||
cwd: session_configuration.cwd.clone(),
|
||||
developer_instructions: session_configuration.developer_instructions.clone(),
|
||||
base_instructions: session_configuration.base_instructions.clone(),
|
||||
base_instructions,
|
||||
compact_prompt: session_configuration.compact_prompt.clone(),
|
||||
user_instructions: session_configuration.user_instructions.clone(),
|
||||
approval_policy: session_configuration.approval_policy.value(),
|
||||
|
|
|
|||
18
codex-rs/core/templates/collab/experimental_prompt.md
Normal file
18
codex-rs/core/templates/collab/experimental_prompt.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
## Multi agents
|
||||
You have the possibility to spawn and user other agents to complete a task. For example, this can be use for:
|
||||
* Very large tasks with multiple well-defined scopes
|
||||
* When you want a review from another agent. This can review your own work or the work of another agent.
|
||||
* If you need to interact with another agent to debate an idea and have insight from a fresh context
|
||||
* To run and fix tests in a dedicated agent in order to optimize your own resources.
|
||||
|
||||
This feature must be used wisely. For simple or straightforward tasks, you don't need to spawn a new agent.
|
||||
|
||||
**General comments:**
|
||||
* When spawning multiple agents, you must tell them that they are not alone in the environment so they should not impact/revert the work of others.
|
||||
* Running tests or some config commands can output a large amount of logs. In order to optimize your own context, you can spawn an agent and ask it to do it for you. In such cases, you must tell this agent that it can't spawn another agent himself (to prevent infinite recursion)
|
||||
* When you're done with a sub-agent, don't forget to close it using `close_agent`.
|
||||
* Be careful on the `timeout_ms` parameter you choose for `wait`. It should be wisely scaled.
|
||||
* Sub-agents have access to the same set of tools as you do so you must tell them if they are allowed to spawn sub-agents themselves or not.
|
||||
|
||||
## Global
|
||||
You're name is Batman
|
||||
Loading…
Add table
Reference in a new issue