2
0
Fork 0
forked from zynk/zynk
Commit graph

17 commits

Author SHA1 Message Date
319d49d439 Small AI response header striping fix. 2026-07-20 00:19:27 +02:00
c4d9011bdb Show full AI error output instead of generic error message
When an AI query fails (opencode exits non-zero), the bot previously
sent a generic 'AI query failed (opencode exited with error)' message
to IRC, discarding all useful output. Users had no way to diagnose why
the query failed.

Changes:
- Redirect opencode's stderr into the capture pipe instead of /dev/null,
  so error messages that go to stderr are no longer lost.
- On non-zero exit, include the actual captured output in the error
  message sent to IRC: 'AI error (exit N): <output>' (truncated to
  4000 chars). If no output was captured, show 'AI error (exit N, no
  output)' instead.
- Applied strip_formatting() to the error output before sending so
  ANSI codes and markdown don't leak into IRC.
- Bumped VERSION to 0.34.3.
2026-07-19 23:01:55 +02:00
335d35a7b8 Collapse double spaces in !forecast and !stock responses
Add collapse_spaces() utility that reduces runs of whitespace to a
single space. Applied to fetch_forecast() output and the !stock
response buffer before sending to IRC, fixing double spaces that
appeared when wttr.in returned an empty weather condition string
(e.g. "15°C  / Sun 20 Jul" instead of "15°C / Sun 20 Jul").

Bump version to 0.34.2.
2026-07-19 19:54:36 +02:00
3727a5f72b Fix !forecast showing all days as Sunday on musl libc
strptime on musl (Alpine Linux) does not compute tm_wday from the
parsed date, unlike glibc. Call mktime() after strptime to normalize
the struct tm and reliably compute the day of week on all platforms.
2026-07-19 18:39:30 +02:00
61a6a95801 Fix !weather returning HTML instead of weather data
wttr.in now serves a full HTML page when it detects a browser-like
User-Agent string. Replaced the fake Firefox UA in run_curl with
"zynk/VERSION" so weather, forecast, and stock requests all return
the expected format again.
2026-07-19 16:47:49 +02:00
5d308750e1 Add !uptime command, remove !hello, bump to v0.34.0 (0.34.0) 2026-07-19 02:06:32 +02:00
476554d2cb v0.33.1: fix hot reload re-registration, add !hello, comprehensive docs
- Fixed hot reload: after TLS session restore, the bot now does a fresh
  IRC connection and re-sends PASS/NICK/USER to re-register with the
  server, fixing the issue where channels were never re-joined after
  !reload or !restart.
- Removed ZYNK_RESTORE_FD env var approach; reload_try_restore now
  restores settings and returns 1 to trigger a fresh connect.
- Added !hello command for casual greeting.
- Added atomic build rule in Makefile (compile to .tmp, then mv).
- Added comprehensive function-level documentation across the entire
  codebase (~80 new doc comments).
2026-07-19 01:29:22 +02:00
76ae9cc1ef Reuse SSL sessions, added !reload and !restart command and some fixes. 2026-07-19 00:14:30 +02:00
02d73e0af6 Added !command and fixed the !forecast command. 2026-07-18 23:26:57 +02:00
a6ee428f7b Some more security fixes. 2026-07-16 03:43:00 +02:00
a3774da4ee Some fixes. 2026-07-16 03:07:33 +02:00
10c45492bc Added -opencode command-line option to set the path to the opencode binary, overriding OPENCODE_BIN. 2026-07-15 21:19:28 +02:00
999814e5df Added !help command to list available bot commands. 2026-07-15 21:12:29 +02:00
00e2153ee8 Added VERSION to zynk.c and a !command to request the program version in IRC. 2026-07-15 21:03:42 +02:00
9b5d8df361 Numerous optimizations and fixes. 2026-07-15 19:49:37 +02:00
19329f1201 zynk is removing double spaces in responses now. 2026-07-15 16:10:09 +02:00
2247b9a480 Renamed calc to zynk and refactored all relevant parts. 2026-07-14 23:52:56 +02:00
Renamed from calc.c (Browse further)