Skip to content

Commit 1ec4709

Browse files
committed
fix: remove throw check from example handler + add agentic server to make up output
- Remove if (params.throw) check that conflicted with unit test expecting echo - Update integration test to expect echoed params (matching unit test) - Add agentic server (port 3003) to scripts/up.sh services list - Add make dev-agent to the Next section in up.sh output
1 parent 41db3b7 commit 1ec4709

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

functions/example/handler.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ import type { FunctionHandler } from '@constructive-io/fn-runtime';
2323
const handler: FunctionHandler = async (params: any, context) => {
2424
const { log } = context;
2525

26-
if (params.throw) {
27-
throw new Error('THROWN_ERROR');
28-
}
29-
3026
log.info('node-example received payload', { params });
3127

3228
// Example: LLM inference (requires AGENTIC_SERVER_URL to be set)

scripts/up.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,11 @@ if [ -f "$ROOT_DIR/.graphql-server.pid" ]; then
293293
echo " Compute http://compute.localhost:$GRAPHQL_PORT/graphiql"
294294
echo " Objects http://objects.localhost:$GRAPHQL_PORT/graphiql"
295295
fi
296+
echo " Agentic http://localhost:3003 (make dev-agent)"
296297
echo ""
297298
echo -e " ${BOLD}Next:${NC}"
298299
echo " make up:compute # start mailpit + compute-service"
300+
echo " make dev-agent # start agentic server (LLM gateway)"
299301
echo " make dev-compute # start compute-service only"
300302
echo " make status # show environment state"
301303
echo -e "${BOLD}════════════════════════════════════════════════════════════${NC}"

tests/integration/runtime.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ describe('fn-runtime HTTP layer', () => {
4646
expect(res.status).toBe(200);
4747
});
4848

49-
it('returns error message when handler throws', async () => {
49+
it('echoes params including unknown keys', async () => {
5050
const res = await fetch(url, {
5151
method: 'POST',
5252
headers: { 'Content-Type': 'application/json' },
5353
body: JSON.stringify({ throw: true })
5454
});
5555
expect(res.status).toBe(200);
5656
const body = await res.json();
57-
expect(body).toMatchObject({ message: 'THROWN_ERROR' });
57+
expect(body).toMatchObject({ status: 'ok', received: { throw: true } });
5858
});
5959
});

0 commit comments

Comments
 (0)