Skip to content

Commit e16ab04

Browse files
committed
Merge branch 'main' into feature/newbilling
2 parents 05584ea + 13b9160 commit e16ab04

28 files changed

Lines changed: 925 additions & 179 deletions

File tree

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ChatProgressValue.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class ChatProgressValue implements WorkDoneProgressNotification {
2727
private ConversationError error;
2828
private List<AgentRound> editAgentRounds;
2929
private String suggestedTitle;
30+
private ContextSizeInfo contextSize;
3031

3132
public WorkDoneProgressKind getKind() {
3233
return kind;
@@ -144,6 +145,14 @@ public void setSuggestedTitle(String suggestedTitle) {
144145
this.suggestedTitle = suggestedTitle;
145146
}
146147

148+
public ContextSizeInfo getContextSize() {
149+
return contextSize;
150+
}
151+
152+
public void setContextSize(ContextSizeInfo contextSize) {
153+
this.contextSize = contextSize;
154+
}
155+
147156
public String getCancellationReason() {
148157
return cancellationReason;
149158
}
@@ -164,8 +173,8 @@ public int hashCode() {
164173
result = prime * result + Arrays.hashCode(notifications);
165174
result = prime * result + Arrays.hashCode(references);
166175
result = prime * result + Arrays.hashCode(steps);
167-
result = prime * result + Objects.hash(editAgentRounds, cancellationReason, conversationId, error, hideText, kind,
168-
reply, title, turnId, parentTurnId, suggestedTitle);
176+
result = prime * result + Objects.hash(editAgentRounds, cancellationReason, contextSize, conversationId, error,
177+
hideText, kind, reply, title, turnId, parentTurnId, suggestedTitle);
169178
return result;
170179
}
171180

@@ -183,6 +192,7 @@ public boolean equals(Object obj) {
183192
ChatProgressValue other = (ChatProgressValue) obj;
184193
return Objects.equals(editAgentRounds, other.editAgentRounds) && Arrays.equals(annotations, other.annotations)
185194
&& Objects.equals(cancellationReason, other.cancellationReason)
195+
&& Objects.equals(contextSize, other.contextSize)
186196
&& Objects.equals(conversationId, other.conversationId) && Objects.equals(error, other.error)
187197
&& hideText == other.hideText && kind == other.kind && Arrays.equals(notifications, other.notifications)
188198
&& Arrays.equals(references, other.references) && Objects.equals(reply, other.reply)
@@ -209,6 +219,7 @@ public String toString() {
209219
builder.append("error", error);
210220
builder.append("editAgentRounds", editAgentRounds);
211221
builder.append("suggestedTitle", suggestedTitle);
222+
builder.append("contextSize", contextSize);
212223
return builder.toString();
213224
}
214225
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.microsoft.copilot.eclipse.core.lsp.protocol;
2+
3+
/**
4+
* Context size information sent by the language server during conversation progress. Contains token usage breakdown
5+
* across different categories such as system prompts, tool definitions, user messages, and tool results.
6+
*/
7+
public record ContextSizeInfo(
8+
int totalTokenLimit,
9+
int systemPromptTokens,
10+
int toolDefinitionTokens,
11+
int userMessagesTokens,
12+
int assistantMessagesTokens,
13+
int attachedFilesTokens,
14+
int toolResultsTokens,
15+
int totalUsedTokens,
16+
double utilizationPercentage) {
17+
}

0 commit comments

Comments
 (0)