Repository navigation
feat(zendesk): call the Claude API instead of the Claude Code CLI - #79
Merged
Merged
Conversation
Every Zendesk Claude call (digest classification, transcripts, claude: notes) now goes through the Anthropic SDK with structured outputs, on the newest Opus resolved from the Models API. Authentication is ANTHROPIC_API_KEY from zendesk.env; the CLI, its login and the /home/zendesk bind are gone. Claude-Session: https://claude.ai/code/session_01Rq44MGw9nHuwYAjFYr8tGL
The Zendesk jobs authenticate with an API key, which does not expire, so the first-seen fingerprinting, the [issued] table and the zendesk.env env file have nothing left to check. Claude-Session: https://claude.ai/code/session_01Rq44MGw9nHuwYAjFYr8tGL
A failed model lookup in note_reply's main() exited before any note was written, and stopped solve and reply, which never call Claude. claude_json now resolves the newest Opus itself, inside the callers' existing failure handling. Claude-Session: https://claude.ai/code/session_01EZqfmPqVe37M8zBKY4udPb
mpretty-cyro
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
claude --printwith the Anthropic SDK for every Zendesk Claude call: the digest's classification, the English transcripts and theclaude:notes.zendesk/claude_cli.py→zendesk/claude_api.py: one streamed request per call, schema enforced withoutput_config.format, same effort levels, 128K output ceiling.claude-opus-*from the Models API, resolved once per process. No pinned id.Claude API …line; the alert tells a refused key to go in/etc/session-ops/zendesk.envand an exhausted balance to be topped up, instead of the old/loginadvice.anthropic>=1.15added. The digest job requiresANTHROPIC_API_KEY. The digest unit andzendesk-relay.serviceno longer get/home/zendesk.zendesk.env.exampleupdated; CLI install steps removed fromdeploy/README.md.Not yet run against the live API: structured outputs may be stricter about the schemas than
--json-schemawas, so a dry-run digest and aRELAY_DRY_RUN=1draft are still to do before merge.Deploy: add
ANTHROPIC_API_KEY=to/etc/session-ops/zendesk.env, re-runinstall.shto regenerate the drop-ins, restartzendesk-relay.token-expiryno longer checksCLAUDE_CODE_OAUTH_TOKENor loadszendesk.env; the[issued]table inexpiry.tomlis gone. After deploy, removeCLAUDE_CODE_OAUTH_TOKENand the oldPATH=line from/etc/session-ops/zendesk.env, and any[issued.CLAUDE_CODE_OAUTH_TOKEN]block from/etc/session-ops/expiry.toml.