Skip to content

Feat files - #1

Closed
arantespp wants to merge 26 commits into
mainfrom
feat-files
Closed

Feat files#1
arantespp wants to merge 26 commits into
mainfrom
feat-files

Conversation

@arantespp

Copy link
Copy Markdown
Member

No description provided.

@arantespp

Copy link
Copy Markdown
Member Author

@copilot fix server tests

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

@copilot fix server tests

Fixed in commit 960b063.

The root cause was that setupFilesAfterEnv.ts loads src/app (and transitively src/lib/embedding) before test-file mocks are applied. Using jest.mock with a factory creates a new module object but doesn't update the already-captured reference in src/lib/documents.ts, so getEmbedding was still calling the real Ollama endpoint and failing with TypeError: fetch failed.

Switched to jest.spyOn(embeddingModule, 'getEmbedding').mockResolvedValue(...) in the beforeAll of both documents.test.ts and conversations.test.ts. This modifies the property on the existing (already-loaded) module object directly, so all code holding a reference to that module gets the mock.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ttoss.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@arantespp arantespp closed this Apr 13, 2026
arantespp added a commit that referenced this pull request Jun 24, 2026
…y embedding docs (#252)

Fix #2 — memory_name in knowledge results:
- Add memoryName to MemoryKnowledgeResult (both semantic and non-search
  paths in knowledgeMemory.ts); the Memory association is already loaded, so
  no extra query.
- Add required memory_name to the OpenAPI MemoryKnowledgeResult schema;
  regenerate SDK/CLI (generated files are gitignored, rebuilt in CI).
- Inject context label now uses the human name: [Memory: <name>] instead of
  the opaque [Memory: <id>] (agentKnowledge.ts).
- Tests: assert memory_name in REST knowledge search; label test expects the
  memory name.

Fix #1 — memory embedding resilience (docs only):
- The code already aligns memory to documents (MemoryEntry.embedding is
  nullable and writeMemoryEntry is non-fatal on embedding failure). The PRD
  was stale: correct prd-memories.md (NOT NULL -> NULL, write-algorithm
  STEP 1 non-fatal note, design-principle wording).

Docs: prd-knowledge.md response examples and knowledge.md data model gain
memory_name.

Verified: pnpm --filter @soat/server typecheck, eslint --fix, and the full
test suite (76 suites / 1641 tests) pass against a local Postgres + pgvector.


Claude-Session: https://claude.ai/code/session_01ErUBchseZrpYysrq5rZMNF

Co-authored-by: Claude <noreply@anthropic.com>
arantespp added a commit that referenced this pull request Jun 28, 2026
…n fields, trace_id) (#294)

* fix(agents): address UX/docs issues from issue #293

- 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

* test(generationLifecycle): cover non-Error thrown value to fix branch 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

---------

Co-authored-by: Claude <noreply@anthropic.com>
arantespp added a commit that referenced this pull request Jul 14, 2026
* feat(approvals): add the approval orchestration node producer

Wires producer #1 from the Approvals PRD: an `approval` orchestration
node that parks a run for a human decision through the approvals queue.

- New `approval` node type (orchestrations): resolves tool_id/arguments/
  reasoning/evidence/predicted_impact/expires_in against run state and
  parks the run as awaiting_input, like a human node.
- The engine emits an ApprovalItem (origin=node, linked to run+node) when
  the run settles into awaiting_input, stamping approval_id/expires_at onto
  the persisted required_action.
- Resolution resumes the parked run via a producer-registered callback, so
  approvals never imports the engine (dependency points engine -> approvals).
  The decision (approved|rejected|expired) becomes the node's branch label:
  labeled edges route by decision; an unlabeled edge follows only on
  approval. Server-side expiry routes the run down its expired edge.
- OpenAPI node schema, validation (approval requires tool_id), module docs,
  and an end-to-end integration test (park -> approve/reject/expire ->
  resume + route).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDwNa8xgN4HGPbnchuuG82

* test(approvals): poll for terminal run status in expiry node test

The expiry sweeper resumes the run detached, so the run transitions
through a transient 'running' state. Poll until a terminal status rather
than just leaving 'awaiting_input', which raced the resume.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDwNa8xgN4HGPbnchuuG82

* test(approvals): cover approval-node mapping resolver branches

Adds a direct unit test for executeApprovalNode covering the full/absent
mapping cases, default vs explicit expiry, null/non-object coercion, and
the missing-toolId guard — clearing the per-file branch threshold and the
global 100% function-coverage threshold. All 2996 tests already pass; the
job was failing on coverage only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDwNa8xgN4HGPbnchuuG82

* test(server): raise global branch coverage threshold to 89.65

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDwNa8xgN4HGPbnchuuG82

---------

Co-authored-by: Claude <noreply@anthropic.com>
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