Skip to content

Commit 5f9b7cd

Browse files
committed
Explain settings and Lisp prompt usage in startup tips
1 parent 018ae09 commit 5f9b7cd

6 files changed

Lines changed: 72 additions & 28 deletions

File tree

src/application/commands.lisp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,7 +2237,7 @@ are forwarded to TERMINAL-UI-SELECT."
22372237
(:name "/model"
22382238
:argument "[MODEL]"
22392239
:description "pick a registered provider model and reasoning effort"
2240-
:tip "changes both the model and its reasoning effort."
2240+
:tip "selects the provider/model used for replies and then its reasoning effort; the choice is saved for future sessions."
22412241
:busy-behavior :apply
22422242
:terminal-behavior :exclusive
22432243
:callable t)
@@ -2279,7 +2279,7 @@ are forwarded to TERMINAL-UI-SELECT."
22792279
(:name "/effort"
22802280
:argument "[LEVEL]"
22812281
:description "pick the reasoning effort"
2282-
:tip "changes reasoning effort without switching models."
2282+
:tip "sets the model's reasoning budget without changing models. Higher levels allow more reasoning and can take longer; available levels depend on the model."
22832283
:busy-behavior :apply
22842284
:terminal-behavior :exclusive-without-arguments
22852285
:callable t)
@@ -2301,7 +2301,7 @@ are forwarded to TERMINAL-UI-SELECT."
23012301
(define-application-command application--builtin-fast-command
23022302
(:name "/fast"
23032303
:description "show or change Codex Fast mode"
2304-
:tip "uses service_tier=priority at 2x plan usage for future Codex requests."
2304+
:tip "sets Codex Fast mode: (fast \"on\") requests priority service at 2x plan usage; (fast \"off\") requests normal service."
23052305
:busy-behavior :apply
23062306
:terminal-behavior :shared
23072307
:callable t
@@ -2313,7 +2313,7 @@ are forwarded to TERMINAL-UI-SELECT."
23132313
(define-application-command application--builtin-trace-command
23142314
(:name "/trace"
23152315
:description "show visible reasoning summaries"
2316-
:tip "toggles visible reasoning summaries with on or off."
2316+
:tip "controls visible reasoning summaries: (trace \"on\") shows them, (trace \"off\") hides them. Use (effort) to change the reasoning budget."
23172317
:busy-behavior :apply
23182318
:terminal-behavior :shared
23192319
:callable t
@@ -2325,7 +2325,7 @@ are forwarded to TERMINAL-UI-SELECT."
23252325
(define-application-command application--builtin-turn-timestamps-command
23262326
(:name "/timestamps"
23272327
:description "show local timestamps beside user and assistant turns"
2328-
:tip "toggles dim local timestamps beside user and assistant turns."
2328+
:tip "controls local-time labels beside user and assistant turns: (timestamps \"on\") shows them, (timestamps \"off\") hides them."
23292329
:busy-behavior :apply
23302330
:terminal-behavior :shared
23312331
:callable t
@@ -2337,7 +2337,7 @@ are forwarded to TERMINAL-UI-SELECT."
23372337
(define-application-command application--builtin-simple-technical-english-command
23382338
(:name "/ste"
23392339
:description "use Simple Technical English for replies"
2340-
:tip "toggles short, direct Simple Technical English replies."
2340+
:tip "sets reply style: (ste \"on\") requests short, direct Simple Technical English; (ste \"off\") removes that style instruction."
23412341
:busy-behavior :apply
23422342
:terminal-behavior :shared
23432343
:callable t
@@ -2349,7 +2349,7 @@ are forwarded to TERMINAL-UI-SELECT."
23492349
(define-application-command application--builtin-session-titles-command
23502350
(:name "/titles"
23512351
:description "allow provider-generated session-title refreshes"
2352-
:tip "toggles automatic provider-generated session-title refreshes."
2352+
:tip "controls session naming: (titles \"on\") allows provider-generated title refreshes; (titles \"off\") uses locally derived titles."
23532353
:busy-behavior :apply
23542354
:terminal-behavior :shared
23552355
:callable t
@@ -2361,7 +2361,7 @@ are forwarded to TERMINAL-UI-SELECT."
23612361
(define-application-command application--builtin-cache-misses-command
23622362
(:name "/cache-misses"
23632363
:description "notify when a request re-reads uncached context"
2364-
:tip "reports prompt-cache misses and their likely cause after each affected request."
2364+
:tip "controls cache diagnostics: (cache-misses \"on\") reports uncached context and likely causes; (cache-misses \"off\") hides these notices."
23652365
:busy-behavior :apply
23662366
:terminal-behavior :shared
23672367
:callable t
@@ -2373,7 +2373,7 @@ are forwarded to TERMINAL-UI-SELECT."
23732373
(define-application-command application--builtin-hurry-up-command
23742374
(:name "/hurry-up"
23752375
:description "show or change hurry-up mode"
2376-
:tip "enables direct execution and admits at most two child agents."
2376+
:tip "sets execution style: (hurry-up \"on\") favors direct work and limits delegation to two child agents; (hurry-up \"off\") uses normal delegation limits."
23772377
:busy-behavior :apply
23782378
:terminal-behavior :shared
23792379
:callable t
@@ -2385,7 +2385,7 @@ are forwarded to TERMINAL-UI-SELECT."
23852385
(define-application-command application--builtin-permissions-command
23862386
(:name "/permissions"
23872387
:description "choose command access for this session"
2388-
:tip "chooses how shell commands are authorized, including autonomous auto mode."
2388+
:tip "sets command authorization: ask prompts for approval, auto authorizes autonomously, sandbox confines commands, and full grants session-wide host access."
23892389
:busy-behavior :apply
23902390
:terminal-behavior :exclusive-without-arguments
23912391
:callable t
@@ -2649,7 +2649,7 @@ are forwarded to TERMINAL-UI-SELECT."
26492649
(define-application-command application--builtin-compact-command
26502650
(:name "/compact"
26512651
:description "compact context now; on/off selects tool detail presentation"
2652-
:tip "compacts context without an argument, waiting until an active turn finishes."
2652+
:tip "with no argument compacts conversation context. (compact \"on\") collapses tool details; (compact \"off\") shows expanded details."
26532653
:busy-behavior :hold
26542654
:terminal-behavior :shared
26552655
:callable t

src/startup/main.lisp

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,26 +130,43 @@
130130
append (application--banner-terminate-row
131131
(terminal--clip-spans metadata-row columns)))))
132132

133-
(-> application--startup-command-entry () application-command)
134-
(defun application--startup-command-entry ()
135-
"Return one command entry selected for the startup banner."
136-
(let ((commands (application-command-list)))
137-
(nth (random (length commands) (make-random-state t))
138-
commands)))
133+
(defparameter *application-startup-tips*
134+
'(((:plain "The prompt is a Lisp REPL, you can use it to evaluate arbitrary Common Lisp."))
135+
((:plain "The tools available to the model are callable functions in the prompt, try for instance ")
136+
(:code "(search.files :query \"README\")")
137+
(:plain " to fuzzy-search workspace file paths with fff."))
138+
((:code "AUTOLITH_WEB_SEARCH")
139+
(:plain " selects provider web search: disabled turns it off, cached uses indexed results, and live fetches fresh results where supported."))
140+
((:code "autolith --fullscreen")
141+
(:plain " uses a scrollable transcript and bottom-pinned composer. Save the choice for future launches with ")
142+
(:code "(preferences-set-fullscreen (application-configuration *active-application*) t)")
143+
(:plain "; nil restores the inline default.")))
144+
"Startup advice supplementing registered command tips, as styled span specifications.")
139145

140146
(-> application--command-tip-spans
141147
(application-command)
142148
terminal-styled-text)
143149
(defun application--command-tip-spans (entry)
144150
"Return a startup tip with ENTRY's canonical Lisp call styled as code."
145-
(list (terminal-span :plain (format nil "~2%"))
146-
(terminal-span :dim "Tip: ")
151+
(list (terminal-span ':dim "Tip: ")
147152
(terminal-span
148153
:code
149154
(format nil "(~A)" (application-operation--command-name entry)))
150155
(terminal-span :plain
151156
(format nil " ~A" (application-command-tip entry)))))
152157

158+
(-> application--startup-tip-spans () terminal-styled-text)
159+
(defun application--startup-tip-spans ()
160+
"Choose command or general advice without consuming the saved image's random state."
161+
(let* ((commands (application-command-list))
162+
(index (random (+ (length commands) (length *application-startup-tips*))
163+
(make-random-state t))))
164+
(if (< index (length commands))
165+
(application--command-tip-spans (nth index commands))
166+
(cons (terminal-span ':dim "Tip: ")
167+
(loop for (style text) in (nth (- index (length commands)) *application-startup-tips*)
168+
collect (terminal-span style text))))))
169+
153170
(-> application-banner (application) list)
154171
(defun application-banner (application)
155172
"Return APPLICATION's identity, session metadata, security notice, and tip."
@@ -178,8 +195,8 @@
178195
:notice
179196
(format nil "~%Autolith executes model-generated code with your user ~
180197
privileges.~%Sandboxing is no substitute for human oversight")))
181-
(application--command-tip-spans
182-
(application--startup-command-entry)))))
198+
(list (terminal-span ':plain (format nil "~2%")))
199+
(application--startup-tip-spans))))
183200

184201
(-> application--update-notice (application) (option list))
185202
(defun application--update-notice (application)

src/terminal/boot-screen.lisp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,22 @@
4949

5050
(-> terminal-ui--welcome-rows (terminal-ui integer) list)
5151
(defun terminal-ui--welcome-rows (ui height)
52-
"Return the empty session's machine console above its pinned composer."
53-
(nth-value 0 (terminal-ui--boot-screen-frame
54-
ui :phase ':listener-ready
55-
:detail "Type a request. Use (login) to connect a provider." :height height)))
52+
"Center the machine console and one stable, wrapped tip above the composer."
53+
(let* ((columns (max 1 (terminal-columns (terminal-ui-terminal ui))))
54+
(width (min 64 (max 1 (- columns 4))))
55+
(left (make-string (floor (- columns width) 2) :initial-element #\Space))
56+
(tip (or (fullscreen-terminal-ui-welcome-tip ui)
57+
(setf (fullscreen-terminal-ui-welcome-tip ui)
58+
(application--startup-tip-spans))))
59+
(tip-rows (terminal-ui-fullscreen--display-rows ui (list tip) width))
60+
(panel (mapcar (lambda (row) (terminal--render-spans (terminal-ui-terminal ui) row))
61+
(terminal-ui--boot-screen-panel
62+
':listener-ready "Type a request. Use (login) to connect a provider." columns)))
63+
(rows (append panel (list "")
64+
(mapcar (lambda (row) (concatenate 'string left row)) tip-rows)))
65+
(visible (subseq rows 0 (min (length rows) (max 0 height))))
66+
(top (max 0 (floor (- height (length visible)) 2))))
67+
(append (make-list top :initial-element "") visible)))
5668

5769
(-> terminal-ui-boot-screen
5870
(terminal-ui (or string symbol) &optional (option string)) null)

src/terminal/fullscreen.lisp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
:documentation "Width of the last successfully painted frame.")
3535
(cursor-visible-p :initform t :accessor fullscreen-terminal-ui-cursor-visible-p
3636
:type boolean :documentation "Requested composer cursor visibility.")
37+
(welcome-tip :initform nil :accessor fullscreen-terminal-ui-welcome-tip
38+
:documentation "Startup advice retained across welcome repaints and resize.")
3739
(welcome-p :initform nil :accessor terminal-ui-fullscreen-welcome-p :type boolean
3840
:documentation "Whether the empty session shows the machine console panel."))
3941
(:documentation "An alternate-screen transcript viewport and bottom-pinned composer."))

tests/application-tests.lisp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@
387387
"quit aliases inherit the command's cancellation policy")
388388
(let* ((*random-state* (make-random-state nil))
389389
(captured-state (make-random-state *random-state*))
390-
(entry (application--startup-command-entry)))
391-
(test-assert (member entry (application-command-list) :test #'eq)
392-
"startup tip selection returns one canonical command")
390+
(tip (application--startup-tip-spans)))
391+
(test-assert (typep tip 'terminal-styled-text)
392+
"startup selection returns styled command or general advice")
393393
(test-assert (equalp *random-state* captured-state)
394394
"startup tip selection does not consume saved image RNG state"))
395395
nil)

tests/fullscreen-boot-tests.lisp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,22 @@
1616
(test-assert (<= (abs (- first-row (- 23 last-row))) 1) "panel is vertically centered")
1717
(test-assert (= left (floor (- 80 64) 2)) "panel is horizontally centered")
1818
(test-assert (> cursor last-row) "provider prompts start below the panel")))
19+
(terminal-ui--welcome-rows ui 21)
20+
(let ((tip (fullscreen-terminal-ui-welcome-tip ui)))
21+
(terminal-ui--welcome-rows ui 21)
22+
(test-assert (eq tip (fullscreen-terminal-ui-welcome-tip ui))
23+
"welcome repaints retain the selected advice"))
24+
(setf (fullscreen-terminal-ui-welcome-tip ui)
25+
(list (terminal-span ':plain
26+
(apply #'concatenate 'string
27+
(make-list 20 :initial-element "wrapped advice ")))))
1928
(dolist (columns '(1 2 12 24 80))
2029
(dolist (height '(1 2 7 24))
2130
(terminal-set-dimensions terminal columns :rows height)
31+
(let ((welcome (terminal-ui--welcome-rows ui height)))
32+
(test-assert (<= (length welcome) height) "welcome advice fits the viewport height")
33+
(test-assert (every (lambda (row) (<= (clinedi:ansi-display-width row) columns)) welcome)
34+
"welcome advice reflows within the viewport width"))
2235
(multiple-value-bind (frame cursor)
2336
(terminal-ui--boot-screen-frame ui :phase ':login :detail "detail" :height height)
2437
(test-assert (<= (length frame) height) "panel height is bounded")

0 commit comments

Comments
 (0)