Skip to content

Function name should be default path name #373

Description

@kfirstri

Today if there's no function JSON file we use the path name as the function name, but if there's a functions JSON file then the name field must be included.. we should make it optional and also use the same path name

@claude please make sure that in the schema of function.json the name field is optional, and if empty calculate it in the same way we do for functions without a a json file

Activity

  1. self-assigned this
    on Mar 8, 2026
  2. added theissue type on Mar 8, 2026
  3. claude commented on Mar 8, 2026

    @claude
    Contributor

    Claude finished @kfirstri's task in 2m 35s —— View job • claude/issue-373-20260308-0922 • Create PR ➔


    Done

    • Gather context and understand the request
    • Find function schema and path-name calculation logic
    • Make name field optional in FunctionConfigSchema
    • Update readFunction to compute path-based name when name is absent
    • Add test fixture and test case
    • Run typecheck/tests (106 core tests pass)
    • Commit and push changes

    Changes made

    src/core/resources/function/schema.ts

    • FunctionConfigSchema.name changed from required to optional
    • BackendFunctionSchema now overrides name back to required, ensuring all resolved functions always have a name

    src/core/resources/function/config.ts

    • readFunction now accepts functionsDir as a second parameter
    • When config.name is absent, computes the path-based name using relative(functionsDir, functionDir) — identical to how zero-config functions are named

    tests/

    • Added tests/fixtures/function-discovery/no-name-in-config/function.jsonc (no name field) + entry.ts
    • Added a test verifying the path-based name fallback works for config-based functions without a name
    • Updated expected function count from 4 → 5
  4. added a commit that references this issue on Mar 8, 2026
    0a641f5
  5. moved this from Backlog to In progress in CLI Developmenton Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions