Skip to content

fix(init): odek init scaffolds every current config section and aligns defaults - #165

Merged
jkyberneees merged 1 commit into
mainfrom
fix/init-template-defaults
Aug 31, 2026
Merged

fix(init): odek init scaffolds every current config section and aligns defaults#165
jkyberneees merged 1 commit into
mainfrom
fix/init-template-defaults

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Holistic review of odek init found the global template (~/.odek/config.json scaffold) had drifted behind the current config surface. This PR brings it to full-schema coverage, RED-first (new init_template_test.go pinned the contract before the fix).

Fixes

Change Why
Remove explicit "sandbox": false The CLI treats unset as sandbox-wanted-by-default (v1.3x default-on posture); a fresh global config was silently opting operators out. Resource knobs stay.
dangerous.non_interactive: "deny""read_only" Align the scaffold with the documented built-in default (deny is still available to operators who want it).
Add missing sections guard (with all 6 guard.scan scopes), profiles, transcription, vision, trusted_proxies
memory expanded + extract_facts: false, auto_approve_episodes: false (explicit security posture), min_turns_for_extraction, merge_on_write, consolidate_on_end
subagent expanded + max_depth, announce_budget, budget_inherit, alongside the existing default_profile
maintenance + artifacts_max_age_hours: 24; removed dead skills_skip_max_age_days (no longer exists in the config struct — Self-Learning-removal leftover)
telegram + default_chat_id, max_download_size (5 MiB), media_quota_per_chat
Init hint text Section list updated to match

Deliberately omitted

embedding / memory.embedding — the field is a pointer (*embedding.Config) with inherit-check semantics: pinning {} in a template would flip "configured vs unset" for every embedding-backed subsystem. Same class of reasoning for sessions/memory.extended (documented in CONFIG.md; the init hint points there).

Tests (RED-first)

New cmd/odek/init_template_test.go:

  • global template is valid JSON and carries every current section
  • global template must NOT pin "sandbox": false
  • dangerous.non_interactive must equal the documented default (read_only)
  • no dead keys (skills_skip_max_age_days), all new keys present
  • local template remains project-safe (re-pinned)

go test ./cmd/odek/ -run 'Template|InitConfig|Init' ✅ · go vet ✅ · go build ./...

Docs

docs/CONFIG.md "odek init" section synced with the new template coverage (same commit).

odek init --global had drifted behind the config surface:

- remove explicit "sandbox": false — unset inherits the default-on
  sandbox posture instead of silently opting fresh configs out
- dangerous.non_interactive: deny -> documented default read_only
- add missing sections: guard (with scan scopes), profiles,
  transcription, vision, trusted_proxies
- memory: +extract_facts/auto_approve_episodes (explicit security
  posture), +min_turns_for_extraction/merge_on_write/consolidate_on_end
- subagent: +max_depth/announce_budget/budget_inherit
- maintenance: +artifacts_max_age_hours; drop dead
  skills_skip_max_age_days (config struct no longer has it)
- telegram: +default_chat_id/max_download_size/media_quota_per_chat
- embedding intentionally omitted: pointer field with inherit-check —
  a pinned {} would flip configured-vs-unset semantics

New init_template_test.go pins section coverage, the sandbox posture,
the documented non_interactive default, and dead-key absence (RED-first).
CONFIG.md odek-init section synced in the same commit.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
odek 9ddb0cc Commit Preview URL

Branch Preview URL
Aug 31 2026, 11:08 AM

@jkyberneees
jkyberneees merged commit d132fe4 into main Aug 31, 2026
10 checks passed
@jkyberneees
jkyberneees deleted the fix/init-template-defaults branch August 31, 2026 11:12
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.

1 participant