Skip to content
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,86 @@ OPENCODE_ANTIGRAVITY_LOG_DIR=/path # log_dir
OPENCODE_ANTIGRAVITY_KEEP_THINKING=1 # keep_thinking
OPENCODE_ANTIGRAVITY_ACCOUNT_SELECTION_STRATEGY=round-robin
OPENCODE_ANTIGRAVITY_PID_OFFSET_ENABLED=1
OPENCODE_ANTIGRAVITY_TELEGRAM_BOT_TOKEN="your-bot-token" # Telegram notifications
OPENCODE_ANTIGRAVITY_TELEGRAM_CHAT_ID="your-chat-id" # Telegram chat ID
```

---

## Error Notifications

Get alerts when accounts encounter errors. Session continues with next account instead of stopping.

| Option | Default | Description |
|--------|---------|-------------|
| `notify_on_account_error` | `true` | Enable notifications when accounts fail |
| `telegram_bot_token` | - | Telegram bot token for remote notifications |
| `telegram_chat_id` | - | Your Telegram chat ID |
| `notification_cooldown_seconds` | `60` | Cooldown between notifications (prevents spam) |

### Telegram Setup (Optional)

Receive account error notifications directly to Telegram - useful for monitoring long-running agents.

**Step 1: Create a Telegram Bot**

1. Open Telegram and search for [@BotFather](https://t.me/BotFather)
2. Send `/newbot` and follow the prompts
3. BotFather will give you a token like `123456789:ABCdefGHIjklMNOpqrsTUVwxyz`

**Step 2: Get Your Chat ID**

1. Search for [@userinfobot](https://t.me/userinfobot) on Telegram
2. Send any message to it
3. It will reply with your chat ID (e.g., `123456789`)

**Step 3: Configure the Plugin**

Add to your `antigravity.json`:

```json
{
"$schema": "https://raw.githubusercontent.com/NoeFabris/opencode-antigravity-auth/main/assets/antigravity.schema.json",
"telegram_bot_token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
"telegram_chat_id": "123456789"
}
```

Or via environment variables:

```bash
export OPENCODE_ANTIGRAVITY_TELEGRAM_BOT_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
export OPENCODE_ANTIGRAVITY_TELEGRAM_CHAT_ID="123456789"
```

**Step 4: Start Your Bot**

> ⚠️ You must send at least one message to your bot before it can message you.

1. Open your new bot in Telegram (use the link BotFather gave you)
2. Send any message (e.g., `/start`)
3. Now the plugin can send notifications to you!

### What You'll Receive

When an account encounters an error, you'll get a Telegram message like:

```
⚠️ Account Error
━━━━━━━━━━━━━━━━━━━━━━━━
📧 Account: user@gmail.com
❌ Error: invalid_grant
💬 Message: Token revoked - run `opencode auth login`
📊 Status: 401
🤖 Model: claude-sonnet-4-20250514
📋 Remaining: 2 account(s)
🕐 Time: 2025-02-08T10:30:00.000Z
```
Comment on lines +252 to +262
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a language identifier to the fenced code block.

The static analysis tool (markdownlint MD040) flags this code block for missing a language specifier. Since this is a plain-text notification example, use text as the language.

Proposed fix
-```
+```text
 ⚠️ Account Error
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
⚠️ Account Error
━━━━━━━━━━━━━━━━━━━━━━━━
📧 Account: user@gmail.com
❌ Error: invalid_grant
💬 Message: Token revoked - run `opencode auth login`
📊 Status: 401
🤖 Model: claude-sonnet-4-20250514
📋 Remaining: 2 account(s)
🕐 Time: 2025-02-08T10:30:00.000Z
```
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

[warning] 252-252: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@docs/CONFIGURATION.md` around lines 252 - 262, The fenced code block example
is missing a language identifier (triggering markdownlint MD040); update the
triple-backtick fence for that notification example to include the text language
specifier (change ``` to ```text) so the block is treated as plain text and the
linter warning is resolved.


The session will automatically continue with the next available account.

---

## Advanced Settings

> These settings are for edge cases. Most users don't need to change them.
Expand Down
Loading