Skip to content

docs: add appendContext to plugin hook docs#208

Open
dgarson wants to merge 1 commit intomainfrom
sandy/docs-appendcontext-hooks-main
Open

docs: add appendContext to plugin hook docs#208
dgarson wants to merge 1 commit intomainfrom
sandy/docs-appendcontext-hooks-main

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Mar 3, 2026

Summary

  • update docs/concepts/agent-loop.md to include appendContext for before_prompt_build
  • expand plugin hook docs with prompt-shaping return fields (prependContext, appendContext, systemPrompt)
  • note concatenation behavior when multiple hooks return context fields

Context

Code support for appendContext was added in a777c05.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fd6517625

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

`before_prompt_build` (and legacy `before_agent_start`) can return:

- `prependContext`: text inserted **before** the user prompt
- `appendContext`: text inserted **after** the user prompt

Choose a reason for hiding this comment

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

P2 Badge Remove unsupported appendContext from hook return docs

The new docs state that before_prompt_build/before_agent_start can return appendContext, but current hook contracts and merge logic only handle prependContext and systemPrompt (src/plugins/types.ts has no appendContext field, and src/plugins/hooks.ts only merges prependContext). In this state, plugin authors who follow this guidance will return appendContext values that are ignored at runtime, causing prompt-shaping behavior to differ from what the documentation promises.

Useful? React with 👍 / 👎.

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