Skip to content

feat: update support for codex #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 4, 2025
Merged

Conversation

35C4n0r
Copy link
Contributor

@35C4n0r 35C4n0r commented Jul 31, 2025

@35C4n0r
Copy link
Contributor Author

35C4n0r commented Jul 31, 2025

cc: @matifali @hugodutka
PR ready for review

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the message formatting support for the Codex agent type by introducing a specialized formatter that handles Codex-specific message box patterns. The changes enable proper parsing and extraction of relevant content from Codex agent responses.

  • Adds a new formatCodexMessage function to handle Codex-specific message formatting
  • Implements removeCodexMessageBox function to parse Codex's unique message box patterns
  • Updates the agent message formatter to use the new Codex-specific logic

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

File Description
lib/msgfmt/msgfmt.go Adds formatCodexMessage function and updates FormatAgentMessage to use Codex-specific formatting
lib/msgfmt/message_box.go Implements removeCodexMessageBox function to handle Codex message box parsing
lib/msgfmt/testdata/format/codex/* Updates test data files to reflect new Codex message formatting behavior

Copy link
Collaborator

@hugodutka hugodutka left a comment

Choose a reason for hiding this comment

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

Thank you for contributing. The PR largely look good. I have 2 asks:

  • Could you add some tests for multi-line user input?
  • Could you note in the README that if you're using Codex you should make sure to specify agent type when starting agentapi server? Since we used the same logic for every agent before it didn't matter, but now it does.

@35C4n0r 35C4n0r requested a review from hugodutka July 31, 2025 11:09
@35C4n0r
Copy link
Contributor Author

35C4n0r commented Jul 31, 2025

@hugodutka made the required changes.

@35C4n0r
Copy link
Contributor Author

35C4n0r commented Aug 1, 2025

Copy link
Collaborator

@hugodutka hugodutka left a comment

Choose a reason for hiding this comment

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

Looks great. Two minor nits and we can merge it.

35C4n0r and others added 2 commits August 4, 2025 18:58
Co-authored-by: Hugo Dutka <[email protected]>
@hugodutka hugodutka merged commit 33124c2 into coder:main Aug 4, 2025
2 checks passed
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.

3 participants