Skip to content

feat: give codex system prompt via personality#1482

Merged
k11kirky merged 1 commit intomainfrom
04-03-feat_give_codex_system_prompt_via_personality
Apr 6, 2026
Merged

feat: give codex system prompt via personality#1482
k11kirky merged 1 commit intomainfrom
04-03-feat_give_codex_system_prompt_via_personality

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

@k11kirky k11kirky commented Apr 3, 2026

Problem

The Codex adapter was not receiving custom instructions/system prompts, and token usage tracking was incomplete, limiting its ability to follow user-specific guidance and provide accurate usage metrics during task execution.

Changes

  • Added instructions parameter to TaskExecutionOptions and CodexProcessOptions interfaces
  • Modified the Codex spawn logic to pass instructions as a configuration parameter with proper escaping for backslashes and quotes
  • Moved system prompt building earlier in the agent service to make it available during initial connection setup
  • Enhanced token usage tracking in the Codex adapter to accumulate usage across prompts and emit turn completion notifications
  • Updated the Codex client to track per-message token usage including cached read/write tokens
  • Added proper usage accumulation in session state for comprehensive token tracking

How did you test this?

I wont lie, i didnt test this more than a quick test prompt. trust the agents bro

@k11kirky k11kirky marked this pull request as ready for review April 3, 2026 12:27
@k11kirky k11kirky force-pushed the 04-03-feat_give_codex_system_prompt_via_personality branch from 6ccbf64 to d04efd4 Compare April 3, 2026 12:46
@k11kirky k11kirky force-pushed the 04-03-feat_give_codex_system_prompt_via_personality branch from d04efd4 to 976a8df Compare April 6, 2026 21:16
@k11kirky k11kirky force-pushed the 04-03-feat_clean_up_session_reloadin branch from fe3f90f to 9e67ff2 Compare April 6, 2026 21:16
Copy link
Copy Markdown
Contributor Author

k11kirky commented Apr 6, 2026

Merge activity

  • Apr 6, 9:47 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 6, 10:07 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 6, 10:14 PM UTC: @k11kirky merged this pull request with Graphite.

@k11kirky k11kirky changed the base branch from 04-03-feat_clean_up_session_reloadin to graphite-base/1482 April 6, 2026 21:57
@k11kirky k11kirky changed the base branch from graphite-base/1482 to main April 6, 2026 22:06
@k11kirky k11kirky force-pushed the 04-03-feat_give_codex_system_prompt_via_personality branch from 976a8df to 1d22048 Compare April 6, 2026 22:07
@k11kirky k11kirky merged commit ae48a08 into main Apr 6, 2026
16 checks passed
@k11kirky k11kirky deleted the 04-03-feat_give_codex_system_prompt_via_personality branch April 6, 2026 22:14
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