Fix /provider slash command; fix try/catch in run-agent!; add agent logging

ober

ca0547e05528d143968c8046e4a2acbbe72436a2

diff --git a/src/jcode/ui/tui.ss b/src/jcode/ui/tui.ss
index eadd659..22dccd4 100644
--- a/src/jcode/ui/tui.ss
+++ b/src/jcode/ui/tui.ss
@@ -420,6 +420,12 @@
          (current-model-override (config-default-model p))
          (add-message! state
            (msg-block-system (format "Provider: ~a (model: ~a)" p (current-model-override))))))
+      ((equal? cmd "provider")
+       (add-message! state
+         (msg-block-system
+           (format "Provider: ~a\nModel: ~a"
+             (or (current-provider-override) (config-provider))
+             (or (current-model-override) (config-model))))))
       ((equal? cmd "theme")
        (cycle-theme!)
        (add-message! state (msg-block-system "Theme cycled.")))
@@ -447,6 +453,7 @@
   (add-message! state (msg-block-assistant ""))
   (app-state-dirty?-set! state #t)
 
+  (tui-log "run-agent: starting, session=~a" (app-state-session-id state))
   (try
     (parameterize
       ((current-stream-cb
@@ -455,12 +462,14 @@
        (current-tool-cb
          (lambda (event name args)
            (tui-tool-event! state event name args))))
-      (agent-run (app-state-session-id state) text))
-    ;; Finalize streaming
-    (let ((buf (app-state-stream-buf state)))
-      (unless (string-empty? buf)
-        (update-last-assistant! state buf)))
+      (agent-run (app-state-session-id state) text)
+      ;; Finalize streaming
+      (tui-log "run-agent: agent-run returned, buf=~s" (app-state-stream-buf state))
+      (let ((buf (app-state-stream-buf state)))
+        (unless (string-empty? buf)
+          (update-last-assistant! state buf))))
     (catch (e)
+      (tui-log "run-agent: ERROR ~a" (err->string e))
       (add-message! state (msg-block-error (err->string e)))))
 
   (app-state-agent-busy?-set! state #f)