server: do not advertise a connect code without the tunnel

--connect-code on its own had no effect other than being served in
/props, so the Web UI showed a remote access code that no tunnel was
serving. Clear it when --connect is off, and say so once at startup.

The teardown comment claimed that terminate() closes the child stdout.
It does not: the log thread leaves fgets() only once every writer of
that pipe is gone, so a descendant of llama-connect would block the
join forever. Describe the real contract instead.

Also restore the --reasoning-preserve default in the generated docs.
This commit is contained in:
Pascal
2026-09-03 10:12:11 +02:00
parent a75348a2ae
commit a2ec6b0fff
5 changed files with 10 additions and 4 deletions
+3 -1
View File
@@ -240,7 +240,9 @@ void server_connect::stop() {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
// no-op if the child already exited; also unblocks the log thread by closing its stdout
// no-op if the child already exited. the log thread leaves fgets() on EOF, which the kernel
// raises once every writer of the stdout pipe is gone, so llama-connect must not spawn
// children of its own: one of them holding that pipe blocks the join below forever
proc->terminate();
if (log_thread.joinable()) {