Skip to content

v0.6.0 — tags and times, listing by filter, one error contract

Choose a tag to compare

@MelloB1989 MelloB1989 released this 04 Oct 17:00
c891b8f

Breaking

  • http_error becomes http_<status>. An error response whose body
    names no code is coded http_429, http_500 and so on. Any error object
    is the API's envelope: its code and message win, each falling back to
    http_<status> and the status text. Without one, the message is a flat
    {"error":"..."}'s text, else the body's message, else its text up to
    300 characters, else the status text.
  • unauthorized. A 401 or 403 with no error object, which is the gateway
    refusing a missing or bad key, is coded unauthorized, with a message
    pointing at GITLOOM_API_KEY or the key passed to the client. Before, it
    was http_error with the gateway's body.
  • missing_api_key before any request. With no key, or only whitespace,
    from New or GITLOOM_API_KEY, every call returns an *APIError coded
    missing_api_key with Status 0, where it used to send Bearer and get
    the gateway's 401. A blank key passed to New now falls back to
    GITLOOM_API_KEY.
  • The key is trimmed, and invalid_api_key. New trims surrounding
    whitespace from the key, so a pasted trailing newline no longer fails. A
    key that still holds whitespace or a control character returns an
    *APIError coded invalid_api_key with Status 0 from the first request,
    and is never sent, where it used to fail with net/http's "invalid header
    field value".
  • Recall with no query and no filter returns ErrNoQuery without a
    request, where it used to return the API's 400 missing_query.
  • Network failures read gitloom: network error:, gitloom: timed out:
    or gitloom: canceled: where they read gitloom: GET /v1/...:.

Added

  • Tags and when it happened, on every write. NewMemory and
    RememberOptions take OccurredAt, a When: At(t) for an instant, sent
    as epoch seconds; Unix(sec); Day(y, m, d) for a calendar day; or
    Date(s) for text the server reads. RememberOptions also takes Tags,
    applied to every memory drawn from the conversation, and Timezone, which
    WriteOptions takes too. The Date fields still work and are deprecated.
  • Recall without a question. An empty query with any filter — Tags,
    TagsAll, Since, Until, Tiers or Paths — lists every memory it
    matches, newest first, each scoring 1.
  • RecallOptions.TimeField and TZ. TimeField (TimeOccurred,
    TimeCreated or TimeUpdated) picks the time Since and Until bound and
    orders a listing. TZ is sent for parity: Since and Until go as UTC
    instants, so it never changes the range.
  • Memory times. A Memory carries UserTags, and CreatedAt,
    UpdatedAt, OccurredAt and ExpiresAt as time.Time, zero when absent,
    with OccurredSource and OccurredPrecision. The Created and Updated
    strings remain, deprecated. A Memory marshals back to the API's shape, so
    a result kept as JSON reads back. StoredMemory, what Get returns,
    carries the same. Times read from unix seconds or, should a response carry
    them so, RFC 3339; the SDK never asks for time_format.
  • APIError.RetryAfter holds a 429's Retry-After in delta-seconds,
    digits only, and is zero when there is none, or it is a date or signed.
    Nothing is retried for you.
  • Network failures say so. They stay the wrapped cause, not an
    *APIError, and read gitloom: timed out:, gitloom: canceled: or
    gitloom: network error:. The README's Errors section says how to tell
    them apart. No error holds the API key.
  • RecallOptions takes Rank, MaxChars and Model, for Recall and
    Answer alike. Rank (RankFused or RankJev) retrieves on the lane
    path, which also reaches conversation turns and the dates in a question;
    MaxChars caps the memory content returned; Model (ModelHaiku or
    ModelSonnet) picks the reader in ModeSummary or ModeAgentic. None is
    sent unless set, so existing calls are unchanged.
  • Lane-path fields. A Memory carries Store, Said and Excerpted;
    the result carries Rank and RankFallback, and Timings the lane path's
    EmbedMillis, LanesMillis, RankMillis and per-lane Lane.