MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / getWebCodexThreadRecentMessages

Function getWebCodexThreadRecentMessages

apps/web/lib/server/queries.ts:998–1019  ·  view source on GitHub ↗
(
  threadId: string,
  limit = 8,
)

Source from the content-addressed store, hash-verified

996}
997
998export async function getWebCodexThreadRecentMessages(
999 threadId: string,
1000 limit = 8,
1001): Promise<{
1002 items: WebCodexThreadMessage[];
1003 hasMore: boolean;
1004}> {
1005 const filePath = getStoredCodexSessionFileMap().get(threadId);
1006 if (!filePath || !fs.existsSync(filePath)) {
1007 return {
1008 items: [],
1009 hasMore: false,
1010 };
1011 }
1012
1013 const tail = readFileTail(filePath);
1014 const messages = parseCodexMessagesFromLines(tail.split('\n'));
1015 return {
1016 items: messages.slice(Math.max(0, messages.length - limit)),
1017 hasMore: messages.length > limit,
1018 };
1019}
1020
1021function listWebAutomationsSync(): WebAutomationSummary[] {
1022 return getStoredAutomationJobs()

Callers 3

CodexThreadDetailPageFunction · 0.90
GETFunction · 0.90
executeWebThreadReplyFunction · 0.90

Calls 4

readFileTailFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected