Delete Dockerfile.minimal, Dockerfile.simple, and Dockerfile.binary
which were not referenced by CI, scripts, or documentation.
The production Dockerfile remains unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
Change package from 'proxy' to 'main' to match other test files in the
proxy directory. This fixes the package mismatch that prevented tests
from running properly.
Co-Authored-By: Claude <noreply@anthropic.com>
All required changes were already present in docs/plan/plan.md from
commit cadc7da. This note documents verification of acceptance criteria:
- Header versions match proxy/VERSION and dashboard/VERSION
- Tokens panel row includes cache-read/cache-write series
- Collector fields table includes cache token rates
- Docs inventory lists all four new documents
Confirm that test infrastructure in helpers_test.go meets all acceptance criteria:
✅ MockUpstream and CountingMockServer for httptest-based mock upstreams
✅ Request builders (CreateProxyRequest, CreateMessagesRequest, etc.)
✅ Response assertions (AssertStatusCode, AssertJSONBody, etc.)
✅ Test-mode configuration (ConfigureTestEnv, GetTestMaxRetries)
✅ TestHelperFunctions and TestMockUpstreamBasic tests pass
✅ All tests use mock servers, never hit real api.z.ai
The infrastructure was already implemented. This commit validates it works correctly.
Co-Authored-By: Claude <noreply@anthropic.com>
All acceptance criteria verified - TestAdaptiveRateLimiter_BasicBounds
already exists and passes with injected window duration.
Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive test infrastructure for retry/response-validation tests
in proxy package. Provides httptest-based mock upstream server, test
helpers for request/response handling, and test-mode configuration for
fast test execution.
New file: proxy/helpers_test.go
- MockUpstream: Configurable HTTP server simulating Z.AI upstream
- Test scenarios: 429 with/without Retry-After, empty/invalid JSON body,
empty streaming, 422/500/404 responses, network errors, success
- Request builders: CreateProxyRequest, CreateMessagesRequest,
CreateStreaming/NonStreaming* helpers
- Response assertions: AssertStatusCode, AssertJSONBody, AssertResponseField,
AssertEmptyBody, AssertHeader, AssertContentType
- Proxy handler factory: CreateTestProxyHandler for configured test handlers
- Test execution helpers: ExecuteProxyRequest, ExecuteMessagesRequest
- Test-mode config: ConfigureTestEnv, GetTestMaxRetries (defaults to 1 for fast tests)
- Backoff delay helpers: CalculateBackoffDelay, CalculateTotalMaxDelay
Acceptance criteria met:
✅ New test helpers with httptest servers
✅ Helper functions for requests and assertions
✅ Test-mode env var for fast tests (MAX_RETRIES=1 default)
✅ go test ./proxy/ -run TestHelper passes
Co-Authored-By: Claude <noreply@anthropic.com>
- Use NewAdaptiveRateLimiterWithWindow with 10ms window for fast test execution
- Replace manual lastAdjustment manipulation with proper testWindow variable
- Maintain all existing test scenarios and verifications
- Tests now run faster without sleep calls while maintaining correctness
Co-Authored-By: Claude <noreply@anthropic.com>
- TestAdaptiveRateLimiter_BasicState already exists in proxy/ratelimiter_test.go
- All acceptance criteria already met and verified passing
- No code changes required
Co-Authored-By: Claude <noreply@anthropic.com>
- Move go.mod and go.sum from proxy/ to repository root
- Enables running tests with 'go test ./proxy' from project root
- Module path: git.ardenone.com/jedarden/zai-proxy
- Go 1.23 with toolchain go1.24.13
Co-Authored-By: Claude <noreply@anthropic.com>
Bead-Id: bf-1rb
Add NewAdaptiveRateLimiterWithWindow constructor for test-only refactor:
- Production code uses NewAdaptiveRateLimiter with default 30s window
- Tests can inject shorter durations (e.g., 100ms) for fast execution
- No behavior changes to production rate limiting logic
Acceptance criteria:
- NewAdaptiveRateLimiterWithWindow accepts configurable window duration
- Production callers continue using default 30s window
- Tests can inject millisecond-scale windows for fast iteration
- No changes to rate limiting logic or defaults
Co-Authored-By: Claude <noreply@anthropic.com>
- Change description from 'Z.AI Anthropic-compatible API' to 'Z.AI Claude API'
- Z.AI is Claude-native, not merely compatible (per plan.md)
- No other changes needed - metrics, env defaults, and port were already correct
Co-Authored-By: Claude <noreply@anthropic.com>
- Change Kubernetes example image from ghcr.io/ardenone/zai-proxy:latest to ronaldraygun/zai-proxy:1.10.0
- Update namespace references from mcp to devpod (production deployment namespace)
- Fix 'go run main.go tokenizer.go' to 'go run .' (compilable command)
- Update Docker image examples to use version tag 1.10.0 instead of :latest/:dev
- Update cluster DNS from mcp.svc.cluster.local to devpod.svc.cluster.local
Verified against:
- docs/plan/plan.md (CI/CD, Deployment sections)
- proxy/VERSION (current version: 1.10.0)
- proxy/metrics.go (metric names)
- proxy/main.go (env vars)
Co-Authored-By: Claude <noreply@anthropic.com>
Rewrite root README as a provider-agnostic description of the proxy
and dashboard. Remove internal git remote reference. Add quick-start,
environment variable table, and metrics inventory.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All migration items completed:
- Workflow templates pushed to declarative-config (May 17)
- Documentation updated to point to new repo (ardenone-cluster commit 79b9a9cf8)
- Old container directories retired (ardenone-cluster commit 4b4468842)
The zai-proxy project now lives at git.ardenone.com/jedarden/zai-proxy
with CI/CD workflow templates deployed via ArgoCD.
Note: Commit pending push due to Forgejo network connectivity issue.
Bead-Id: bf-4a2
Covers:
- Development environment setup
- Code style and conventions
- Testing requirements (go test, regression tests, benchmarks)
- Commit message conventions (conventional commits)
- Pull request process
- How to add new features or fix bugs
- Documentation guidelines
- Getting help
Bead-Id: bf-4ys
- Document all 5 API endpoints: /healthz, /api/config, /api/status, /api/metrics, /api/events
- Include request parameters, response schemas, and example curl commands
- Document SSE event types and format with code examples in JavaScript and Go
- Add data retention policies, CORS information, and browser usage guidance
- Link to related documentation
Co-Authored-By: Claude <noreply@anthropic.com>
Bead-Id: bf-4rx
- proxy/go.mod: github.com/ardenone/zai-proxy → git.ardenone.com/jedarden/zai-proxy
- dashboard/go.mod: github.com/ardenone/ardenone-cluster/containers/zai-proxy-dashboard → git.ardenone.com/jedarden/zai-proxy/dashboard
- Update all Go import paths in proxy/ and dashboard/ to match new module paths
- Add proxy/evaluation/ package (was missing from initial commit)
- Add docs/plan/plan.md with architecture, security model, telemetry design, and migration checklist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>