Skip to content

fix: Simplify propose_content tool and add allocation perspective#799

Merged
bokelley merged 4 commits into
mainfrom
bokelley/add-allocation-perspective
Jan 17, 2026
Merged

fix: Simplify propose_content tool and add allocation perspective#799
bokelley merged 4 commits into
mainfrom
bokelley/add-allocation-perspective

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Add new perspective article: "Agentic Advertising is for Allocation"
  • Fix URL-encoded Slack interactive payload parsing in Addie /events endpoint
  • Add logging for Addie tool errors and error-like results
  • Simplify propose_content tool schema by removing confusing "personal" vs "committee" distinction

Key Changes

propose_content Tool Simplification

The tool schema previously had a confusing nested collection object:

{
  "collection": {
    "type": "personal" | "committee",
    "committee_slug": "..."
  }
}

This was misleading because:

  1. There's no "personal" collection - migration 153 moved all personal content to the editorial working group
  2. The "personal" option was just syntactic sugar for committee_slug: 'editorial'

New schema:

{
  "committee_slug": "editorial"  // defaults to editorial (Perspectives) if omitted
}

The handler maintains backward compatibility with the legacy format and validates that committee_slug is provided when using collection.type='committee'.

Other Fixes

  • Slack payload parsing: Handle URL-encoded payload=... format for interactive components
  • Error logging: Log tool exceptions (ERROR) and error-like results (WARN) for debugging

Test plan

  • All existing tests pass
  • TypeScript type checking passes
  • Code review completed and suggestions addressed

🤖 Generated with Claude Code

bokelley and others added 4 commits January 16, 2026 17:19
Adds Brian O'Kelley's article as a link-type perspective with the
quote "OpenRTB is a protocol for day trading; AdCP is a protocol for
investing" from Benjamin Masse.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Slack sends interactive component payloads (button clicks, modal
submissions) as URL-encoded form data (payload={json}), not raw JSON.
The /events endpoint was only parsing JSON, causing "Unexpected token 'p'"
errors when interactive payloads arrived.

Now checks if body starts with "payload=" and decodes it appropriately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously, when tools returned error strings (like "Failed to create
content: ...") or threw exceptions, these weren't logged. Now we log:
- ERROR level: when tools throw exceptions
- WARN level: when tools return error-like results

This will help debug issues like the content submission failure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The tool schema had a confusing nested 'collection' object with type:
'personal' | 'committee'. This was misleading because:

1. There's no "personal" collection - migration 153 moved all personal
   content to the 'editorial' working group
2. All content goes to a working group - the only question is which one
3. The 'personal' option was just syntactic sugar for 'editorial'

Changes:
- Replace nested collection object with simple committee_slug parameter
- Default to 'editorial' (site-wide Perspectives section) if not specified
- Maintain backward compatibility with legacy collection format
- Add validation for legacy format to prevent silent wrong-collection errors
- Update description to accurately describe the content system

The content system:
- 'editorial' committee = site-wide Perspectives section (accepts public submissions)
- Other committees = working groups, councils, chapters (may require membership)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 6716a07 into main Jan 17, 2026
6 checks passed
bokelley added a commit that referenced this pull request Jan 20, 2026
* feat: Add 'Agentic Advertising is for Allocation' perspective

Adds Brian O'Kelley's article as a link-type perspective with the
quote "OpenRTB is a protocol for day trading; AdCP is a protocol for
investing" from Benjamin Masse.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Handle URL-encoded interactive payloads in Addie /events endpoint

Slack sends interactive component payloads (button clicks, modal
submissions) as URL-encoded form data (payload={json}), not raw JSON.
The /events endpoint was only parsing JSON, causing "Unexpected token 'p'"
errors when interactive payloads arrived.

Now checks if body starts with "payload=" and decodes it appropriately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Add logging for Addie tool errors

Previously, when tools returned error strings (like "Failed to create
content: ...") or threw exceptions, these weren't logged. Now we log:
- ERROR level: when tools throw exceptions
- WARN level: when tools return error-like results

This will help debug issues like the content submission failure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Simplify propose_content tool schema

The tool schema had a confusing nested 'collection' object with type:
'personal' | 'committee'. This was misleading because:

1. There's no "personal" collection - migration 153 moved all personal
   content to the 'editorial' working group
2. All content goes to a working group - the only question is which one
3. The 'personal' option was just syntactic sugar for 'editorial'

Changes:
- Replace nested collection object with simple committee_slug parameter
- Default to 'editorial' (site-wide Perspectives section) if not specified
- Maintain backward compatibility with legacy collection format
- Add validation for legacy format to prevent silent wrong-collection errors
- Update description to accurately describe the content system

The content system:
- 'editorial' committee = site-wide Perspectives section (accepts public submissions)
- Other committees = working groups, councils, chapters (may require membership)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <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.

1 participant