Skip to content

Conversation

@williamstein
Copy link

This is change is needed in order to show something like the " 18% context left", similar to what codex-cli shows users. Exposing this info is a very natural todo for using codex via ACP, since when the codex context window gets nearly full, it starts getting noticeably "stupid"; running "/compact" then fixes the problem. However, if you don't know that the context is nearly full, it's very difficult to to know when to do /compact, and there's no other way to query for this information. That is is basically the only info shown all the time in codex-cli also perhaps hints at how important it is.

Comment on lines +1422 to +1427
update: SessionUpdate::AgentMessageChunk(ContentChunk {
content: ContentBlock::Text(TextContent {
text: String::new(),
annotations: None,
meta: None,
}),
Copy link
Member

Choose a reason for hiding this comment

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

Hmm we shouldn't need to append an empty chunk ideally...
This is something on the todo list to support at the protocol level in someway, and I think this highlights the issue that there isn't a great way to send it.

Another option might be to send it on the turn end with the stop reason? Like store it on the state of the turn and submit it when we finish?

But I haven't seen how often we get these. Do you have an idea of how often these events happen?

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