Enha (playwright): conditionaly install and use tools

This commit is contained in:
Grail Finder
2026-03-03 09:15:18 +03:00
parent d130254e88
commit 0c9c590d8f
6 changed files with 305 additions and 244 deletions

19
bot.go
View File

@@ -1416,7 +1416,7 @@ func updateModelLists() {
chatBody.Model = m
cachedModelColor = "green"
updateStatusLine()
UpdateToolCapabilities()
updateToolCapabilities()
app.Draw()
return
}
@@ -1530,6 +1530,23 @@ func init() {
if cfg.STT_ENABLED {
asr = NewSTT(logger, cfg)
}
if !cfg.NoPlaywright {
if err := checkPlaywright(); err != nil {
// slow, need a faster check if playwright install
if err := installPW(); err != nil {
logger.Error("failed to install playwright", "error", err)
cancel()
os.Exit(1)
return
}
if err := checkPlaywright(); err != nil {
logger.Error("failed to run playwright", "error", err)
cancel()
os.Exit(1)
return
}
}
}
// Initialize scrollToEndEnabled based on config
scrollToEndEnabled = cfg.AutoScrollEnabled
go updateModelLists()