Telegram gateway - A tool call of the gateway's own turn that needed consent was either denied (a daemon has no approval stream) or, with ack channels set, waited for an "ok <id>" that only the blocked gateway could have read. It now asks in the chat the turn came from, keeps reading while it waits, resolves answers (also other processes' and 'splinter --ack'), ignores strangers and tells everything else to wait. The update offset is shared, so nothing is handled twice. New cfg flag approve_is_channel: such an approve is asked directly. - send_message wrote its error through err, and half the callers pass NULL: the first refused message (too long, bad UTF-8) crashed the gateway. It also missed '"ok": true' by substring; the reply is parsed now. - tests/test_gateway.sh drives the real daemon against a fake Bot API and a fake model (tests/fake_telegram.py), with "ok" and with "no". In make check; .gitignore no longer hides tests/test_*.sh. Approvals - A channel was told "Zustimmung <id>" and nothing else: a phone said yes to a number. The message now names the tool and its arguments (cut at 300 bytes) and how to answer, and goes to the channel as "$1", never parsed by sh. Smaller - ring: an exit that already streamed text is not retried on the next one (the operator saw a second answer after half of the first); the header now says what moves the ring - limits and providers that are down. - cli: the program's stderr went over the curses screen and the error quoted stdout. stderr goes to a file and into the error; temp paths are quoted; the BODY_CAP no-op is gone. (That is the "kaputt" make check used to print.) - memory: memory_key_env became an env var curl never reads, so no request had a key. It is "Authorization: Token <key>" now, on curl's stdin. Tested. - docs/CONFIG.md: the real default path, and the seven keys it did not know (telegram_allow, memory_url, memory_key_env, skills_dir, env_delegates, exit, delegate) with the line formats, checked against the parser. - The no-token message named a config key that does not exist. Left as it is, on purpose: 'read' stays unrestricted (decision); the fsync per session line stays (durability over latency). make check: 26 test binaries and the gateway script, green, also under ASan/UBSan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
684 B
C
25 lines
684 B
C
/*
|
|
* splinter -- approvals that do not care who answers.
|
|
*
|
|
* Copyright (c) 2026 Konrad Lother
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
#ifndef SPLINTER_ACK_H
|
|
#define SPLINTER_ACK_H
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "splinter.h"
|
|
|
|
const char *sp_ack_dir(void);
|
|
int sp_ack_request(const char *tool, const char *args,
|
|
const char *why, int ttl);
|
|
int sp_ack_notify(int id, struct sp_buf *log);
|
|
int sp_ack_wait(int id, int ttl, char *who, size_t who_len);
|
|
int sp_ack_answer(int id, int yes, const char *who);
|
|
int sp_ack_list(struct sp_buf *out);
|
|
/* 1 when an answer for 'id' is waiting, without consuming it */
|
|
int sp_ack_answered(int id);
|
|
|
|
#endif /* SPLINTER_ACK_H */
|