Skip to content

Add iMessage interface (imessage_bot.py) - #3

Merged
ssethia2 merged 2 commits into
ssethia2:mainfrom
deveshagarwal:imessage-interface
Jun 16, 2026
Merged

Add iMessage interface (imessage_bot.py)#3
ssethia2 merged 2 commits into
ssethia2:mainfrom
deveshagarwal:imessage-interface

Conversation

@deveshagarwal

Copy link
Copy Markdown
Contributor

A macOS alternative to telegram_bot.py for talking to Aria over iMessage. Reuses agent_core, memory, skills, and the engine unchanged — only the transport differs.

  • imessage_reader.py: poll ~/Library/Messages/chat.db read-only by ROWID; decode attributedBody (text is NULL on modern macOS).
  • imessage_send.py: reply via Messages.app AppleScript (osascript), text passed as argv so it can't break/inject.
  • imessage_bot.py: mirrors telegram_bot's contract — handle allowlist + setup mode, quick_answer fast path, streamed progress notes, dangling-tool-call repair, checkpointed threads ("imessage-"), and the proactivity engine wired with a notify path that iMessages the user and appends to their thread.
  • docs/imessage.md, .env.example IMESSAGE_ALLOWED_HANDLES, offline tests.

A macOS alternative to telegram_bot.py for talking to Aria over iMessage. Reuses
agent_core, memory, skills, and the engine unchanged — only the transport differs.

- imessage_reader.py: poll ~/Library/Messages/chat.db read-only by ROWID; decode
  attributedBody (text is NULL on modern macOS).
- imessage_send.py: reply via Messages.app AppleScript (osascript), text passed as
  argv so it can't break/inject.
- imessage_bot.py: mirrors telegram_bot's contract — handle allowlist + setup mode,
  quick_answer fast path, streamed progress notes, dangling-tool-call repair,
  checkpointed threads ("imessage-<handle>"), and the proactivity engine wired with a
  notify path that iMessages the user and appends to their thread.
- docs/imessage.md, .env.example IMESSAGE_ALLOWED_HANDLES, offline tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@deveshagarwal
deveshagarwal requested a review from ssethia2 as a code owner June 14, 2026 23:36
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

✅ All contributors have signed the CLA.
Posted by the CLA Assistant Lite bot.

@deveshagarwal

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 14, 2026
@ssethia2

Copy link
Copy Markdown
Owner

Strong PR — reuses agent_core/llm_router, required allowlist, read-only chat.db + parameterized SQL, injection-safe AppleScript send, and handles the attributedBody NULL-text case. Filed two follow-ups: #7 (extract shared runtime shared with telegram_bot) and #8 (doc: one engine-hosting interface at a time). Mergeable once the CLA check is green.

@ssethia2
ssethia2 merged commit 23ffe3d into ssethia2:main Jun 16, 2026
1 check passed
ssethia2 added a commit that referenced this pull request Jul 13, 2026
The personal-Aria core loop, deepened around the real failure modes:

- commitment_events (append-only audit trail): created/completed/dropped/
  rescheduled/snoozed/nudged/reopened, wired into every mutation. The
  substrate for slip patterns and honest recovery from mistakes.
- reschedule_commitment: "push it to Friday" moves the date in place
  (history preserved) — no more drop+re-add; warns on push #3+.
- snooze_commitment: "stop bugging me until next week" — chase actually
  honors it (snoozed items never even reach the chase LLM).
- reopen_commitment: THE fix for a wrong completion — same id, history
  intact, never a re-added copy (prompt updated to use it).
- Chase v2: skips snoozed, sees times_rescheduled per item, and is told
  to be frank (pick a real date or drop it) on serial pushes; nudges are
  logged to the audit trail.
- analyze_commitments: names items rescheduled 3+ times ("pick a real
  date or let it go?") from the event log.
- Schema migration idempotent; live DB verified (14 open intact).
- tests: lifecycle events, reschedule/snooze/reopen roundtrips, slip
  counts, serial-slip findings, chase-skips-snoozed. 312 total.

Assisted-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants