Skip to content

fix(agents): address UX/docs issues from #293 (Bedrock, PATCH, unknown fields, trace_id) - #294

Merged
arantespp merged 2 commits into
mainfrom
claude/github-issue-293-v1ngxb
Jun 28, 2026
Merged

fix(agents): address UX/docs issues from #293 (Bedrock, PATCH, unknown fields, trace_id)#294
arantespp merged 2 commits into
mainfrom
claude/github-issue-293-v1ngxb

Conversation

@arantespp

Copy link
Copy Markdown
Member

Summary

Fixes all five issues documented in #293, encountered during a Bedrock AI provider setup session.

  • Fix Feat files #1 — Bedrock plain ABSK secret silently discarded: parseBedrockSecret now treats a raw ABSK… string as { apiKey: value } instead of falling back to {} and producing a confusing SigV4 error.

  • Fix Feat files #2config.api_key silently ignored for Bedrock: buildBedrockModel now uses config.apiKey as a credential fallback when no secret is linked (or when the secret doesn't supply an apiKey). The docs are updated to mention this option.

  • Fix Feat modules #3 — Agent update requires PUT, not PATCH: Added PATCH /agents/:agent_id as a full alias for PUT. Both methods perform partial updates. OpenAPI spec updated; SDK and CLI manifest regenerated.

  • Fix chore: change website name #4 — Unknown agent fields silently ignored: POST /agents and PUT/PATCH /agents/:id now return 400 Unknown field(s): <field> when the request body contains any key not in the allowed set. This catches typos like prompt instead of instructions at the boundary.

  • Fix Chore package name #5trace_id missing from generation 500 errors: recordGenerationFailure now wraps non-DomainError exceptions in a GENERATION_FAILED DomainError (HTTP 500) that carries generation_id and trace_id in meta. Callers hitting a 500 from POST /agents/:id/generate now receive the trace ID they need to query for the root cause.

Changes

File Change
src/lib/agentModel.ts Fix #1 + #2: ABSK fallback and config.apiKey support
src/lib/generationLifecycle.ts Fix #5: wrap non-DomainErrors with GENERATION_FAILED + trace_id
src/errors/codes.ts Add GENERATION_FAILED error code (HTTP 500)
src/rest/v1/agents.ts Fix #3: PATCH route; Fix #4: unknown-field validation for POST + PUT + PATCH
src/rest/openapi/v1/agents.yaml Add PATCH /agents/{agent_id} (patchAgent operation)
packages/website/docs/modules/ai-providers.md Document JSON format requirement and config.api_key fallback
tests/unit/tests/lib/agentModel.test.ts Tests for plain-ABSK and config.apiKey
tests/unit/tests/lib/generationLifecycle.test.ts Tests for GENERATION_FAILED wrapping with trace_id
tests/unit/tests/rest/agents.test.ts Tests for unknown-field 400 and PATCH endpoint

Closes #293


Generated by Claude Code

claude added 2 commits June 28, 2026 02:33
- Fix #1: parseBedrockSecret now treats plain ABSK strings as
  { apiKey: value } instead of silently discarding them

- Fix #2: buildBedrockModel now falls back to config.apiKey when
  no secret is linked, so api_key in the provider config object
  is honoured instead of being silently ignored

- Fix #3: Add PATCH /agents/:agent_id as an alias for PUT, so
  both HTTP methods work for partial agent updates; update OpenAPI
  spec accordingly and regenerate SDK + CLI manifest

- Fix #4: POST and PUT/PATCH /agents reject unknown request body
  fields with 400 "Unknown field(s): ..." to prevent silent data
  loss (e.g. sending prompt instead of instructions)

- Fix #5: recordGenerationFailure now wraps non-DomainErrors in a
  new GENERATION_FAILED DomainError that carries generation_id and
  trace_id in meta, so 500 responses from /agents/:id/generate
  include a trace_id the caller can query for the root cause

- Update ai-providers docs with JSON-format warning and config.api_key note

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTwheo15iV5tcGGWjk8V1z
… threshold

Add a test that passes a plain object (not an Error or DomainError) to
recordGenerationFailure, covering the false branch of the instanceof Error
ternary that was sitting below the 70% branch coverage threshold.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JTwheo15iV5tcGGWjk8V1z
@github-actions

Copy link
Copy Markdown

Deploy Outputs

Package Stack Output Key Output Value
@soat/website SoatWebsite-claude-github-issue-293-v1ngxb BucketWebsiteURL http://soatwebsite-claude-github-issue-293-v-staticbucket-basikfd5fbnx.s3-website-us-east-1.amazonaws.com

@arantespp
arantespp merged commit 31fafc6 into main Jun 28, 2026
4 checks passed
@arantespp
arantespp deleted the claude/github-issue-293-v1ngxb branch June 28, 2026 03:00
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.

UX/docs problems found during Bedrock AI provider setup

2 participants