Skip to content

feat(zendesk): call the Claude API instead of the Claude Code CLI - #79

Merged
Bilb merged 4 commits into
mainfrom
feat/zendesk-anthropic-api
Oct 20, 2026
Merged

Bilb merged 4 commits into
mainfrom
feat/zendesk-anthropic-api

Conversation

@Bilb

@Bilb Bilb commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces claude --print with the Anthropic SDK for every Zendesk Claude call: the digest's classification, the English transcripts and the claude: notes.

  • zendesk/claude_cli.py → zendesk/claude_api.py: one streamed request per call, schema enforced with output_config.format, same effort levels, 128K output ceiling.
  • Model: the newest claude-opus-* from the Models API, resolved once per process. No pinned id.
  • Failures exit with an Claude API … line; the alert tells a refused key to go in /etc/session-ops/zendesk.env and an exhausted balance to be topped up, instead of the old /login advice.
  • anthropic>=1.15 added. The digest job requires ANTHROPIC_API_KEY. The digest unit and zendesk-relay.service no longer get /home/zendesk.
  • Docs and zendesk.env.example updated; CLI install steps removed from deploy/README.md.

Not yet run against the live API: structured outputs may be stricter about the schemas than --json-schema was, so a dry-run digest and a RELAY_DRY_RUN=1 draft are still to do before merge.

Deploy: add ANTHROPIC_API_KEY= to /etc/session-ops/zendesk.env, re-run install.sh to regenerate the drop-ins, restart zendesk-relay.

token-expiry no longer checks CLAUDE_CODE_OAUTH_TOKEN or loads zendesk.env; the [issued] table in expiry.toml is gone. After deploy, remove CLAUDE_CODE_OAUTH_TOKEN and the old PATH= line from /etc/session-ops/zendesk.env, and any [issued.CLAUDE_CODE_OAUTH_TOKEN] block from /etc/session-ops/expiry.toml.

Bilb added 4 commits October 20, 2026 10:35
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
@Bilb
Bilb merged commit f344862 into main Oct 20, 2026
3 checks passed
@Bilb
Bilb deleted the feat/zendesk-anthropic-api branch October 20, 2026 00:48
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