# Upgrade Guide — v0.17.8

<!-- bump: patch -->

## What Changed

### Job Topic ID Now Available in Session Context

Scheduled jobs now have their Telegram topic ID surfaced automatically at session start and after context compaction.

**Before**: Agents running as jobs had no programmatic way to discover which Telegram topic belonged to their job. The topic was auto-created by the scheduler and saved in state, but never injected into the running session. The only workaround was hardcoding the topic ID in CLAUDE.md or skill files — brittle and breaks when topics are recreated.

**After**: `active-job.json` (written before each job session) now includes `topicId`. Both the `session-start` and `compaction-recovery` hooks read this and surface a ready-to-use `telegram-reply.sh` command with the correct topic ID. No hardcoding needed.

**What agents see at session start** (when topicId is available):
```
JOB TELEGRAM TOPIC: This job's Telegram topic ID is 793.
Use: cat <<'EOF' | .instar/scripts/telegram-reply.sh 793
Your message here
EOF
```

Jobs with `telegramNotify: false` (never mode) get `topicId: null` and no hint is shown.

## What to Tell Your User

- **"Jobs now know their own Telegram topic."** If your agent runs scheduled jobs, those jobs can now discover their Telegram topic automatically — no more hardcoding topic IDs in configuration or prompts.

## Summary of New Capabilities

| Capability | How to Use |
|-----------|-----------|
| Job topic ID in session context | Automatic — shown at session start and after compaction for jobs with an active Telegram topic |
| Topic ID in active-job.json | Available as `topicId` field for custom hook integrations |
