Skip to content

fix(tracing): deduplicate mirrored base instructions - #131

Open
codingfeng-fufu wants to merge 1 commit into
langfuse:mainfrom
codingfeng-fufu:fix/deduplicate-base-instructions
Open

codingfeng-fufu wants to merge 1 commit into
langfuse:mainfrom
codingfeng-fufu:fix/deduplicate-base-instructions

Conversation

@codingfeng-fufu

Copy link
Copy Markdown

Fixes langfuse/langfuse#20582.

Some Codex rollouts store the same base instructions in session_meta and in a developer message. The plugin includes both copies when reconstructing the generation input and counts both in codex.system_prompt.total_chars.

Skip a developer message when its text exactly matches the base instructions already read from the session header. Distinct developer messages still appear in their original order. The regression test runs the same rollout with and without the duplicate and checks both the exported generation input and the character metadata.

Validation on Node 24.22.3 in Windows:

  • The mirrored case failed on e1d02be and passed with the change. Both focused cases pass.
  • The plugin build, Prettier check, and TypeScript check passed.
  • The full Vitest suite reported 121 passed and 5 failed. A baseline run reported 120 passed and the same 5 failures in the hook-command and session-index tests.

OpenAI Codex assisted with issue triage, implementation, and validation. The test uses synthetic rollout data.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

bug: Codex tracing plugin duplicates base instructions in reconstructed LLM input

2 participants