"new" in CECP (Xboard) mode starts a new game. Commonly engines clear internal state at that point. Almost all interfaces, including Xboard, send information about the opponent, including name, rating, and "computer" (if applicable) after "new." For consistency, lichess-bot should do this, too. But as the following log snippet shows, that data comes before "new:"
2023-02-02 05:35:42,957 chess.engine DEBUG Using PollingChildWatcher
2023-02-02 05:35:42,959 chess.engine DEBUG <XBoardProtocol (pid=3432)>: Connection made
2023-02-02 05:35:42,960 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << xboard
2023-02-02 05:35:42,960 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << protover 2
2023-02-02 05:35:42,966 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> Arasan v23.4.0-35-gcb41901 Copyright 1994-2022 by Jon Dart. All Rights Reserved.
2023-02-02 05:35:42,993 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> feature name=1 setboard=1 san=1 usermove=1 ping=1 ics=1 playother=0 sigint=0 colors=0 analyze=1 debug=1 memory=1 smp=1 variants="normal"\
egt="syzygy" option="Favor frequent book moves -spin 50 1 100" option="Favor best book moves -spin 50 1 100" option="Favor high-weighted book moves -spin 100 1 100" option="Randomize book moves -spin 50 1 100" \
option="Can resign -check 1" option="Resign threshold -spin -700 -1000 0" option="Position learning -check 1" option="Strength -spin 100 0 100" option="Use NNUE -check 1" option="NNUE file -string arasan-d10-202\
20723.nnue" option="Move overhead -spin 30 0 1000" myname="Arasan v23.4.0-35-gcb41901"
2023-02-02 05:35:42,994 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> feature done=0
2023-02-02 05:35:43,000 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> # found 6-man Syzygy tablebases in directory /home/jdart/chess/syzygy:/home/jdart/chess/syzygy-6man/wdl:/home/jdart/chess/syzygy-6man/dt\
z
2023-02-02 05:35:43,139 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> # loaded network from file arasan-d10-20220723.nnue
2023-02-02 05:35:43,139 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> feature done=1
2023-02-02 05:35:43,139 chess.engine WARNING <XBoardProtocol (pid=3432)>: Rejecting feature san=1
2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << rejected san
2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << accepted memory
2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << accepted smp
2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << accepted egt
2023-02-02 05:35:43,140 engine_wrapper DEBUG No paths found for egt type: syzygy.
2023-02-02 05:35:43,141 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << name BOT Pseudo-0
2023-02-02 05:35:43,141 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << rating 2639 2289
2023-02-02 05:35:43,142 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << computer
2023-02-02 05:35:43,142 mp_main DEBUG The engine for game F0mD2D5d has pid=3432
2023-02-02 05:35:43,142 mp_main INFO +++ https://lichess.org/F0mD2D5d/white Rapid vs BOT Pseudo-0(2289) (F0mD2D5d)
2023-02-02 05:35:43,142 conversation INFO https://lichess.org/F0mD2D5d/white [player] ArasanX: Hi! I'm ArasanX. Good luck! Type !help for a list of commands I can respond to.
2023-02-02 05:35:43,144 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): lichess.org:443
2023-02-02 05:35:43,595 urllib3.connectionpool DEBUG https://lichess.org:443 "POST /api/bot/game/F0mD2D5d/chat HTTP/1.1" 200 11
2023-02-02 05:35:43,596 conversation INFO https://lichess.org/F0mD2D5d/white [spectator] ArasanX: Hi! I'm ArasanX. Type !help for a list of commands I can respond to.
2023-02-02 05:35:43,746 urllib3.connectionpool DEBUG https://lichess.org:443 "POST /api/bot/game/F0mD2D5d/chat HTTP/1.1" 200 11
2023-02-02 05:35:43,746 mp_main INFO
2023-02-02 05:35:43,747 mp_main INFO move: 1
2023-02-02 05:35:43,747 engine_wrapper INFO Searching for time 10000 for game F0mD2D5d
2023-02-02 05:35:43,748 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << new
2023-02-02 05:35:43,748 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << force
2023-02-02 05:35:43,748 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << st 10.0
2023-02-02 05:35:43,749 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << post
2023-02-02 05:35:43,749 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << easy
2023-02-02 05:35:43,749 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << go
In order to implement this, changes need to be made both here and in the python-chess library. I will open a request with the library to have the necessary changes made.
"new" in CECP (Xboard) mode starts a new game. Commonly engines clear internal state at that point. Almost all interfaces, including Xboard, send information about the opponent, including name, rating, and "computer" (if applicable) after "new." For consistency, lichess-bot should do this, too. But as the following log snippet shows, that data comes before "new:"
2023-02-02 05:35:42,957 chess.engine DEBUG Using PollingChildWatcher 2023-02-02 05:35:42,959 chess.engine DEBUG <XBoardProtocol (pid=3432)>: Connection made 2023-02-02 05:35:42,960 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << xboard 2023-02-02 05:35:42,960 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << protover 2 2023-02-02 05:35:42,966 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> Arasan v23.4.0-35-gcb41901 Copyright 1994-2022 by Jon Dart. All Rights Reserved. 2023-02-02 05:35:42,993 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> feature name=1 setboard=1 san=1 usermove=1 ping=1 ics=1 playother=0 sigint=0 colors=0 analyze=1 debug=1 memory=1 smp=1 variants="normal"\ egt="syzygy" option="Favor frequent book moves -spin 50 1 100" option="Favor best book moves -spin 50 1 100" option="Favor high-weighted book moves -spin 100 1 100" option="Randomize book moves -spin 50 1 100" \ option="Can resign -check 1" option="Resign threshold -spin -700 -1000 0" option="Position learning -check 1" option="Strength -spin 100 0 100" option="Use NNUE -check 1" option="NNUE file -string arasan-d10-202\ 20723.nnue" option="Move overhead -spin 30 0 1000" myname="Arasan v23.4.0-35-gcb41901" 2023-02-02 05:35:42,994 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> feature done=0 2023-02-02 05:35:43,000 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> # found 6-man Syzygy tablebases in directory /home/jdart/chess/syzygy:/home/jdart/chess/syzygy-6man/wdl:/home/jdart/chess/syzygy-6man/dt\ z 2023-02-02 05:35:43,139 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> # loaded network from file arasan-d10-20220723.nnue 2023-02-02 05:35:43,139 chess.engine DEBUG <XBoardProtocol (pid=3432)>: >> feature done=1 2023-02-02 05:35:43,139 chess.engine WARNING <XBoardProtocol (pid=3432)>: Rejecting feature san=1 2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << rejected san 2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << accepted memory 2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << accepted smp 2023-02-02 05:35:43,140 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << accepted egt 2023-02-02 05:35:43,140 engine_wrapper DEBUG No paths found for egt type: syzygy. 2023-02-02 05:35:43,141 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << name BOT Pseudo-0 2023-02-02 05:35:43,141 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << rating 2639 2289 2023-02-02 05:35:43,142 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << computer 2023-02-02 05:35:43,142 mp_main DEBUG The engine for game F0mD2D5d has pid=3432 2023-02-02 05:35:43,142 mp_main INFO +++ https://lichess.org/F0mD2D5d/white Rapid vs BOT Pseudo-0(2289) (F0mD2D5d) 2023-02-02 05:35:43,142 conversation INFO https://lichess.org/F0mD2D5d/white [player] ArasanX: Hi! I'm ArasanX. Good luck! Type !help for a list of commands I can respond to. 2023-02-02 05:35:43,144 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): lichess.org:443 2023-02-02 05:35:43,595 urllib3.connectionpool DEBUG https://lichess.org:443 "POST /api/bot/game/F0mD2D5d/chat HTTP/1.1" 200 11 2023-02-02 05:35:43,596 conversation INFO https://lichess.org/F0mD2D5d/white [spectator] ArasanX: Hi! I'm ArasanX. Type !help for a list of commands I can respond to. 2023-02-02 05:35:43,746 urllib3.connectionpool DEBUG https://lichess.org:443 "POST /api/bot/game/F0mD2D5d/chat HTTP/1.1" 200 11 2023-02-02 05:35:43,746 mp_main INFO 2023-02-02 05:35:43,747 mp_main INFO move: 1 2023-02-02 05:35:43,747 engine_wrapper INFO Searching for time 10000 for game F0mD2D5d 2023-02-02 05:35:43,748 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << new 2023-02-02 05:35:43,748 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << force 2023-02-02 05:35:43,748 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << st 10.0 2023-02-02 05:35:43,749 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << post 2023-02-02 05:35:43,749 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << easy 2023-02-02 05:35:43,749 chess.engine DEBUG <XBoardProtocol (pid=3432)>: << go