Skip to content

release/sdk-alpha21: telegram init template + merge of main - #702

Merged
LinuxDevil merged 13 commits into
mainfrom
release/sdk-alpha21
Oct 21, 2026
Merged

LinuxDevil merged 13 commits into
mainfrom
release/sdk-alpha21

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • lousho init <dir> --template telegram scaffolds a self-contained Telegram bot: long-polling bridge (owner lock, ALLOWED_CHATS whitelist, group @mention triggers), allow/deny/always approval buttons with saved rules, markdown→Telegram-HTML rendering, media intake, terminal and --task-file one-shot modes
  • Bot flags --bot-name --bot-token --bot-username --allowed-chats --persona (telegram template only) bake into .env and the agent persona
  • Merged latest main (AGENTS.md/CLAUDE.md scaffolding, scripts() refactor, modelSettings.maxTokens cap, lousho.com docs links) — telegram template complies with all of them
  • Resolved conflicts in src/cli/init/templates.ts (telegram/task scripts moved into scripts()) and templates.test.ts (expected file list)

Test plan

  • tsc --noEmit clean
  • src/cli/init/ suite: 160/160 (snapshots regenerated)
  • Generated a telegram project from the merged code — file set, AGENTS.md script list, modelSettings all verified

Generated with Devin

LinuxDevil and others added 13 commits October 16, 2026 22:22
…aded, and hollow results

Field findings from running six agents on a local LM Studio model:

- Compaction: when the provider rejects a request for context size and the
  configured contextWindow is larger than the model's real one, the error
  is now marked on the transcript and folded into it for a retry when a
  compaction hook exists; the hook compacts under the server's observed
  window (or the rejected request size when unnamed) for the rest of the
  run.
- MCP: warn when a server's tool schemas exceed ~16K tokens (deferred
  tools excluded); optional: true servers connect in the background so a
  slow or failing optional server no longer blocks the first send().
- Results: a run ended by max-steps or a budget without a final answer
  now returns explanatory text instead of an empty string; toolCalls of a
  run continued from a transcript (approval resolve, resume) are
  collected from its messages so they no longer disappear.
- Providers: 'model is not loaded/unloaded' classifies as a new
  model-unloaded category (retryable) so withRetry() rides out a local
  server evicting or still loading a model.
- Memory: recall_<slot> with a query that matches nothing now says the
  slot is not empty instead of returning a bare [] that contradicted the
  injected <memory> block.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The ignore-instructions signal required a temporal qualifier
(previous/system/original) so "ignore your instructions" slipped
through. Qualifiers are now optional.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
`lousho init <dir> --template telegram` scaffolds a self-contained
Telegram bot: long-polling bridge (owner lock, ALLOWED_CHATS whitelist,
group @mention trigger), allow/deny/always approval buttons backed by
a saved-rules store, markdown→Telegram-HTML rendering with plain-text
fallback, photo/document/voice intake to .lousho/inbox, terminal and
--task-file one-shot modes.

Flags (telegram template only, rejected elsewhere): --bot-name,
--bot-token, --bot-username, --allowed-chats, --persona — baked into
.env (written directly) and the agent's instructions.

Env-derived constants are read lazily in the generated code so values
set in .env work even though module imports run before .env loads.

Generated projects typecheck and pass their own tests (md converter +
mockModel agent test) — verified by scaffolding and compiling one.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…dk-alpha21

# Conflicts:
#	src/cli/init/templates.test.ts
#	src/cli/init/templates.ts
plainErrors guards `throw new Error(` sites in src/ — the telegram
template's bridge/api sources are string literals emitted into the
scaffolded project, which intentionally stays SDK-import-free. Added
the three generated throw sites to ALLOWED with the reason.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- projectConfig.ts (new leaf): providerInfo + ProjectConfig + BotOptions
  moved out of templates.ts, breaking the templates <-> telegramTemplate
  import cycle; templates re-exports ProjectConfig for its consumers
- options.ts: BOT_FLAGS derives from a flag->field map consumed by
  botFlagsUsed; no stray export
- chatRoutes.ts exports incomingHeaders(); nodeServer.ts's
  channelRequestAllowed reuses it (was a 5-line clone)

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil merged commit 819f283 into main Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant