Skip to content

Conversation

@ferdinandyb
Copy link

Add block containing provider, model, and OpenCode version information to the system prompt. This allows the assistant to know which model it's running as and the current OpenCode version.

Models usually have no idea about themselves, so cannot reference themselves properly or introspect what's going on with the agent. Insert a few extra tokens into the prompt, so that it is more self-aware.

@ferdinandyb
Copy link
Author

const provider = model ? await Provider.getProvider(model.providerID) : undefined
return [
[
`Here is some useful information about the environment you are running in:`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should prolly put this as a first line in the system prompt rather than in environment section.

It should be something like:

You are running in

Copy link
Author

Choose a reason for hiding this comment

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

Would that mean that each model's file would need to have a template expanded e.g like /session/prompt/anthropic.txt ? That seems to be the first line (well, anthropic_spoof for anthropic). Why are these system prompts so different actually? Are they mostly the original systemprompts tweaked a bit?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of templating id just harcode the first sentence and remove it from all the prompts. But you could template if its easier to integrate in

Uh they are all different cause diff models need diff instructions and mostly driven from the main labs and the prompts they use with tweaks for our harness as needed

Copy link
Author

Choose a reason for hiding this comment

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

@rekram1-node looking at the model specific version, it's very inconsistent how the opencodeness is handled, some have instruction where to look for opencode specific stuff in detail, others just meantion it's opencode and open source.

I've pushed a new implementation injecting a new line, but maybe it would be worth to standardize the OpenCode related info there from all the models? Or those should be left as-is, because that's how the big models expect their prompts?

Prepend assistant info line between header and agent prompt so models
know what they are and what version of OpenCode they're running in.

Format: "You are {name} ({provider}: {id}) running in OpenCode v{version},
the best coding agent on the planet."
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.

2 participants