Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/provider/opencode/authentication.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
&key
(stream *standard-output*)
(input *standard-input*)
input-file-descriptor)
(input-file-descriptor
(and (eq input *standard-input*)
*api-key-input-file-descriptor*)))
"Prompt for an OpenCode API key and save it to MANAGER's private store.

OpenCode's model-list endpoint is public, so login cannot validate a key without
Expand Down
18 changes: 9 additions & 9 deletions tests/opencode-provider-tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@
(setf save-secret-use-active-p (secret-use-active-p))
(funcall original-save source credentials))))
(lambda ()
(test-assert
(string=
(opencode-api-key-login
manager
:stream (make-string-output-stream)
:input (make-string-input-stream "")
:input-file-descriptor 23)
"OpenCode authentication was saved by Autolith.")
"OpenCode login reports successful private persistence")
(let ((*api-key-input-file-descriptor* 23))
(test-assert
(string=
(opencode-api-key-login
manager
:stream (make-string-output-stream)
:input *standard-input*)
"OpenCode authentication was saved by Autolith.")
"OpenCode login reports successful private persistence"))
(setf stored
(credential-source-load
(credential-manager-primary-source manager)))))
Expand Down