Skip to content

feat(loop): add an opt-out prompt cue for stepwise output - #323

Open
raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/prompt-cue
Open

raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/prompt-cue

Conversation

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor

Summary

Adds a thin, model-facing prompt cue: work stepwise, verify claims with tools before
asserting them, keep the final answer tight, and reference retrieved memory or tool
results by their label.

The cue rides the existing transient_context_messages channel, so the runner places it
immediately before the user request — never inside system-level instructions, and never in
the compaction summarizer prefix (that would perturb the prefix / KV-cache alignment).

Changes

  • core/loop/cue.py (new): prompt_cue_enabled() + build_cue_context()
  • core/compat/agent.py: pass the cue as transient context on routed runs (11 lines)
  • tests/test_prompt_cue.py (new): 6 cases — every env spelling, injected shape

Switch

On by default; DEEPCODE_PROMPT_CUE=0 (also false / off / no) turns it off and
injects nothing.

Tests

pytest tests/test_prompt_cue.py -> 6 passed
ruff check --select E4,E7,E9,F  -> clean
ruff format --check             -> 3 files already formatted

Scope note

The full local CI replay was not run. Verification is targeted (the new module's own
suite plus lint). Upstream CI is the authoritative gate.

Tells the model to work stepwise, verify claims with tools before asserting
them, and keep the final answer tight. The cue rides the existing
transient_context_messages channel, so it lands immediately before the user
request and never inside system-level instructions or the compaction
summarizer prefix.

On by default; DEEPCODE_PROMPT_CUE=0 turns it off.

- core/loop/cue.py: prompt_cue_enabled + build_cue_context
- core/compat/agent.py: pass the cue as transient context on routed runs
- tests/test_prompt_cue.py: 6 cases (env spellings, injected shape)

This branch has not been deployed

No deployments
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