fix: parse hosted context JSON + accept DELEGA_AGENT_KEY → 1.2.1#22
Merged
Conversation
Two small fixes batched into one patch release.
1. tasks show: context render (T2.3)
- Hosted API returns `context` as a JSON-encoded string (D1/SQLite
text column). Self-hosted returns a dict. Previously `tasks show`
against hosted printed the literal "{\"step\":\"done\"}" with
escape chars visible.
- Added normalizeContext() mirroring the logic in
delega-mcp/src/formatters.ts and delega-python's Task.from_dict.
Now both backends render the context block as indented JSON.
- Also surfaces root_task_id + delegation_depth on tasks that are
part of a chain (previously dropped).
2. Env var tolerance (T2.4)
- Accept DELEGA_AGENT_KEY as fallback for DELEGA_API_KEY so agents
configuring @delega-dev/mcp (primary: DELEGA_AGENT_KEY) and
@delega-dev/cli (primary: DELEGA_API_KEY) don't need to set both.
- DELEGA_API_KEY still wins when both are set (historical primary).
Sibling patch already shipped in @delega-dev/mcp@1.2.1; companion
patch landing in delega==0.2.1.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small fixes batched into one patch release.
T2.3 — `tasks show` context render
Hosted returns `context` as a JSON-encoded string (D1/SQLite text column). Self-hosted returns a dict. Previously `tasks show` against hosted printed `"{\"step\":\"done\"}"` with escape chars. Now both backends render as an indented JSON block.
Also surfaces `root_task_id` + `delegation_depth` when the task is part of a delegation chain (previously dropped).
`normalizeContext()` mirrors the logic in delega-mcp's formatters and delega-python's Task.from_dict.
T2.4 — env var tolerance
Accept `DELEGA_AGENT_KEY` as fallback for `DELEGA_API_KEY` so agents configuring the MCP (primary: `DELEGA_AGENT_KEY`) and CLI (primary: `DELEGA_API_KEY`) in the same shell don't need to set both. `DELEGA_API_KEY` still wins when both are set.
Sibling patches: @delega-dev/mcp@1.2.1 already shipped; delega==0.2.1 landing next.
Test plan
T2.3 + T2.4 from followups-after-1.2.0-night.md
🤖 Generated with Claude Code