mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-04 20:41:51 +08:00
feat(settings): default-enable screenshot/evidence settings and fix container Playwright MCP
- Default-enable browser_screenshot_enabled, browser_screenshot_timestamp_enabled, agent_traffic_binding, and task_intelligence_enabled when unset in DB (preserving explicit user false values). - Align db/credentials.go SQL checks and frontend defaults/copy with DefaultTaskIntelligence = true. - Fix container Playwright MCP screenshot failures: ensure --browser chromium in seed/reconcile, install Chromium via playwright-mcp install-browser --with-deps chromium in Dockerfile, prefer local playwright-mcp binary over npx, and run stdio MCP servers in the active agent working directory with stderr capture. Fixes #188
This commit is contained in:
1 parent
253a8eeac3
commit
b23d1776c7
28 files changed
+663
-92
No files matched your search
+9
-4
@@ -255,7 +255,7 @@ func (s *Server) wsPreview(w http.ResponseWriter, r *http.Request) {
|
||||
writeErr(w, 415, "仅支持图片预览")
|
||||
return
|
||||
}
|
||||
if s.m.pg.GetBool(settingScreenshotTimestamp, false) {
|
||||
if s.m.pg.GetBool(settingScreenshotTimestamp, defaultScreenshotTimestamp) {
|
||||
rawRel := filepath.ToSlash(strings.TrimPrefix(strings.TrimSpace(rawPath), "/"))
|
||||
rel := filepath.ToSlash(s.wsRel(abs))
|
||||
if strings.HasPrefix(rawRel, "findings/screenshots/") || strings.HasPrefix(rel, "findings/screenshots/") || strings.Contains(rel, "/findings/screenshots/") {
|
||||
@@ -280,9 +280,14 @@ func (s *Server) findSessionPreview(rawPath string) (string, bool) {
|
||||
if rel == "." || !strings.HasPrefix(rel, prefix) || strings.Contains(rel, ".."+string(os.PathSeparator)) {
|
||||
return "", false
|
||||
}
|
||||
base := filepath.Join(filepath.Clean(s.m.dir), "sessions")
|
||||
matches, err := filepath.Glob(filepath.Join(base, "*", filepath.FromSlash(rel)))
|
||||
if err != nil || len(matches) == 0 {
|
||||
root := filepath.Clean(s.m.dir)
|
||||
var matches []string
|
||||
for _, sub := range []string{"sessions", "tasks"} {
|
||||
if found, err := filepath.Glob(filepath.Join(root, sub, "*", filepath.FromSlash(rel))); err == nil {
|
||||
matches = append(matches, found...)
|
||||
}
|
||||
}
|
||||
if len(matches) == 0 {
|
||||
return "", false
|
||||
}
|
||||
var newest string
|
||||
|
||||
Reference in new issue
Block a user