agent-pages

Phase 4 handoff: rich Twitter and Hacker News delivery to Zulip

Download

Phase 4 handoff: rich Twitter and Hacker News delivery to Zulip

Instruction to the next agent

Resume the Phase 4 Twitter and Hacker News delivery work in the existing repository and working tree. Begin by inspecting the repository, phase plan, current configuration, and all staged, unstaged, and untracked changes. The previous Codex process was killed by the Linux OOM killer while attempting to resume a very large session, so partial work may exist even though an earlier assessment said the rich-formatting changes had not yet begun.

Treat the current working tree as authoritative. Preserve all existing work. Do not run git reset, git clean, discard changes, overwrite files wholesale, switch branches destructively, or assume unrelated dirty files are disposable. Do not deploy, restart production services, modify live jobs, or commit/push until the implementation has been inspected, tested, summarized, and explicitly approved by the owner.

Project context

Production Zulip structure already verified

The following private Zulip channels, subscribers, topics, and numeric IDs were verified through the Zulip API:

Purpose Channel Channel ID Topic Canonical destination
Twitter curator news 5 twitter stream:5:twitter
Hacker News curator news 5 hacker-news stream:5:hacker-news
Future RSS delivery rss 6 feed stream:6:feed

Existing behavior before the interrupted work

Verify these paths and their present contents rather than assuming they are unchanged.

Agreed presentation requirements

Every scheduled update

Start with a concise, useful one-line summary suitable for the truncated text shown on an Apple Watch notification. Put the normal digest beneath it. Keep the summary meaningful without requiring the user to open Zulip—for example, communicate the number and nature of the most important updates rather than using a generic “new updates” label.

Preserve a sensible unread/badge count. The earlier preference was one digest message per scheduled run rather than one Zulip message per item, unless technical constraints require reconsideration and the trade-off is presented to the owner first.

Twitter digest

For every included tweet, provide the following where the upstream source supplies it:

Do not promise a native X/Twitter embed card: Zulip does not provide dependable Discord-style embed objects or arbitrary HTML/CSS. Use Zulip Markdown, Zulip-hosted uploads, named links, blockquotes, and native link previews.

Hacker News digest

For every included story, provide:

Avoid fabricating missing metadata. If a field is unavailable, omit it or mark it unavailable consistently.

Delivery and reliability constraints

Required first pass: recover and assess the working tree

Run read-only inspection first, adapting paths to the actual checkout:

cd /root/openclaw

git status --short --branch
git diff --stat
git diff --cached --stat
git log --oneline --decorate -n 12

git diff -- \
  openclaw-data/workspace/skills/twitter-curator/cron-rich-embed-prompt.txt \
  openclaw-data/workspace/skills/hn-curator/cron-watch-notification-prompt.txt

Then:

  1. Read AGENTS.md, CLAUDE.md, the Phase 4 section of docs/openclaw-zulip-integration-plan.md, and any nearer repository instructions before modifying anything.
  2. Locate all Twitter/HN curator implementation, prompt, schema, acknowledgement, upload, routing, tests, and documentation files using bounded searches.
  3. Attribute current changes where possible: pre-existing Phase 1–3 work, generated/runtime artifacts, and any partial Phase 4 changes created immediately before the OOM.
  4. Report the exact recovered state before continuing: changed files relevant to this task, what appears complete, what is partial, what is untouched, and any conflicts with the requirements above.
  5. Continue from sound partial work rather than reimplementing it. Make focused edits only.

If the two prompt paths are outside the Git checkout or are runtime-managed copies, identify their source-of-truth templates and deployment mechanism. Do not edit only generated/live copies unless the project explicitly defines them as authoritative.

Implementation sequence

  1. Map the current Twitter and HN source payloads so every requested field is tied to real upstream data.
  2. Define the deterministic Markdown output and Apple Watch summary format, including missing-field behavior and safe length bounds.
  3. Implement media/avatar acquisition through bounded downloads and Zulip uploads, with caching and text-only fallback.
  4. Implement or verify delivery acknowledgement, message-ID capture, deduplication, and partial-failure behavior.
  5. Add focused unit/fixture tests for formatting, absent metadata, Unicode/long text, upload failure, link preview behavior, retry, and duplicate suppression.
  6. Run static checks and targeted tests first. Do not run broad, unbounded log dumps or unrelated test suites without a reason.
  7. Present a concise diff/test/deployment plan and obtain owner approval before touching live scheduled jobs.
  8. After approval, deploy one curator at a time, perform controlled delivery tests, verify the exact Zulip destination and formatting, and confirm that Discord receives only failures.
  9. Update docs/openclaw-zulip-integration-plan.md with verified results rather than anticipated results.

Acceptance checklist

Historical interruption note

The first rich-formatting attempt ran for roughly 138 minutes and ended when the model allocation was interrupted. A subsequent read-only assessment reported that no substantive rich-formatting changes had been made at that point. The user then authorized resuming the work, but the replacement Codex app-server was killed by Linux OOM while loading the old session. Therefore, do not infer implementation status solely from the transcript: inspect the current working tree and runtime-managed prompt files before deciding what remains.