feat(atlas): update resolvers and index for lineage-aware session resolution
- Update recent-model-resolver for session origin awareness
- Update resolve-active-boulder-session with lineage support
- Add comprehensive test coverage for boulder session resolution
- Add fallback tests for recent model resolver
- Update index tests for new lineage tracking
🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
@@ -18,16 +18,25 @@ export async function resolveRecentPromptContextForSession(
|
||||
try {
|
||||
const messagesResp = await ctx.client.session.messages({ path: { id: sessionID } })
|
||||
const messages = normalizeSDKResponse(messagesResp, [] as Array<{
|
||||
id?: string
|
||||
info?: {
|
||||
model?: ModelInfo
|
||||
modelID?: string
|
||||
providerID?: string
|
||||
tools?: Record<string, boolean | "allow" | "deny" | "ask">
|
||||
time?: { created?: number }
|
||||
}
|
||||
}>)
|
||||
}>).sort((left, right) => {
|
||||
const leftTime = left.info?.time?.created ?? Number.NEGATIVE_INFINITY
|
||||
const rightTime = right.info?.time?.created ?? Number.NEGATIVE_INFINITY
|
||||
if (leftTime !== rightTime) return rightTime - leftTime
|
||||
const leftId = typeof left.id === "string" ? left.id : ""
|
||||
const rightId = typeof right.id === "string" ? right.id : ""
|
||||
return rightId.localeCompare(leftId)
|
||||
})
|
||||
|
||||
for (let i = messages.length - 1; i >= 0; i--) {
|
||||
const info = messages[i].info
|
||||
for (const message of messages) {
|
||||
const info = message.info
|
||||
const model = info?.model
|
||||
const tools = normalizePromptTools(info?.tools)
|
||||
if (model?.providerID && model?.modelID) {
|
||||
|
||||
Reference in New Issue
Block a user