( skillId: string, workspaceId: string, tag: string )
| 263 | } |
| 264 | |
| 265 | async function processSkillFromDb( |
| 266 | skillId: string, |
| 267 | workspaceId: string, |
| 268 | tag: string |
| 269 | ): Promise<AgentContext | null> { |
| 270 | try { |
| 271 | const s = await getSkillById({ skillId, workspaceId }) |
| 272 | if (!s) return null |
| 273 | // Skills are autoloaded: carry the full SKILL.md body so the Go side can |
| 274 | // inject it into the dynamic system message for the turn. The path lets the |
| 275 | // model re-read the canonical VFS file if it needs to. |
| 276 | const path = `agent/skills/${encodeVfsSegment(s.name)}.json` |
| 277 | return { type: 'skill', tag, content: s.content, path } |
| 278 | } catch (error) { |
| 279 | logger.error('Error processing skill context (db)', { skillId, error }) |
| 280 | return null |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | async function processPastChatFromDb( |
| 285 | chatId: string, |
no test coverage detected