Skip to content

feat(sdk): add agent state, conditions, drain/undrain#33

Merged
retr0h merged 2 commits intomainfrom
feat/agent-state-drain-conditions
Mar 6, 2026
Merged

feat(sdk): add agent state, conditions, drain/undrain#33
retr0h merged 2 commits intomainfrom
feat/agent-state-drain-conditions

Conversation

@retr0h
Copy link
Collaborator

@retr0h retr0h commented Mar 5, 2026

Summary

  • Add State, Conditions, and Timeline fields to the Agent domain type
  • Add Drain() and Undrain() methods to AgentService for managing agent job acceptance
  • Add ConflictError (409) to the typed error hierarchy
  • Move TimelineEvent to shared types.go (used by both agent and job types)
  • Regenerate client from updated API spec (adds drain/undrain endpoints, node conditions, timeline events)

Test plan

  • Unit tests for agentFromGen covering state, conditions, and timeline (including error events)
  • Public tests for Drain() and Undrain() service methods
  • Public tests for ConflictError (409)
  • Tests for checkError 409 handling
  • Verify CI passes

🤖 Generated with Claude Code

Add State, Conditions, and Timeline fields to the Agent domain type.
Add Drain() and Undrain() methods to AgentService for managing agent
job acceptance. Add ConflictError (409) to the typed error hierarchy.
Move TimelineEvent to shared types.go since it is used by both agent
and job types. Regenerate client from updated API spec.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

Thank you for contributing to this project! 😊🕹️

Merge split test methods (TestFoo, TestFooError, TestFooNilResponse)
into single table-driven methods per function under test. Reduces
~150 suite methods to ~45 while preserving all 290 test cases.

Add explicit one-suite-method-per-function rule to CLAUDE.md and
docs/development.md to prevent future fragmentation.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@retr0h retr0h merged commit 11cb339 into main Mar 6, 2026
5 checks passed
@retr0h retr0h deleted the feat/agent-state-drain-conditions branch March 6, 2026 00:22
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #33   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines         1425      1484   +59     
=========================================
+ Hits          1425      1484   +59     
Files with missing lines Coverage Δ
pkg/osapi/agent.go 100.00% <100.00%> (ø)
pkg/osapi/agent_types.go 100.00% <100.00%> (ø)
pkg/osapi/errors.go 100.00% <100.00%> (ø)
pkg/osapi/job_types.go 100.00% <ø> (ø)
pkg/osapi/response.go 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4896d2...afcd9cc. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant