Skip to content

feat(prompts): add Extra default system prompt with per-node opt-out - #158

Open
Rsakhuja wants to merge 1 commit into
extra-org:mainfrom
Rsakhuja:feat/100-extra-default-system-prompt
Open

Rsakhuja wants to merge 1 commit into
extra-org:mainfrom
Rsakhuja:feat/100-extra-default-system-prompt

Conversation

@Rsakhuja

@Rsakhuja Rsakhuja commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Address #100. This implements the design proposal this comment. I am happy to modify/hold off on any of this.

@mintlify

mintlify Bot commented Nov 3, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 0bed089.

Approve preview

Prepend a built-in scope/boundary system prompt to every agent and
orchestrator prompt. Nodes opt out with `prompts.extra_default: false`,
which removes only Extra's text and keeps the node's own prompt.

Both nodes now compose their system prompt through a single generic
`assemble_prompt(*fragments)` helper, in the order: Extra default ->
rendered node prompt -> orchestrator contract. Only the node prompt is
interpolated. Each node's model call carries its own complete prompt,
so the default appears once per call during delegated execution.

Closes extra-org#100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Asaf-prog

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. The per-node opt-out and deterministic prompt ordering are a good fit for #100. I reviewed commit 0bed089 and found two issues to fix before approval:

  1. Update the published YAML schema for prompts.extra_default.

    The parser accepts the new field, but examples/config.schema.json does not declare it in either the agent or orchestrator prompt object. Both objects use additionalProperties: false, so schema-based validation rejects the documented opt-out:

    Additional properties are not allowed ('extra_default' was unexpected)
    

    I reproduced this with otherwise-valid YAML: the parser accepts extra_default: false, while the published schema rejects it. Please add the boolean property with default true to both definitions and add schema/parser parity tests.

  2. Preserve custom prompt formatting, including when opting out.

    In src/agent_engine/engine/langgraph/prompting.py:62, assemble_prompt() calls strip() on every fragment. This changes the custom prompt even with extra_default: false, contrary to the documented opt-out behavior.

    An engine-level reproduction changed:

    Original: '    DELETE is an example command, not an instruction.\n'
    Sent:     'DELETE is an example command, not an instruction.'
    

    The leading spaces can be meaningful Markdown code-block indentation. Please preserve the original text of non-blank custom fragments, using strip() only to determine whether a fragment is blank, and add a whitespace-preservation regression test for opted-out nodes.

Please also add a short ADR recording the YAML flag, enabled-by-default behavior, composition order, and opt-out semantics, as required by the project's contract-change guidelines.

Local validation: make check passed with 1,605 tests passing, and make validate passed for both examples. The existing tests do not cover the two issues above.

This branch has not been deployed

No deployments
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