fix bot-to-bot interaction in claude?
This commit is contained in:
parent
9721927050
commit
2df14ce071
|
|
@ -0,0 +1,27 @@
|
|||
<HTML>
|
||||
<HEAD>
|
||||
<!-- This is an automatically generated file.
|
||||
It will be read and overwritten.
|
||||
Do Not Edit! -->
|
||||
<TITLE>Links bookmarks</TITLE>
|
||||
</HEAD>
|
||||
<H1>Links bookmarks</H1>
|
||||
|
||||
<DL><P>
|
||||
<DT><H3>Links</H3>
|
||||
<DL>
|
||||
<DT><H3>English</H3>
|
||||
<DL>
|
||||
<DT><A HREF="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/calibration.html">Calibration Procedure</A>
|
||||
<DT><A HREF="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/">Links Homepage</A>
|
||||
<DT><A HREF="http://links.twibright.com/user_en.html">Links Manual</A>
|
||||
</DL>
|
||||
<DT><H3>Cesky</H3>
|
||||
<DL>
|
||||
<DT><A HREF="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/kalibrace.html">Kalibracni procedura</A>
|
||||
<DT><A HREF="http://atrey.karlin.mff.cuni.cz/~clock/twibright/links/index_cz.html">Links: domaci stranka</A>
|
||||
<DT><A HREF="http://links.twibright.com/user.html">Manual k Linksu</A>
|
||||
</DL>
|
||||
</DL>
|
||||
</DL><P>
|
||||
</HTML>
|
||||
|
|
@ -287,7 +287,10 @@ func (s *Session) Send(ctx context.Context, prompt string) (string, error) {
|
|||
return "", fmt.Errorf("send literal failed: %w", err)
|
||||
}
|
||||
|
||||
// Send Enter
|
||||
// Small delay to ensure tmux processes the literal text before sending submit
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
|
||||
// Send Enter (C-m) to submit the prompt
|
||||
if err := sendKeys(s.target(), "C-m"); err != nil {
|
||||
s.mu.Lock()
|
||||
s.state = "idle"
|
||||
|
|
@ -389,11 +392,25 @@ func (s *Session) SendAsync(ctx context.Context, prompt string) error {
|
|||
|
||||
target := s.target()
|
||||
|
||||
debug.Log("[session %s] SendAsync: target=%s prompt=%q", s.id, target, prompt)
|
||||
|
||||
// Send without waiting for completion
|
||||
if err := sendLiteral(target, prompt); err != nil {
|
||||
debug.Log("[session %s] SendAsync: sendLiteral failed: %v", s.id, err)
|
||||
return err
|
||||
}
|
||||
return sendKeys(target, "C-m")
|
||||
debug.Log("[session %s] SendAsync: sendLiteral succeeded, sending Enter", s.id)
|
||||
|
||||
// Small delay to ensure tmux processes the literal text before sending submit
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
|
||||
// Send Enter (C-m) to submit the prompt
|
||||
if err := sendKeys(target, "C-m"); err != nil {
|
||||
debug.Log("[session %s] SendAsync: sendKeys failed: %v", s.id, err)
|
||||
return err
|
||||
}
|
||||
debug.Log("[session %s] SendAsync: sendKeys succeeded", s.id)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) SendStream(ctx context.Context, prompt string) (io.ReadCloser, error) {
|
||||
|
|
|
|||
|
|
@ -356,12 +356,15 @@ func (s *Server) write(cs *connState, fc *plan9.Fcall) *plan9.Fcall {
|
|||
if sess == nil {
|
||||
return errFcall(fc, "session not found")
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "[DEBUG] /in write: session=%s input=%q state=%s\n", parts[1], input, sess.State())
|
||||
// Use async send to avoid blocking on response
|
||||
if tmuxSess, ok := sess.(*tmux.Session); ok {
|
||||
ctx := context.Background()
|
||||
if err := tmuxSess.SendAsync(ctx, input); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[DEBUG] /in write: SendAsync failed: %v\n", err)
|
||||
return errFcall(fc, err.Error())
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "[DEBUG] /in write: SendAsync succeeded\n")
|
||||
} else {
|
||||
return errFcall(fc, "async send not supported for this backend")
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue