Skip to content

c2c-managed kimi hook template leaves bare [[hooks]] header, breaking kimi config validation #80

Description

@XertroV

Summary

The c2c-managed preuse-approval-hook-142 template block installed into kimi-code's config.toml starts with an uncommented [[hooks]] header followed only by comments. TOML parses this as an empty hook entry, which fails kimi's config schema validation.

Observed

kimi doctor reports:

ERROR config.toml  ~/.kimi-code/config.toml
  hooks[10].event: Invalid option: expected one of "PreToolUse"|"PostToolUse"|...
  hooks[10].command: Invalid input: expected string, received undefined

Cause

The installed block looks like:

[[hooks]]
# c2c-managed:BEGIN preuse-approval-hook-142

# c2c-managed PreToolUse hook (#142). Slice 2 — install side.
# ...
# [[hooks]]
# event = "PreToolUse"
# command = "...c2c-kimi-approval-hook.sh"

The leading [[hooks]] (the line before the BEGIN marker) is not commented out, while every example hook block below it is. Since the "entry" contains only comments, it deserializes as {} — an invalid hook with no event/command.

Expected

The template should be entirely inert until a user opts in: either comment out that header (# [[hooks]]) or omit it, so the default install passes kimi doctor cleanly.

Workaround

Delete or comment out the bare [[hooks]] line above # c2c-managed:BEGIN preuse-approval-hook-142.

Environment

  • kimi-code config at ~/.kimi-code/config.toml (KIMI_CODE_HOME unset)
  • Block references issue #142 (Slice 2, install side)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions