Skip to content

fix: name port 6060 in the base URL hint, and make the README match the SDK - #6

Merged
Alex (Alexkuva) merged 7 commits into
mainfrom
fix/readme-and-error-hints
Oct 14, 2026
Merged

Alex (Alexkuva) merged 7 commits into
mainfrom
fix/readme-and-error-hints

Conversation

@Alexkuva

Copy link
Copy Markdown
Contributor

What does this PR change?

  • The address hint names port 6060. A client built without an address raises an error that suggested http://localhost:6000. The error, the base_url docstring, the playbook and its guide now say http://localhost:6060 (/api is appended as before). _sync/ is regenerated from _async/.
  • The README's first example runs. It built KaitenClient(token=...) without base_url, which has no default, so it raised that very error. The same line in the package and client docstrings follows.
  • The README no longer describes a flag evaluation the SDK does not have. FlagEvaluationError leaves the error tree, "flag evaluations" the retry table, the fallback warning the Logging section, and client.flags the API reference. The SDK leaves evaluation to OpenFeature, as the README says elsewhere.
  • Two statements made exact. The OpenFeature manifest holds the flags whose metadata sets a fallback_value, not every flag. A refused argument (a missing base_url, a datetime without a timezone, a usage value that is not a number) raises ValueError or TypeError, not a KaitenError.
  • Three tests tie the README's first examples, its error tree and its API reference to the package, so the prose cannot drift again unnoticed.

No behaviour, public name or generated model changes; no version bump. CHANGELOG.md is left alone: it has no unreleased section on main, and #5 adds one at the same line.

Why?

Following the README from the top failed on the first snippet, and the error it produced pointed at a port a Community Edition API does not listen on. The README also promised an exception, a namespace and a log record that do not exist in 1.0.0.

Testing

  • pytest: 747 passed (744 on main, plus the three new tests), on Python 3.10 to 3.14 and on the lowest direct dependencies.
  • ruff check, ruff format --check, mypy, and both generation checks (generate_models.py --check, unasync.py --check) are clean; uv build and twine check --strict pass.
  • Every python block of the README was executed in order against a fake API built from openapi/, with no socket opened: 21 blocks, 41 requests, each body valid against its schema. The same run on main fails on the first block.
  • A trial merge with feat: usage report transaction IDs and the usage history #5 is clean; the two only meet in README.md and src/kaitencloud/__init__.py, on different lines.

Checklist

  • I have read CONTRIBUTING.md.
  • Every commit in this PR includes a valid DCO Signed-off-by line.
  • I have the right to submit all material in this PR.
  • I have not included secrets or confidential data.
  • I have updated tests where appropriate.
  • I have updated documentation where appropriate.
  • I have preserved required third-party licenses and attributions.

🤖 Generated with Claude Code · ✅ Tested and approved by Alex (@Alexkuva), maintainer

Alex (Alexkuva) and others added 7 commits October 13, 2026 23:51
A client built with no address raises "No Kaiten API address: pass
base_url=... (your deployment's, e.g. http://localhost:6000)". Nothing
answers on 6000: a Community Edition API listens on 6060, under
http://localhost:6060/api. The same address was in the client's docstring
and in the playbook.

- src/kaitencloud/_async/client.py: the ValueError hint and the base_url
  docstring name http://localhost:6060; _sync/client.py is regenerated.
  /api is still appended when missing, so the hint resolves to
  http://localhost:6060/api/.
- examples/README.md, examples/playbook.py: the KAITEN_BASE_URL export and
  the --base-url help.
- tests/test_client.py: the base URL case with a port uses the same one.

Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README opens with KaitenClient(token="ksh_..."), and the package and
client docstrings show the same line. There is no default API address, so
it raises ValueError unless KAITEN_BASE_URL happens to be set, which the
README only says eighty lines further down.

- README.md: the opening example passes base_url, as the Quick start does.
- src/kaitencloud/__init__.py, src/kaitencloud/_async/client.py: the two
  docstring examples do too; _sync/client.py is regenerated.

Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK defines flags and leaves their evaluation to OpenFeature, as the
README's own Feature flags section says. Four other places still described
an evaluation client:

- README.md, Errors: FlagEvaluationError is not an exception of the
  package. The tree now ends APIStatusError on InternalServerError.
- README.md, Retries and timeouts: "flag evaluations" are not among the
  retried requests, since the SDK sends none. The rest of the row matches
  the calls marked safe to repeat.
- README.md, Logging: the only record the package logs is a retry, at INFO.
  Nothing is logged at WARNING about a flag falling back to its default;
  examples/README.md and the playbook's --verbose help said the same.
- README.md, API reference, and the FeatureFlags docstring: there is no
  client.flags. The docstring points at OpenFeature instead;
  _sync/resources/feature_flags.py is regenerated.

Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README and the manifest() docstring said the manifest returns every
flag. The contract in openapi/openapi.yaml says otherwise: it "returns a
manifest of all feature flags that have a fallback_value set in their
metadata". A flag without one is absent, and a reader generating typed
accessors from the manifest would not learn why.

- README.md, Feature flags: the manifest holds each flag whose metadata
  sets a fallback_value.
- src/kaitencloud/_async/resources/feature_flags.py: the same in the
  docstring; _sync/resources/feature_flags.py is regenerated.

Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README said every exception derives from KaitenError. A client built
with no base_url raises a plain ValueError, as the first example did until
it was given one, and so do a malformed address, a datetime without a
timezone and an empty slug; a usage value that is not a number raises
TypeError. An `except KaitenError` catches none of them.

- README.md, Errors: the tree is of the exceptions the SDK defines, and a
  sentence under it names what a refused argument raises instead.

Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tests/test_readme.py parses the README's python blocks and checks the
names they import and call. The three defects just corrected sat outside
its reach: an example that parses but cannot run without an environment
variable, an exception in a text block, a namespace in a <summary>.

- The examples shown before the README says KAITEN_BASE_URL is assumed
  must pass base_url and token to the client they build.
- Every name in the error tree is an exception the package exports, under
  KaitenError. The tree need not list them all.
- Every namespace and method the API reference names exists on the client.

Each of the three fails on the README as released in 1.0.0.

Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Alexkuva
Alex (Alexkuva) requested a review from a team as a code owner October 14, 2026 18:51
@Alexkuva
Alex (Alexkuva) merged commit a782a11 into main Oct 14, 2026
13 checks passed
@Alexkuva
Alex (Alexkuva) deleted the fix/readme-and-error-hints branch October 14, 2026 19:12
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.

3 participants