Skip to content

Commit

Permalink
fix(thread): add truncated field to MessageAttachmentCodeFileList (#3944
Browse files Browse the repository at this point in the history
)

* fix(thread): add truncated field to MessageAttachmentCodeFileList

* update

* update

---------

Co-authored-by: liangfung <[email protected]>
  • Loading branch information
wsxiaoys and liangfung authored Mar 5, 2025
1 parent 9cb0a07 commit 5931d10
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ee/tabby-schema/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ type MessageAttachmentCode {

type MessageAttachmentCodeFileList {
fileList: [String!]!
truncated: Boolean!
}

type MessageAttachmentCodeScores {
Expand Down
1 change: 1 addition & 0 deletions ee/tabby-schema/src/dao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ impl From<AttachmentCodeFileList> for thread::MessageAttachmentCodeFileList {
fn from(value: AttachmentCodeFileList) -> Self {
Self {
file_list: value.file_list,
truncated: value.truncated,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions ee/tabby-schema/src/schema/thread/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub struct MessageAttachment {
#[derive(GraphQLObject, Clone)]
pub struct MessageAttachmentCodeFileList {
pub file_list: Vec<String>,
pub truncated: bool,
}

#[derive(GraphQLObject, Clone)]
Expand Down
2 changes: 2 additions & 0 deletions ee/tabby-webserver/src/service/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ impl AnswerService {
Ok((file_list, truncated)) => {
attachment.code_file_list = Some(MessageAttachmentCodeFileList {
file_list: file_list.clone(),
truncated,
});
yield Ok(ThreadRunItem::ThreadAssistantMessageAttachmentsCodeFileList(ThreadAssistantMessageAttachmentsCodeFileList {
file_list,
Expand Down Expand Up @@ -474,6 +475,7 @@ mod tests {
}],
code_file_list: Some(MessageAttachmentCodeFileList {
file_list: vec!["client.py".to_owned(), "server.py".to_owned()],
truncated: false,
}),
};

Expand Down

0 comments on commit 5931d10

Please sign in to comment.