Repository navigation
feat(steer): 도는 턴에 사용자 메시지를 넣는다 — mid-turn steering (4.105.0) - #179
Merged
Merged
Conversation
에이전트가 일하는 동안 사용자가 덧붙인 말을 그 턴 안으로 넣는 길. 예전에는 턴이 끝나기를 기다리거나 [정지] 하고 다시 말해야 했다. - core/steer.py: 스레드 안전한 턴 단위 받은 편지함(SteerInbox) · 메시지(SteerMessage). offer / take / take_or_close(원자적) / close(남은 것은 거절) / resolve(결말은 한 번). - Pipeline._take_steer: 반복 한 바퀴가 끝나 계속/완료가 정해진 직후에 받은 메시지를 대화에 넣는다. 도구 결과 뒤면 그 user 메시지에 text 블록으로(연속 user 메시지 회피), 답 뒤면 새 user 메시지. complete 였으면 한 번 더 돈다. 없으면 같은 잠금 안에서 닫는다. single_turn · 루프 단계 없음 · 정지 중이면 받지 않는다. - stream_turn(steer_inbox=...) / AgentTurnExecutor.run(steer_inbox=...): 붙이고 떼며, 들어간 메시지는 agent_event user_steer, 루프가 끝나며 돌려보낸 것은 user_steer_rejected 로 알린다. - 사건 목록 v22: user.steer. PipelineState._steer_inbox 는 하네스 장부(비공개). 넘기지 않는 호스트는 예전과 똑같다. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
왜
에이전트가 일하는 동안 사용자가 덧붙인 말("테스트도 돌려 줘", "그 파일 말고 이쪽")을 넣을 길이 없었습니다. 웹은 실행 중 입력창이 잠기고, Dex 는 실행 중 보낸 글을 버립니다. 사용자는 턴이 끝나기를 기다리거나 [정지] 하고 다시 말해야 했습니다. hr-harnessor 에서 쓰던 방식(턴마다 받은 편지함 → 다음 단계에서 대화에 넣기)을 Geny 런타임에 넣습니다.
무엇을 바꿨나
core/steer.py— 턴 단위 받은 편지함SteerInbox와SteerMessage. 호스트의 스레드/루프와 턴의 루프가 함께 쓰므로 잠금 하나로 지킵니다.offer/take/take_or_close(원자적: 꺼낼 것이 없으면 그 자리에서 닫음) /close(남은 것은 거절) /resolve(결말은 메시지마다 한 번,on_resolve콜백).Pipeline._take_steer— 반복 한 바퀴(모델 호출 + 그 도구들)가 끝나고 계속/완료가 정해진 직후:continue: 받은 것을 넣는다. 도구 결과 뒤라면 그 user 메시지에 text 블록으로 붙입니다(연속 user 메시지를 거절하는 제공자가 있음 — 번역기가 도구 결과와 글을 제공자마다 바르게 나눕니다).complete: 받은 것이 있으면 넣고 한 번 더 돕니다. 없으면 같은 잠금 안에서 닫아, 마지막 확인과 턴의 끝 사이에 메시지가 끼어 사라지는 틈이 없습니다.single_turn· 루프 단계 없음 · 정지 중인 턴은 받지 않고 돌려보냅니다(모델이 보지 못할 말을 "들어갔다" 고 하지 않습니다).suspend/error/escalate는 건드리지 않습니다(이어가기 슬라이스가 받거나, 턴이 끝날 때 돌아갑니다).STEER_FRAME한 줄 뒤에 사용자의 말을 그대로 받습니다.stream_turn(steer_inbox=...)/AgentTurnExecutor.run(..., steer_inbox=...)— 턴마다 붙이고 떼며, 들어간 메시지는agent_eventuser_steer, 루프가 끝나며 돌려보낸 것은user_steer_rejected로 같은 스트림에 알립니다.user.steer(+docs/events.md).PipelineState._steer_inbox는 하네스 장부라 공개 필드가 아닙니다(공개 계약 시험 그대로).받은 편지함을 넘기지 않는 호스트(커넥터·XD 등)는 예전과 똑같습니다.
시험
tests/unit/test_mid_turn_steer.py— 실제Pipeline+ 가짜 제공자:stream_turn이user_steer/user_steer_rejected를 내고 상태에서 받은 편지함을 뗌pytest tests: 6307 passed, 1 failed — 실패 1건(test_old_stage_module_is_gone)은 로컬에 남은 git-ignoredstages/s13_task_registry/__pycache__때문이며 이 변경과 무관합니다(깨끗한 체크아웃에서는 통과).ruff check·ruff format --check·mypy core llm_client·gen_event_docs --check통과.머지 뒤
xgen-workflow 의 런타임 고정을 4.105.0 으로 올리면 서버에서 켜집니다. workflow MR(
feat/mid-turn-steer)이 받은 편지함을 이미 엽니다 — 그 전 판(4.104)에서는 받지 않는 턴으로 동작하고, 화면이 턴이 끝난 뒤 다음 턴으로 보냅니다.🤖 Generated with Claude Code