Skip to content

Add per-run system prompt extension hook - #597

Open
KirschBluteX wants to merge 1 commit into
huggingface:mainfrom
KirschBluteX:codex/issue-532-system-prompt-hook
Open

Add per-run system prompt extension hook#597
KirschBluteX wants to merge 1 commit into
huggingface:mainfrom
KirschBluteX:codex/issue-532-system-prompt-hook

Conversation

@KirschBluteX

@KirschBluteX KirschBluteX commented Aug 17, 2026

Copy link
Copy Markdown

Summary

  • Add a before_agent_start extension hook that chains run-scoped system prompt replacements in registration order.
  • Pass the final prompt through a keyword-only AgentHarness run argument so initial, tool-loop, and overflow-retry requests share it while the configured base prompt and transcript stay unchanged.
  • Expose frozen, repr-hidden prompt inputs without skill content, and document the hook with a tested packaged example and release note.

Handler exceptions and invalid returns are diagnosed and skipped, so later handlers still run. Static prompt guidelines remain supported and are included in the structured input snapshot. Reload and session replacement refresh that snapshot without persisting run-specific replacements.

The branch is rebased onto the current main release head (62eab4e).

Verification

Current-head checks run in this workspace:

  • uv run pytest tests/test_extensions.py -k "before_agent_start or per_run_system_prompt or prompt_guideline" (4 passed)
  • uv run pytest tests/test_agent_harness.py -k "system_override or teardown_base_exception" (2 passed)
  • uv run pytest tests/test_example_extensions.py tests/test_package_metadata.py (18 passed)
  • uv run ruff check .
  • uv run ruff format --check --no-cache .
  • git diff --check
  • Pagefind 1.5.2 indexed 28 website pages.

The full Windows pytest run reaches only existing platform-specific failures (path casing, POSIX shell commands, file permissions, and TUI sizing); the feature-focused tests pass. Hugo and a Linux runtime are unavailable in this workspace, so the earlier Linux baseline (1533 passed, 3 skipped) is historical pre-rebase evidence rather than a current-head claim. uv run mypy reaches only the existing Windows-only fcntl diagnostics in src/tau_coding/project_trust.py.

Closes #532

@KirschBluteX
KirschBluteX force-pushed the codex/issue-532-system-prompt-hook branch from d7e7018 to 54a2dda Compare August 18, 2026 01:27
@KirschBluteX
KirschBluteX force-pushed the codex/issue-532-system-prompt-hook branch from 37ae32b to a151f0e Compare August 22, 2026 04:49
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.

Allow extensions to override the system prompt per agent run

1 participant