Skip to content

feat: Dakera server 0.12.2 commands (dk 0.8.1) - #155

Merged
ferhimedamine merged 2 commits into
mainfrom
claude/dakera-deploy-issues-audit-gfm5yq
Oct 8, 2026
Merged

ferhimedamine merged 2 commits into
mainfrom
claude/dakera-deploy-issues-audit-gfm5yq

Conversation

@ferhimedamine

@ferhimedamine ferhimedamine commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds dk commands and flags for Dakera server v0.12.2 (Dakera-AI/dakera#916). Version 0.8.0 → 0.8.1.

The CLI stays compatible with v0.11.108, v0.12.0 and v0.12.1. The new commands need a v0.12.2 server. On v0.12.0 or v0.12.1 they either fail with no route (exit 3 or 1), or the server ignores the new flag. Where it matters, dk says so: keys rotate --grace warns that the old key was deactivated at once, and admin session-idle-timeout reports that the server predates the setting. The README has a compatibility table per command.

How this depends on the new SDK

dk used dakera-client = "0.12" from crates.io. The new commands use dakera-client 0.12.2 (Dakera-AI/dakera-rs#170), now published on crates.io. Cargo.toml pins dakera-client = "0.12.2". While the SDK was unpublished, this PR temporarily used a git dependency on the dakera-rs PR branch; commit 3d90800 switched it back.

The new commands call the API through the SDK (create_agent, update_key / update_namespace_key, rotate_key_with_grace, whoami, start_session_with, touch_session, agent_memories_with, session_memories_with, derivations_status, drain_derivations, get_config / set_session_idle_timeout). The one exception is knowledge full-graph --preview, which adds the field to the existing raw REST call.

Changes

  • dk whoami calls GET /v1/auth/whoami. It shows scope, grants, unrestricted, the grant syntax version and inert grants.
  • dk agent create <agent_id> calls POST /v1/agents. It is idempotent.
  • dk keys edit <key_id> (alias patch):
    • Calls PATCH /admin/keys/{id}, or with -n <ns>, PATCH /v1/namespaces/{ns}/keys/{id}.
    • Flags: --name, --namespaces a,b (p* patterns allowed), --all-namespaces (sends null), --no-namespaces (sends []).
    • With nothing to change it exits 5 without sending a request.
  • dk keys rotate --grace <duration> accepts up to 7 days and shows the new key id and the old key's deadline.
  • dk session touch <id> and dk session start --idle-timeout <duration> (0 = never, at most 30 days).
  • Listing flags:
    • --preview <chars> (1–10000) on agent memories, session memories and knowledge full-graph. The memory listings gain CONTENT_LEN and TRUNCATED columns and a hint to use dk memory get for the full text.
    • --include-derived on agent memories.
    • --offset on both memory listings; --limit on session memories.
  • Admin: dk admin derivations-status, dk admin derivations-drain [--timeout], and dk admin session-idle-timeout [<duration>] (show or set). These follow the CLI's flat admin <name> style.
  • Durations accept s, m, h, d suffixes. dk session list shows ended_reason. Shell completions and the README cover the new commands.
  • Fixes:
    • dk keys rotate never printed the new key: it read key, but the server answers new_key.
    • dk session memories printed total: 0.
    • SDK InvalidRequest errors now exit 5.
    • Pre-existing clippy findings in test code (items_after_test_module, field_reassign_with_default, …) are fixed so cargo clippy --all-targets -- -D warnings passes.
  • CHANGELOG documents the server behaviour changes users may hit:
    • Sessions are authorized by their agent, and session end with a Read key now returns 403.
    • Validation is stricter (400s name the field).
    • The content limit is counted in bytes.
    • Listings exclude derived records unless include_derived=true.
    • Sessions auto-end after 4 h idle by default.

Testing

  • cargo check passes
  • cargo clippy -- -D warnings passes (also --all-targets)
  • cargo fmt --check passes
  • cargo test passes: 318 passed, 22 ignored (live-server tests). That includes the new tests/v0122.rs (26 httpmock tests of the compiled dk) and unit tests for the new flags. The route audit list gains the v0.12.2 routes. Re-run against the published dakera-client 0.12.2: all pass.
  • Manually tested against a running Dakera server (not done here; mock server only)

Checklist

  • Updated CHANGELOG.md
  • Updated documentation (README commands and the v0.12.2 compatibility table)
  • No breaking changes to existing commands. Additive only: JSON rows of session list gain ended_reason, and the memory listings gain content_len / truncated only with --preview.
  • dakera-client is the published 0.12.2 (3d90800)

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZHVK5VC49gnBM7bueRH88

claude added 2 commits October 8, 2026 11:15
dk whoami, dk agent create, dk keys edit (alias patch; --name,
--namespaces, --all-namespaces, --no-namespaces, -n for the namespace
route), dk keys rotate --grace, dk session touch, dk session start
--idle-timeout, --preview / --include-derived / --offset on the memory
listings and --preview on knowledge full-graph, dk admin
derivations-status / derivations-drain / session-idle-timeout.

Built on dakera-client 0.12.2, taken from the dakera-rs PR branch as a
git dependency until that version is published on crates.io; switch it
back to dakera-client = "0.12.2" before merge. Also fixes dk keys rotate
(it read `key`, the server answers `new_key`), the session memories
total, and the pre-existing clippy findings in test code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ZHVK5VC49gnBM7bueRH88
The SDK release is on crates.io, so the temporary git dependency on the
dakera-rs PR branch goes back to a registry version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ZHVK5VC49gnBM7bueRH88
@ferhimedamine
ferhimedamine merged commit f2eae47 into main Oct 8, 2026
12 checks passed
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