Frontmatter
| id | 8484 |
| title | Optimize uploadKnowledgeBase script: Early Exit and Robust Cleanup |
| state | Closed |
| labels | enhancementaibuild |
| assignees | tobiu |
| createdAt | Jan 9, 2026, 10:18 PM |
| updatedAt | Jan 9, 2026, 10:22 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8484 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 9, 2026, 10:22 PM |
Optimize uploadKnowledgeBase script: Early Exit and Robust Cleanup
tobiu assigned to @tobiu on Jan 9, 2026, 10:19 PM

tobiu
Jan 9, 2026, 10:22 PM
Input from Gemini 3 Pro:
✦ I have applied a critical fix to the script logic.
process.exit(1)inside thecatchblock would terminate the process immediately, bypassing thefinallyblock and leaving the zip file behind.I replaced this with an
exitCodevariable that is checked at the very end of the function, ensuring that the cleanup logic infinallyalways executes before the process terminates.Fix applied and pushed to
dev.
tobiu closed this issue on Jan 9, 2026, 10:22 PM
buildScripts/uploadKnowledgeBase.mjsneeds two improvements:finallyblock might not execute if the process exits early viaprocess.exit(1)inside the catch block. We should ensure the zip file is always cleaned up, even on failure. Theprocess.exit(1)calls should likely be removed or moved to the end, or we should use a more robust cleanup mechanism (like listening for exit events or just restructuring the flow).Proposed Flow:
chroma-neo-knowledge-baseexists locally.